diff --git a/.codeclimate.yml b/.codeclimate.yml new file mode 100644 index 00000000000..a84e6c1fdd0 --- /dev/null +++ b/.codeclimate.yml @@ -0,0 +1,13 @@ +# Save as .codeclimate.yml (note leading .) in project root directory +languages: + Ruby: false + JavaScript: true + PHP: true +engines: + phpcodesniffer: true +exclude_paths: + - 'build/*' + - 'dev/*' + - 'doc/*' + - 'test/*' + - 'htdocs/includes/*' \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 5bc5f49b2e5..54d937625ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ php: - 5.5 - 5.6 - 7.0 - + matrix: allow_failures: - php: 7.0 @@ -130,6 +130,8 @@ script: - php upgrade.php 3.7.0 3.8.0 ignoredbversion > upgrade370380.log # - cat upgrade370380.log - php upgrade2.php 3.7.0 3.8.0 ignoredbversion > upgrade370380-2.log + - php upgrade.php 3.8.0 3.9.0 ignoredbversion > upgrade380390.log + - php upgrade2.php 3.8.0 3.9.0 ignoredbversion > upgrade380390-2.log # - cat upgrade370380-2.log - cd ../.. - date diff --git a/COPYRIGHT b/COPYRIGHT index df0ba8b3e90..534770f0f75 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -13,8 +13,10 @@ Component Version License GPL Compatible ------------------------------------------------------------------------------------- PHP libraries: AdoDb-Date 0.33 Modified BSD License Yes Date convertion (not into rpm package) -ChromePHP 4.3.3 Apache Software License 2.0 Yes Return server log to chrome browser console +ChromePHP 4.1.0 Apache Software License 2.0 Yes Return server log to chrome browser console CKEditor 4.3.3 LGPL-2.1+ Yes Editor WYSIWYG +EvalMath 1.0 BSD Yes Safe math expressions evaluation +FirePHPCore 0.4.0 MIT License Yes Send logs to Firefox Firebug console FPDI 1.5.2 Apache Software License 2.0 Yes PDF templates management GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package) Mobiledetect 2.8.3 MIT License Yes Detect mobile devices browsers @@ -22,10 +24,12 @@ NuSoap 0.9.5 LGPL 2.1+ Yes PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency odtPHP 1.0.1 GPL-2+ b Yes Library to build/edit ODT files PHPExcel 1.8.0 LGPL-2.1+ Yes Read/Write XLS files, read ODS files -php-iban 1.4.6 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP +php-iban 1.4.7 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests +Raven-php 0.12.1 MIT License Yes Used for server-side error logging with Sentry logger Restler 3.0 LGPL-3+ Yes Library to develop REST Web services TCPDF 6.2.6 LGPL-3+ Yes PDF generation +TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement JS libraries: jQuery 1.11.3 MIT License Yes JS library @@ -48,7 +52,8 @@ jQuery TableDnD 0.6 GPL and MIT License Yes jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker jQuery Tiptip 1.3 GPL and MIT License Yes JS library for tooltips jsGantt 1.2 BSD License Yes JS library (to build Gantt reports) -JsTimezoneDetect 1.0.4 MIT Licence Yes JS library to detect user timezone +JsTimezoneDetect 1.0.4 MIT License Yes JS library to detect user timezone +Raven.js 1.1.19 MIT License Yes Used for client-side error logging with Sentry logger For licenses compatibility informations: http://www.fsf.org/licensing/licenses/index_html diff --git a/ChangeLog b/ChangeLog index bcc4a9ad66c..e9bd9ffe3b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,13 @@ Upgrading to any other version or any other database system is abolutely require make a Dolibarr upgrade. +***** ChangeLog for 3.9 compared to 3.8.* ***** + +WARNING: Following changes may create regression for some external modules, but were necessary to make +Dolibarr better: +- Deprecated hidden option MAIN_USE_CUSTOM_TRANSLATION has been removed. Use MAIN_OVERWRITE_TRANS_xx_YY instead. + + ***** ChangeLog for 3.8 compared to 3.7.* ***** For users: FIX: #2519 @@ -224,13 +231,29 @@ Dolibarr better: hook afterLogin or afterLoginFailed instead. - The trigger USER_CREATE_FROM_CONTACT has been replace with USER_CREATE and property context is now filled to make difference between creation from contact or not. - +- Function get_exdir require now 6 parameters. This is to prepare a future feature. ***** ChangeLog for 3.7.2 compared to 3.7.1 ***** FIX [ bug #2855 ] Wrong translation key in localtax report page FIX [ bug #1852 ] JS error when editing a customer order line FIX [ bug #2900 ] Courtesy title is not stored in create thirdparty form FIX [ bug #3055 ] Product image thumbnails were not deleted after deleting the image +FIX [ bug 1634 ] Error deleting a project when it had many linked objects +FIX [ bug 1925 ] "Link to order" option in supplier invoices is not working properly +FIX [ bug #3198 ] Trigger LINECONTRACT_INSERT passes Contrat as $object instead of ContratLigne +FIX: Not showing delivery date on rouget pdf +FIX: Not showing task extrafields when creating from left menu +FIX [ bug #3288 ] Tasks box is not properly drawn +FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts +FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights +FIX [ bug #3426 ] Unable to create an invoice from a contract with extrafields +FIX [ bug #3431 ] Invoice bank account is not respected +FIX [ bug #3432 ] Spaces should be removed from IBAN when formatting it +FIX [ bug #3358 ] Tasks box does not work with PostgreSQL +FIX [ bug #3383 ] Company name is overlapped with company direction in PDF models +FIX [ bug #3460 ] Bank account is not saved when creating a customer invoice and facing an error message + +NEW: Created new ContratLigne::insert function ***** ChangeLog for 3.7.1 compared to 3.7.* ***** FIX Bug in the new photo system @@ -255,11 +278,11 @@ FIX send mail, copy sendto don't read the list of contact FIX Properly escape untrusted data to prevent HTML injection. FIX send mail, copy sendto don't read the list of contact -Path to save photos of products was moved in 3.7.0 to match path of other attached files. If you had loose +Path to save photos of products was moved in 3.7.0 to match path of other attached files. If you had loose your photo on the photo tab of products, you can set the constant "PRODUCT_USE_OLD_PATH_FOR_PHOTO" to restore old path. -WARNING: +WARNING: Do not try to make any Dolibarr upgrade if you are running Mysql version 5.5.40. Mysql version 5.5.40 has a very critical bug making your data beeing definitely lost. @@ -269,7 +292,7 @@ make a Dolibarr upgrade. ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: -- New: Match other auth system: Login can be done entering login or user +- New: Match other auth system: Login can be done entering login or user email (this open the road for SSO). - New: Agenda export by project #1967. - New: Increase length of thirdparty to 128 chars. @@ -290,14 +313,14 @@ For users: - New: Can filter on status on interventions. - New: Add help info of field type into dictionary of payment types. - New: Add proposals into referer page of thirdparty. -- New: On contact list can set filter on both active and not active (no more exclusive select). +- New: On contact list can set filter on both active and not active (no more exclusive select). - New: Intervention documents are now available in ECM module. - New: Can attach supplier order to a customer order. -- New: Supervisor is now visible into user list. +- New: Supervisor is now visible into user list. - New: Add user of creation and validation on invoice export. - New: Add info page about browser. - New: Enable feature developed for 3.6 we forgot to enabled: Adding prefix - on uploaded file names. + on uploaded file names. - New: No more dependency between contract and service module. - New: [ task #867 ] Remove ESAEB external module code from core. - New: Can create proposal from an intervention. @@ -328,7 +351,7 @@ For users: Use accesskey on form search. - New: Intervention documents are now available in ECM module. - New: Add attachments on user card + in ECM module. -- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template. +- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template. - New: [ task #1204 ] add Numering contrat module free (like leopard in product module). - New: [ task #712 ] Add warning when creating invoice from proposal or order, when there is already one invoice. - New: Enable supplier price log table. @@ -336,8 +359,8 @@ For users: - New: [ task #1218 ] Can drag and drop an event from calendar to change its day. - New: Optimize size of image static resources. - New: Add hourly and daily amount on user card. Add weekly working hours and salary on user card. -- New: Content of predefined email come firstly from table llx_c_email_template, then translation key. -- New: Add option MAIN_GENERATE_INVOICES_WITH_PICTURE to show picture +- New: Content of predefined email come firstly from table llx_c_email_template, then translation key. +- New: Add option MAIN_GENERATE_INVOICES_WITH_PICTURE to show picture onto PDF like MAIN_GENERATE_PROPOSALS_WITH_PICTURE dir for proposals. - New: Add more search field in list of cheque deposits. - New: Add feature to order to invoice on supplier part. @@ -440,8 +463,8 @@ Dolibarr better: - Deprecated module "oscommerce" were removed. - Changed the way parameters are provided to scripts sync_xxx_ldap2dolibarr.php - Some field into database were renamed from "libelle" to "label". -- Table llx_c_pays were renamed into llx_c_country. -- Triggers *_BUILDDOC are removed. Building a doc is not a business event. For action after +- Table llx_c_pays were renamed into llx_c_country. +- Triggers *_BUILDDOC are removed. Building a doc is not a business event. For action after creation of a pdf or odt, hook "afterPDFCreation" or "afterODTCreation" must be used instead. - A lot of pages named fiche.php were renamed into card.php - A lot of pages named liste.php were renamed into list.php @@ -488,6 +511,10 @@ Dolibarr better: - Fix: Bad permission assignments for stock movements actions - Fix: [ bug #2891 ] Category hooks do not work - Fix: [ bug #2696 ] Adding complementary attribute fails if code is numerics +- Fix: [ bug #3074 ] Accruals accounting use payment date instead of commitment date in turnover reports for salaries +- Fix: Not showing product supplier reference when page break +- Fix: [ bug #3341 ] Missing translation in /compta/paiement_charge.php +- Fix: [ bug #3342 ] Taxes dictionary page does not accept localized decimals for localtax2 rate ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. @@ -598,7 +625,7 @@ For users: - Fix: Add actions events not implemented. - Fix: Price min of composition is not supplier price min by quantity. - Fix: [ bug #1356 ] Bank accountancy number is limited to 8 numbers. -- Fix: [ bug #1439 ] impossible to remove a a translation (multilanguage-feature) +- Fix: [ bug #1439 ] impossible to remove a a translation (multilanguage-feature) - New: If multilangue is enabled, mail (from propal, invoice, etc...) message is pre-defaulted in Customer language - Fix: [ bug #1459 ] _ADD_CONTACT and _DEL_CONTACT triggers do not intercept insertion when reported an error - Fix: [ bug #1478 ] BILL_PAYED trigger action does not intercept failure under some circumstances @@ -628,8 +655,8 @@ For developers: - New: A module can disable a standard ECM view. - New: Add multilang support into product webservice. - New: Add hooks on project card page. -- New: Add call_trigger method on CommonObject class. So new trigger call within object is just : -$result = $this->call_trigger($trigger_name, $user) +- New: Add call_trigger method on CommonObject class. So new trigger call within object is just : +$result = $this->call_trigger($trigger_name, $user) WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: @@ -671,6 +698,10 @@ Fix: [ bug #2715 ] Statistics page has broken layout with long thirdparty names Fix: [ bug #2570 ] [Contacts] Page should not process if ID is invalid Fix: [ bug #3268 ] SQL error when accessing thirdparty log page without a socid parameter Fix: [ bug #3180 ] formObjectOptions hook when editing thirdparty card does not print result +Fix: [ bug #1791 ] Margin menu not available if any Finance module is not enabled +Fix: [ bug #3310 ] OrderLine::fetch, FactureLigne::fetch and PropaleLigne::fetch do not return anything +Fix: [ bug #3206 ] PropaleLigne, OrderLine and FactureLigne given to triggers through update function does not contain all the information +Fix: [ bug #3313 ] Error enabling module with PostgreSQL database ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/build.xml b/build.xml index 570821a7c7b..c6995ce95f3 100644 --- a/build.xml +++ b/build.xml @@ -1,6 +1,6 @@ + -fdfds diff --git a/build/debian/README.howto b/build/debian/README.howto index 6140412b831..92397130a3a 100644 --- a/build/debian/README.howto +++ b/build/debian/README.howto @@ -117,7 +117,7 @@ http://bugs.debian.org/package severity 123 xxx -##### Update but tracker system +##### Update bug tracker system To set status of a bug to "pending" > bts --smtp-host=yoursmtpserver tag 999999 +pending @@ -195,7 +195,7 @@ If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VER * Some files are removed from archive by the get-orig-source.sh * Staying into git root directory, run -> git-import-orig -vv ../tcpdf_x.y.z+dfsg.orig.tar.xz +> git-import-orig -vv ../tcpdf_x.y.z+dfsg.orig.tar.xz --debian-branch=[master|jessie] --upstream-branch=[upstream|upstream-3.5.x] Note: If there was errors solved manually, you may need to make a git commit @@ -208,11 +208,15 @@ Warning: Date must have format reported by "date -R" Warning: Name and email must match value into debian/control file (Entry added here is used by next step). * We try to build package -> rm -fr ../build-area; git-buildpackage -us -uc +> rm -fr ../build-area; +> git-buildpackage -us -uc --git-debian-branch=[master|jessie] --git-upstream-branch=[upstream|upstream-3.5.x] +Note: To build an old version, do: git checkout oldtagname -b newbranchname; git-buildpackage -us -uc --git-debian-branch=newbranchname --git-upstream-branch=[upstream|upstream-3.5.x] Note: You can use git-buildpackage -us -uc --git-ignore-new if you want to test build with uncommited file Note: You can use git-buildpackage -us -uc -d if you want to test build when dependencies does not match Note: Package is built into directory ../build-area +Note: To compare 2 packages: debdiff package1.dsc package2.dsc + * If package .deb is ok: Note: If there was errors managed manually, you may need to make a git commit but do not use option "amend" previous commit @@ -220,7 +224,7 @@ Note: If there was errors managed manually, you may need to make a git commit bu * If ok, you can tag. > Edit debian/changelog to replace "UNRELEASED" into "unstable", then push -> git-buildpackage --git-tag-only --git-retag +> git-buildpackage --git-tag-only --git-retag --git-debian-branch=[master|jessie] --git-upstream-branch=[upstream|upstream-3.5.x] > git push --tags * Compilation is then done by a debian developer and sent @@ -249,7 +253,7 @@ from git clone dir and make link to git. * If local branch upstream and pristine-tar does not exists, create it from origin/upstream and origin/pristine. -* If new upstream is available onto sourceforge, launch: +* When new upstream is available onto sourceforge, launch: > debian/get-orig-source.sh If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VERIFY_HOSTNAME=0" to solve this. @@ -263,7 +267,7 @@ dolibarr-x.y.z+dfsgw.tgz (x.y.z = version, w start from 1 and is increased for each new git-import-orig already done) * Staying into git root directory, run -> git-import-orig -vv ../dolibarr-x.y.z+dfsgw.tgz +> git-import-orig -vv ../dolibarr-x.y.z+dfsgw.tgz --debian-branch=[master|jessie] --upstream-branch=[upstream|upstream-3.5.x] and enter version when requested with format x.y.z+dfsgw (x.y.z = version, w start from 1 and is increased for each new import) @@ -273,8 +277,8 @@ Note: If there was errors solved manually after get-orig-sources.sh, you may nee * Fix debian/* files used to build package. Add an entry into debian/changelog > dch -v x.y.z+dfsgw-v "My comment" will add entry. -For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version (x.y.z = version, w start from 1 and increaed for each new import) -Then modify changelog to replace "version" or "unstable" with "UNRELEASED". +For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version (x.y.z = version, w start from 1 and increased for each new import) +Then check/modify changelog to replace "version" or "unstable" with "UNRELEASED". Then check/modify also the user/date signature: - Date must have format reported by "date -R" - Name and email must match value into debian/control file (Entry added here is used by next step). @@ -289,21 +293,24 @@ To update dolibarr debian package when only files into debian has changed Once files has been prepared, it's time to test: * Try to build package -> rm -fr ../build-area; git-buildpackage -us -uc +> rm -fr ../build-area; +> git-buildpackage -us -uc --git-debian-branch=[master|jessie] --git-upstream-branch=[upstream|upstream-3.5.x] +Note: To build an old version, do: git checkout oldtagname -b newbranchname; git-buildpackage -us -uc --git-debian-branch=newbranchname --git-upstream-branch=[upstream|upstream-3.5.x] Note: You can use git-buildpackage -us -uc --git-ignore-new if you want to test build with uncommited file Note: You can use git-buildpackage -us -uc -d if you want to test build when dependencies does not match Note: Package is built into directory ../build-area +Note: To compare 2 packages: debdiff package1.dsc package2.dsc * Test package (see dedicated chapter to test it with debian unstable env) * If package .deb is ok: Note: If there was errors managed manually, you may need to make a git commit but do not use option "amend" previous commit -> git push --all ou git push origin --all +> git push --all * If ok, you can tag. > Edit debian/changelog to replace "UNRELEASED" into "unstable", then push -> git-buildpackage --git-tag-only --git-retag +> git-buildpackage --git-tag-only --git-retag --git-debian-branch=[master|jessie] --git-upstream-branch=[upstream|upstream-3.5.x] > git push --tags @@ -321,15 +328,42 @@ http://packages.qa.debian.org ##### Send an unblock request + Use this to move from unstable to testing. -reportbug -B debian + +reportbug -B debian --smtphost=smtp.gmail.com:587 --smtpuser=xxxx --smtppasswd=yyyy --tls Choose package "release.debian.org" Then "unblock" Then name of package "dolibarr" Fill message, for example: "Please unblock package dolibarr -A security error CVE-2014-7137 was reported and is fixed into package 3.5.5. -Note that package 3.5.5 was prepared before the CVE was reported and include other fixes, but they are all related to stability or security (other se$ +A security error CVE-2015-3935 was reported and is fixed into package 3.5.7. +Note that package 3.5.7 contains not only fixed for bugs reported to debian. It includes other fixes, but they are all related to stability or security, +so it is a better solution to validate this maintenance release than applying a patch of the only CVE-2015-3935. After discussion with ..., it appears that security holes are enough to request this unblock request." +Use this to request an update of a stable package + +reportbug -B debian --smtphost=smtp.gmail.com:587 --smtpuser=xxxx --smtppasswd=yyyy --tls +Choose package "release.debian.org" +Then "unblock" +Then name of package "dolibarr" +Fill message, for example: +" +A security error CVE-2015-3935 was reported for Dolibarr ERP CRM package. This bug is fixed into official package 3.5.7 of Dolibarr. +Package 3.5.7 is a maintenance release compared to 3.5.5 and contains only fixes. But not only bugs reported to debian, it includes also other fixes (but they are all related to stability or security). +I think it is a better solution to validate this maintenance release based on the new upstream version of Dolibarr than applying a patch of the only CVE-2015-3935. +Pro are: +- It fixes all debian reported bugs (including security one) +- It fixes also stability bugs +- Patches were already tested because deployed and used by several thousands of users. +- It is easier for package maintener to include this official set of fixes than applying one patch after one patch for each debian report or backported each patch into a dedicated version. +- Debian maintenance version matches with official project maintenance version (better when all fixes are not related to the way the software is packaged) +Cons are: +- The patch include more than the only one security reported fxes + +So I just need to know if it's ok to push such a version 3.5.7 (fixes for 3.5.* branch) instead of only one fix for only the few (the only) reported debian bugs, +since it provides more stability and is or me a more secured process. +" + diff --git a/build/debian/apache/dolibarr.conf b/build/debian/apache/dolibarr.conf index 95eaae21190..bdbb6e1b4c3 100644 --- a/build/debian/apache/dolibarr.conf +++ b/build/debian/apache/dolibarr.conf @@ -15,7 +15,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # Require all granted # # -# Order allow, deny +# Order allow,deny # Allow from all # # @@ -27,7 +27,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs Require all granted - Order allow, deny + Order allow,deny Allow from all diff --git a/build/exe/doliwamp/UsedPort.cpp b/build/exe/doliwamp/UsedPort.cpp index 15d2978b3bb..e2724b831a1 100644 --- a/build/exe/doliwamp/UsedPort.cpp +++ b/build/exe/doliwamp/UsedPort.cpp @@ -277,7 +277,7 @@ help=!(Port > 0); Usage: if (help) { printf("----- %s V%s (c)Laurent Destailleur -----\n",PROG,VERSION); - printf("%s is a software that allows you to know if a TCP/IP port is used\n",PROG); + printf("%s is software that allows you to know if a TCP/IP port is used\n",PROG); printf("%s sources can be compiled for WIN32 (VC++, GCC CYGWIN, MINGW) or for\n"); printf("Unix/Linux (GCC)\n",PROG); printf("\n"); diff --git a/build/generate_filecheck_xml.php b/build/generate_filecheck_xml.php index 04970b667f5..dbe96b4c0e9 100644 --- a/build/generate_filecheck_xml.php +++ b/build/generate_filecheck_xml.php @@ -39,12 +39,14 @@ parse_str($argv[1]); $outputfile=dirname(__FILE__).'/../htdocs/install/filelist.xml'; $fp = fopen($outputfile,'w'); fputs($fp, ''."\n"); -fputs($fp, ''."\n"); -fputs($fp, ''."\n"); -$dir_iterator = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/'); -$iterator = new RecursiveIteratorIterator($dir_iterator); +fputs($fp, ''."\n"); + +fputs($fp, ''."\n"); + +$dir_iterator1 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/'); +$iterator1 = new RecursiveIteratorIterator($dir_iterator1); // need to ignore document custom etc -$files = new RegexIterator($iterator, '#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install|nltechno))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); +$files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install|nltechno))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); $dir=''; $needtoclose=0; foreach ($files as $file) { @@ -61,7 +63,34 @@ foreach ($files as $file) { } } fputs($fp, ''."\n"); -fputs($fp, ''."\n"); +fputs($fp, ''."\n"); + + +fputs($fp, ''."\n"); + +$dir_iterator2 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../scripts/'); +$iterator2 = new RecursiveIteratorIterator($dir_iterator2); +// need to ignore document custom etc +$files = new RegexIterator($iterator2, '#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install|nltechno))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); +$dir=''; +$needtoclose=0; +foreach ($files as $file) { + $newdir = str_replace(dirname(__FILE__).'/../scripts', '', dirname($file)); + if ($newdir!=$dir) { + if ($needtoclose) + fputs($fp, ''."\n"); + fputs($fp, ''."\n"); + $dir = $newdir; + $needtoclose=1; + } + if (filetype($file)=="file") { + fputs($fp, ''.md5_file($file).''."\n"); + } +} +fputs($fp, ''."\n"); +fputs($fp, ''."\n"); + + fputs($fp, ''."\n"); fclose($fp); diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 3163200f2f4..99ec7b3543a 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -467,6 +467,7 @@ if ($nboftargetok) { # Removed known external modules to avoid any error when packaging from env where external modules are tested $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom/*`; # For custom we want to keep dir + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/allscreens*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/ancotec*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/cabinetmed*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/calling*`; @@ -475,13 +476,14 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/lead*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/ndf*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/oscim*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`; - # Removed other test files $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`; + # Removed other test files $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/eldy/*.new`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/api/explorer`; # This is a dev tool $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`; diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index 31578905202..aaaa1fdb33a 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -1,7 +1,7 @@ #---------------------------------------------------------------------------- # \file dolibarr.pl # \brief Dolibarr script install for Virtualmin Pro -# \author (c)2009-2012 Regis Houssin +# \author (c)2009-2015 Regis Houssin #---------------------------------------------------------------------------- @@ -30,8 +30,7 @@ return "Regis Houssin"; # script_dolibarr_versions() sub script_dolibarr_versions { - # TODO Replace this with version of Dolibar we want to install - return ( "x.y.z", "3.6.0"); +return ( "3.7.2", "3.6.3", "3.5.6" ); } sub script_dolibarr_category @@ -57,6 +56,26 @@ local ($d, $ver) = @_; return ("mysql", "postgres"); } +# script_dolibarr_depends(&domain, version) +sub script_dolibarr_depends +{ +local ($d, $ver, $sinfo, $phpver) = @_; +local @rv; + +if ($ver >= 3.6) { + # Check for PHP 5.3+ + local $phpv = &get_php_version($phpver || 5, $d); + if (!$phpv) { + push(@rv, "Could not work out exact PHP version"); + } + elsif ($phpv < 5.3) { + push(@rv, "Dolibarr requires PHP version 5.3 or later"); + } + } + +return @rv; +} + # script_dolibarr_params(&domain, version, &upgrade-info) # Returns HTML for table rows for options for installing dolibarr sub script_dolibarr_params @@ -78,8 +97,7 @@ else { $rv .= &ui_table_row("Database for Dolibarr tables", &ui_database_select("db", undef, \@dbs, $d, "dolibarr")); $rv .= &ui_table_row("Install sub-directory under $hdir", - &ui_opt_textbox("dir", "dolibarr", 30, - "At top level")); + &ui_opt_textbox("dir", &substitute_scriptname_template("dolibarr", $d), 30, "At top level")); if ($d->{'ssl'} && $ver >= 3.0) { $rv .= &ui_table_row("Force https connection?", &ui_yesno_radio("forcehttps", 0)); @@ -159,7 +177,8 @@ if ($opts->{'newdb'} && !$upgrade) { local ($dbtype, $dbname) = split(/_/, $opts->{'db'}, 2); local $dbuser = $dbtype eq "mysql" ? &mysql_user($d) : &postgres_user($d); local $dbpass = $dbtype eq "mysql" ? &mysql_pass($d) : &postgres_pass($d, 1); -local $dbphptype = $dbtype eq "mysql" ? "mysqli" : "pgsql"; +local $dbphptype = $dbtype eq "mysql" && $version >= 3.6 ? "mysql" : + $dbtype eq "mysql" ? "mysqli" : "pgsql"; local $dbhost = &get_database_host($dbtype); local $dberr = &check_script_db_connection($dbtype, $dbname, $dbuser, $dbpass); return (0, "Database connection failed : $dberr") if ($dberr); @@ -201,12 +220,10 @@ if ($opts->{'path'} =~ /\w/) { if (!$upgrade) { local $cdef = "$opts->{'dir'}/conf/conf.php.example"; &run_as_domain_user($d, "cp ".quotemeta($cdef)." ".quotemeta($cfile)); - &set_ownership_permissions(undef, undef, 0777, $cfiledir); - &set_ownership_permissions(undef, undef, 0666, $cfile); + &set_permissions_as_domain_user($d, 0777, $cfiledir); + &set_permissions_as_domain_user($d, 0666, $cfile); &run_as_domain_user($d, "mkdir ".quotemeta($docdir)); - &set_ownership_permissions(undef, undef, 0777, $docdir); - &run_as_domain_user($d, "mkdir ".quotemeta($altdir)); - &set_ownership_permissions(undef, undef, 0777, $altdir); + &set_permissions_as_domain_user($d, 0777, $docdir); } else { # Preserve old config file, documents and custom directory @@ -289,8 +306,8 @@ else { local $dinstall = "$opts->{'dir'}/install"; $dinstall =~ s/\/$//; $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall)); - &set_ownership_permissions(undef, undef, 0644, $cfile); - &set_ownership_permissions(undef, undef, 0755, $cfiledir); + &set_permissions_as_domain_user($d, 0644, $cfile); + &set_permissions_as_domain_user($d, 0755, $cfiledir); } # Return a URL for the user @@ -309,6 +326,7 @@ local $ipage = $opts->{'path'}."/install/".$page.".php"; local ($iout, $ierror); &post_http_connection($d, $ipage, $params, \$iout, \$ierror); +print STDERR $iout; if ($ierror) { return $ierror; @@ -329,10 +347,10 @@ local $derr = &delete_script_install_directory($d, $opts); return (0, $derr) if ($derr); # Remove all llx_ tables from the database -# 3 times because of constraints -&cleanup_script_database($d, $opts->{'db'}, "llx_"); -&cleanup_script_database($d, $opts->{'db'}, "llx_"); -&cleanup_script_database($d, $opts->{'db'}, "llx_"); +# 4 times because of constraints +for(my $i=0; $i<4; $i++) { + &cleanup_script_database($d, $opts->{'db'}, "llx_"); + } # Take out the DB if ($opts->{'newdb'}) { diff --git a/composer.json b/composer.json index ed75d3ca61d..80e55b6a221 100644 --- a/composer.json +++ b/composer.json @@ -6,27 +6,40 @@ "homepage": "http://www.dolibarr.org", "license": "GPL-3.0+", "support": { - "issues": "https://doliforge.org/projects/dolibarr", + "issues": "https://github.com/Dolibarr/dolibarr/issues", "forum": "http://www.dolibarr.org/forum", - "wiki": "http://wiki.dolibarr.org" + "wiki": "http://wiki.dolibarr.org", + "irc": "irc://chat.freenode.net/dolibarr", + "source": "https://github.com/Dolibarr/dolibarr" }, "require": { "php": ">=5.3.0", - "ext-gd": "*", "ext-curl": "*", - "restler/framework": "3.0.*" + "ccampbell/chromephp": "^4.1", + "ckeditor/ckeditor": "4.3.3", + "mobiledetect/mobiledetectlib": "2.8.3", + "phpoffice/phpexcel": "1.8.0", + "restler/framework": "^3.0", + "tecnick.com/tcpdf": "6.2.6", + "raven/raven": "^0.12.0", + "firephp/firephp-core": "^0.4.0" }, "suggest": { - "ext-mysqli": "*", - "ext-pgsql": "*", - "ext-mssql": "*", - "ext-pdo_sqlite": "*", - "ext-imagick": "*", - "ext-mcrypt": "*", - "ext-openssl": "*", - "ext-mbstring": "*", - "ext-soap": "*", - "ext-zip": "*", - "ext-xml": "*" + "ext-mysqlnd": "To use with MySQL or MariaDB", + "ext-mysqli": "To use with MySQL or MariaDB", + "ext-pgsql": "To use with PostgreSQL", + "ext-mssql": "To use with MSSQL (experimental)", + "ext-pdo_sqlite": "To use with SQLite (experimental)", + "ext-gd": "Image manipulation (Required but maybe built-in PHP)", + "ext-imagick": "Image manipulation (TCPDF)", + "ext-mcrypt": "(Required but maybe built-in PHP)", + "ext-openssl": "Secure connections (Emails, SOAP…)", + "ext-mbstring": "Handle non UTF-8 databases", + "ext-soap": "Native SOAP", + "ext-zip": "ODT and Excel support", + "ext-xml": "Excel support" + }, + "config": { + "vendor-dir": "htdocs/includes" } } diff --git a/composer.lock b/composer.lock new file mode 100644 index 00000000000..f178ec4f419 --- /dev/null +++ b/composer.lock @@ -0,0 +1,441 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "f441e6348ae7862942693cab10810418", + "packages": [ + { + "name": "ccampbell/chromephp", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/ccampbell/chromephp.git", + "reference": "c3c297615d48ae5b2a86a82311152d1ed095fcef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ccampbell/chromephp/zipball/c3c297615d48ae5b2a86a82311152d1ed095fcef", + "reference": "c3c297615d48ae5b2a86a82311152d1ed095fcef", + "shasum": "" + }, + "require": { + "php": ">=5.0.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "ChromePhp": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Craig Campbell", + "email": "iamcraigcampbell@gmail.com", + "homepage": "http://craig.is", + "role": "Developer" + } + ], + "description": "Log variables to the Chrome console (via Chrome Logger Google Chrome extension).", + "homepage": "http://github.com/ccampbell/chromephp", + "keywords": [ + "log", + "logging" + ], + "time": "2013-06-26 03:44:33" + }, + { + "name": "ckeditor/ckeditor", + "version": "4.3.3", + "source": { + "type": "git", + "url": "https://github.com/ckeditor/ckeditor-releases.git", + "reference": "0068dd540ce8bf1815abb7b5455c55354bc56334" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ckeditor/ckeditor-releases/zipball/0068dd540ce8bf1815abb7b5455c55354bc56334", + "reference": "0068dd540ce8bf1815abb7b5455c55354bc56334", + "shasum": "" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+", + "LGPL-2.1+", + "MPL-1.1+" + ], + "authors": [ + { + "name": "CKSource - Frederico Knabben", + "homepage": "http://cksource.com" + } + ], + "description": "JavaScript WYSIWYG web text editor.", + "homepage": "http://ckeditor.com", + "keywords": [ + "CKEditor", + "editor", + "fckeditor", + "html", + "javascript", + "richtext", + "text", + "wysiwyg" + ], + "time": "2014-02-26 15:34:37" + }, + { + "name": "firephp/firephp-core", + "version": "v0.4.0", + "source": { + "type": "git", + "url": "https://github.com/firephp/firephp-core.git", + "reference": "fabad0f2503f9577fe8dd2cb1d1c7cd73ed2aacf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/firephp/firephp-core/zipball/fabad0f2503f9577fe8dd2cb1d1c7cd73ed2aacf", + "reference": "fabad0f2503f9577fe8dd2cb1d1c7cd73ed2aacf", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib/FirePHPCore/FirePHP.class.php", + "lib/FirePHPCore/fb.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christoph Dorn", + "email": "christoph@christophdorn.com", + "homepage": "http://christophdorn.com" + } + ], + "description": "Traditional FirePHPCore library for sending PHP variables to the browser.", + "homepage": "https://github.com/firephp/firephp-core", + "time": "2013-04-23 15:28:20" + }, + { + "name": "mobiledetect/mobiledetectlib", + "version": "2.8.3", + "source": { + "type": "git", + "url": "https://github.com/serbanghita/Mobile-Detect.git", + "reference": "f5753e4b90daffe50c902e99df5ce3c58fca3fee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/f5753e4b90daffe50c902e99df5ce3c58fca3fee", + "reference": "f5753e4b90daffe50c902e99df5ce3c58fca3fee", + "shasum": "" + }, + "require": { + "php": ">=5.0.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "type": "library", + "autoload": { + "classmap": [ + "Mobile_Detect.php" + ], + "psr-0": { + "Detection": "namespaced/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Serban Ghita", + "email": "serbanghita@gmail.com", + "homepage": "http://ghita.org", + "role": "Developer" + } + ], + "description": "Mobile_Detect is a lightweight PHP class for detecting mobile devices. It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.", + "homepage": "https://github.com/serbanghita/Mobile-Detect", + "keywords": [ + "detect mobile devices", + "mobile", + "mobile detect", + "mobile detector", + "php mobile detect" + ], + "time": "2014-07-10 20:00:25" + }, + { + "name": "phpoffice/phpexcel", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/PHPOffice/PHPExcel.git", + "reference": "e69a5e4d0ffa7fb6f171859e0a04346e580df30b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/e69a5e4d0ffa7fb6f171859e0a04346e580df30b", + "reference": "e69a5e4d0ffa7fb6f171859e0a04346e580df30b", + "shasum": "" + }, + "require": { + "ext-xml": "*", + "ext-xmlwriter": "*", + "php": ">=5.2.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "PHPExcel": "Classes/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL" + ], + "authors": [ + { + "name": "Maarten Balliauw", + "homepage": "http://blog.maartenballiauw.be" + }, + { + "name": "Mark Baker" + }, + { + "name": "Franck Lefevre", + "homepage": "http://blog.rootslabs.net" + }, + { + "name": "Erik Tilt" + } + ], + "description": "PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", + "homepage": "http://phpexcel.codeplex.com", + "keywords": [ + "OpenXML", + "excel", + "php", + "spreadsheet", + "xls", + "xlsx" + ], + "time": "2014-03-02 15:22:49" + }, + { + "name": "raven/raven", + "version": "0.12.1", + "source": { + "type": "git", + "url": "https://github.com/getsentry/raven-php.git", + "reference": "b325984c792ff89f985b73da9a3ad8ed8b520bca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/getsentry/raven-php/zipball/b325984c792ff89f985b73da9a3ad8ed8b520bca", + "reference": "b325984c792ff89f985b73da9a3ad8ed8b520bca", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.2.4" + }, + "require-dev": { + "fabpot/php-cs-fixer": "^1.8.0", + "phpunit/phpunit": "^4.6.6" + }, + "bin": [ + "bin/raven" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.12.x-dev" + } + }, + "autoload": { + "psr-0": { + "Raven_": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD" + ], + "authors": [ + { + "name": "David Cramer", + "email": "dcramer@gmail.com" + } + ], + "description": "A PHP client for Sentry (http://getsentry.com)", + "homepage": "http://getsentry.com", + "keywords": [ + "log", + "logging" + ], + "time": "2015-08-25 22:38:46" + }, + { + "name": "restler/framework", + "version": "3.0.0", + "target-dir": "Luracast/Restler", + "source": { + "type": "git", + "url": "https://github.com/Luracast/Restler-Framework.git", + "reference": "6ee10b3e5dbc6376916fed55ec2340a37cce436b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Luracast/Restler-Framework/zipball/6ee10b3e5dbc6376916fed55ec2340a37cce436b", + "reference": "6ee10b3e5dbc6376916fed55ec2340a37cce436b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "replace": { + "luracast/restler": "3.*" + }, + "require-dev": { + "bshaffer/oauth2-server-php": "v1.0", + "luracast/explorer": "*", + "mustache/mustache": "dev-master", + "rodneyrehm/plist": "dev-master", + "symfony/yaml": "*", + "twig/twig": "v1.13.0", + "zendframework/zendamf": "dev-master" + }, + "suggest": { + "bshaffer/oauth2-server-php": "Restler can provide OAuth2 authentication using this library (see require-dev for details)", + "luracast/explorer": "Restler's very own api explorer (see require-dev for details)", + "mustache/mustache": "Restler can render HtmlView using mustache/handlebar templates (see require-dev for details)", + "rodneyrehm/plist": "Restler supports tho Apple plist xml format (see require-dev for details)", + "symfony/yaml": "Restler can produce content in yaml format as well (see require-dev for details)", + "twig/twig": "Restler can render HtmlView using twig templates (see require-dev for details)", + "zendframework/zendamf": "Support for the amf document format (see require-dev for details)" + }, + "type": "library", + "extra": { + "branch-alias": { + "master": "v3.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Luracast\\Restler": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1" + ], + "authors": [ + { + "name": "Luracast", + "email": "arul@luracast.com" + }, + { + "name": "Nick nickl- Lombard", + "email": "github@jigsoft.co.za" + } + ], + "description": "Just the Restler Framework without the tests and examples", + "homepage": "http://luracast.com/products/restler/", + "keywords": [ + "api", + "framework", + "rest", + "server" + ], + "time": "2015-08-04 07:52:49" + }, + { + "name": "tecnick.com/tcpdf", + "version": "6.2.6", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/TCPDF.git", + "reference": "a2e8f5b505a7a14a4ed960313c4baf699fd1f4bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/a2e8f5b505a7a14a4ed960313c4baf699fd1f4bb", + "reference": "a2e8f5b505a7a14a4ed960313c4baf699fd1f4bb", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "fonts", + "config", + "include", + "tcpdf.php", + "tcpdf_parser.php", + "tcpdf_import.php", + "tcpdf_barcodes_1d.php", + "tcpdf_barcodes_2d.php", + "include/tcpdf_colors.php", + "include/tcpdf_filters.php", + "include/tcpdf_font_data.php", + "include/tcpdf_fonts.php", + "include/tcpdf_images.php", + "include/tcpdf_static.php", + "include/barcodes/datamatrix.php", + "include/barcodes/pdf417.php", + "include/barcodes/qrcode.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPLv3" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "homepage": "http://nicolaasuni.tecnick.com" + } + ], + "description": "TCPDF is a PHP class for generating PDF documents and barcodes.", + "homepage": "http://www.tcpdf.org/", + "keywords": [ + "PDFD32000-2008", + "TCPDF", + "barcodes", + "datamatrix", + "pdf", + "pdf417", + "qrcode" + ], + "time": "2015-01-28 18:51:40" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.3.0", + "ext-curl": "*" + }, + "platform-dev": [] +} diff --git a/dev/ansible/README.md b/dev/ansible/README.md deleted file mode 100644 index e498ebc3340..00000000000 --- a/dev/ansible/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# This directory contains script example to use ansible to deploy or maitains dolibarr instances - -This is a quick tutorial: - -* Install ansible: -> apt-get install ansible - -* Add ip of server to manage into -/etc/ansible/hosts - -* Deploy public key to managed servers -- authorized_key: user=charlie key="{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}" - - diff --git a/dev/ansible/deployplaybook/deploydev.yml b/dev/ansible/deployplaybook/deploydev.yml deleted file mode 100644 index 5802fb10a1e..00000000000 --- a/dev/ansible/deployplaybook/deploydev.yml +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env ansible-playbook - -# Run script with ansible-playbook deploydev.yml -# or ./deploydev.yml - -- name: Configure webserver with apache - hosts: webservers - sudo: True - tasks: - - name: install apache - apt: name=apache update_cache=yes - - name: copy apache config file - copy: src=files/apachealias.conf dest=/etc/apache/conf.d/dolibarr_dev - #- name: enable configuration - # file: > - # dest=/etc/apache/sites-enabled/default - # src=/etc/apache/sites-available/default - # state=link - - name: copy info.html - template: src=templates/info.html.j2 dest=/var/www/dolibarr_dev/info.html - mode=0644 - - name: restart apache - service: name=apache state=restarted - diff --git a/dev/ansible/deployplaybook/files/apachealias.conf b/dev/ansible/deployplaybook/files/apachealias.conf deleted file mode 100644 index d801094af5a..00000000000 --- a/dev/ansible/deployplaybook/files/apachealias.conf +++ /dev/null @@ -1,2 +0,0 @@ - -Alias /dolibarr_dev /var/www/dolibarr diff --git a/dev/ansible/deployplaybook/hosts b/dev/ansible/deployplaybook/hosts deleted file mode 100644 index 99627faba2b..00000000000 --- a/dev/ansible/deployplaybook/hosts +++ /dev/null @@ -1,2 +0,0 @@ -[webservers] -testserver ansible_ssh_host=127.0.0.1 ansible_ssh_port=22 diff --git a/dev/ansible/deployplaybook/templates/info.html.j2 b/dev/ansible/deployplaybook/templates/info.html.j2 deleted file mode 100644 index 66fac1c4deb..00000000000 --- a/dev/ansible/deployplaybook/templates/info.html.j2 +++ /dev/null @@ -1,10 +0,0 @@ - - - Page info ansible - - -

Apache, configured by Ansible

-

If you can see this, Ansible successfully installed apache.

-

{{ ansible_managed }}

- - \ No newline at end of file diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index bf68293d369..9d449070a5f 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -69,7 +69,7 @@ Add tcpdi.php Add tcpdi_parser.php and replace: require_once(dirname(__FILE__).'/include/tcpdf_filters.php'); with: -require_once(dirname(__FILE__).'/../tcpdf/include/tcpdf_filters.php'); +require_once(dirname(__FILE__).'/../tecnick.com/tcpdf/include/tcpdf_filters.php'); diff --git a/dev/fixdosfiles.sh b/dev/fixdosfiles.sh index 75dde68dcae..f770e28537d 100755 --- a/dev/fixdosfiles.sh +++ b/dev/fixdosfiles.sh @@ -24,7 +24,7 @@ fi # To convert if [ "x$1" = "xfix" ] then - for fic in `find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" -o -iname "*.xml"\) -exec file "{}" + | grep CRLF | awk -F':' '{ print $1 }' ` + for fic in `find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep CRLF | awk -F':' '{ print $1 }' ` do echo "Fix file $fic" dos2unix $fic diff --git a/dev/initdata/mysqldump_dolibarr_3.8.0.sql b/dev/initdata/mysqldump_dolibarr_3.8.0.sql index 75bd53709a6..c8ab81bb582 100644 --- a/dev/initdata/mysqldump_dolibarr_3.8.0.sql +++ b/dev/initdata/mysqldump_dolibarr_3.8.0.sql @@ -145,7 +145,7 @@ CREATE TABLE `llx_accountingaccount` ( LOCK TABLES `llx_accountingaccount` WRITE; /*!40000 ALTER TABLE `llx_accountingaccount` DISABLE KEYS */; -INSERT INTO `llx_accountingaccount` VALUES (1,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CAPIT','CAPITAL','101','1401','Capital',NULL,NULL,1),(2,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CAPIT','XXXXXX','105','1401','Ecarts de réévaluation',NULL,NULL,1),(3,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CAPIT','XXXXXX','1061','1401','Réserve légale',NULL,NULL,1),(4,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CAPIT','XXXXXX','1063','1401','Réserves statutaires ou contractuelles',NULL,NULL,1),(5,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CAPIT','XXXXXX','1064','1401','Réserves réglementées',NULL,NULL,1),(6,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CAPIT','XXXXXX','1068','1401','Autres réserves',NULL,NULL,1),(7,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CAPIT','XXXXXX','108','1401','Compte de l\'exploitant',NULL,NULL,1),(8,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CAPIT','XXXXXX','12','1401','Résultat de l\'exercice',NULL,NULL,1),(9,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CAPIT','XXXXXX','145','1401','Amortissements dérogatoires',NULL,NULL,1),(10,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CAPIT','XXXXXX','146','1401','Provision spéciale de réévaluation',NULL,NULL,1),(11,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CAPIT','XXXXXX','147','1401','Plus-values réinvesties',NULL,NULL,1),(12,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CAPIT','XXXXXX','148','1401','Autres provisions réglementées',NULL,NULL,1),(13,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CAPIT','XXXXXX','15','1401','Provisions pour risques et charges',NULL,NULL,1),(14,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CAPIT','XXXXXX','16','1401','Emprunts et dettes assimilees',NULL,NULL,1),(15,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','IMMO','XXXXXX','20','1402','Immobilisations incorporelles',NULL,NULL,1),(16,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','IMMO','XXXXXX','201','15','Frais d\'établissement',NULL,NULL,1),(17,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','IMMO','XXXXXX','206','15','Droit au bail',NULL,NULL,1),(18,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','IMMO','XXXXXX','207','15','Fonds commercial',NULL,NULL,1),(19,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','IMMO','XXXXXX','208','15','Autres immobilisations incorporelles',NULL,NULL,1),(20,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','IMMO','XXXXXX','21','1402','Immobilisations corporelles',NULL,NULL,1),(21,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','IMMO','XXXXXX','23','1402','Immobilisations en cours',NULL,NULL,1),(22,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','IMMO','XXXXXX','27','1402','Autres immobilisations financieres',NULL,NULL,1),(23,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','IMMO','XXXXXX','280','1402','Amortissements des immobilisations incorporelles',NULL,NULL,1),(24,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','IMMO','XXXXXX','281','1402','Amortissements des immobilisations corporelles',NULL,NULL,1),(25,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','IMMO','XXXXXX','290','1402','Provisions pour dépréciation des immobilisations incorporelles',NULL,NULL,1),(26,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','IMMO','XXXXXX','291','1402','Provisions pour dépréciation des immobilisations corporelles',NULL,NULL,1),(27,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','IMMO','XXXXXX','297','1402','Provisions pour dépréciation des autres immobilisations financières',NULL,NULL,1),(28,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','STOCK','XXXXXX','31','1403','Matieres premières',NULL,NULL,1),(29,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','STOCK','XXXXXX','32','1403','Autres approvisionnements',NULL,NULL,1),(30,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','STOCK','XXXXXX','33','1403','En-cours de production de biens',NULL,NULL,1),(31,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','STOCK','XXXXXX','34','1403','En-cours de production de services',NULL,NULL,1),(32,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','STOCK','XXXXXX','35','1403','Stocks de produits',NULL,NULL,1),(33,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','STOCK','XXXXXX','37','1403','Stocks de marchandises',NULL,NULL,1),(34,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','STOCK','XXXXXX','391','1403','Provisions pour dépréciation des matières premières',NULL,NULL,1),(35,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','STOCK','XXXXXX','392','1403','Provisions pour dépréciation des autres approvisionnements',NULL,NULL,1),(36,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','STOCK','XXXXXX','393','1403','Provisions pour dépréciation des en-cours de production de biens',NULL,NULL,1),(37,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','STOCK','XXXXXX','394','1403','Provisions pour dépréciation des en-cours de production de services',NULL,NULL,1),(38,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','STOCK','XXXXXX','395','1403','Provisions pour dépréciation des stocks de produits',NULL,NULL,1),(39,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','STOCK','XXXXXX','397','1403','Provisions pour dépréciation des stocks de marchandises',NULL,NULL,1),(40,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','SUPPLIER','400','1404','Fournisseurs et Comptes rattachés',NULL,NULL,1),(41,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','409','1404','Fournisseurs débiteurs',NULL,NULL,1),(42,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','CUSTOMER','410','1404','Clients et Comptes rattachés',NULL,NULL,1),(43,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','419','1404','Clients créditeurs',NULL,NULL,1),(44,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','421','1404','Personnel',NULL,NULL,1),(45,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','428','1404','Personnel',NULL,NULL,1),(46,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','43','1404','Sécurité sociale et autres organismes sociaux',NULL,NULL,1),(47,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','444','1404','Etat - impôts sur bénéfice',NULL,NULL,1),(48,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','445','1404','Etat - Taxes sur chiffre affaires',NULL,NULL,1),(49,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','447','1404','Autres impôts, taxes et versements assimilés',NULL,NULL,1),(50,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','45','1404','Groupe et associes',NULL,NULL,1),(51,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','455','50','Associés',NULL,NULL,1),(52,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','46','1404','Débiteurs divers et créditeurs divers',NULL,NULL,1),(53,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','47','1404','Comptes transitoires ou d\'attente',NULL,NULL,1),(54,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','481','1404','Charges à répartir sur plusieurs exercices',NULL,NULL,1),(55,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','486','1404','Charges constatées d\'avance',NULL,NULL,1),(56,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','487','1404','Produits constatés d\'avance',NULL,NULL,1),(57,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','491','1404','Provisions pour dépréciation des comptes de clients',NULL,NULL,1),(58,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','496','1404','Provisions pour dépréciation des comptes de débiteurs divers',NULL,NULL,1),(59,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','FINAN','XXXXXX','50','1405','Valeurs mobilières de placement',NULL,NULL,1),(60,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','FINAN','BANK','51','1405','Banques, établissements financiers et assimilés',NULL,NULL,1),(61,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','FINAN','CASH','53','1405','Caisse',NULL,NULL,1),(62,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','FINAN','XXXXXX','54','1405','Régies d\'avance et accréditifs',NULL,NULL,1),(63,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','FINAN','XXXXXX','58','1405','Virements internes',NULL,NULL,1),(64,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','FINAN','XXXXXX','590','1405','Provisions pour dépréciation des valeurs mobilières de placement',NULL,NULL,1),(65,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','PRODUCT','60','1406','Achats',NULL,NULL,1),(66,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','XXXXXX','603','65','Variations des stocks',NULL,NULL,1),(67,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','SERVICE','61','1406','Services extérieurs',NULL,NULL,1),(68,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','XXXXXX','62','1406','Autres services extérieurs',NULL,NULL,1),(69,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','XXXXXX','63','1406','Impôts, taxes et versements assimiles',NULL,NULL,1),(70,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','XXXXXX','641','1406','Rémunérations du personnel',NULL,NULL,1),(71,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','XXXXXX','644','1406','Rémunération du travail de l\'exploitant',NULL,NULL,1),(72,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','SOCIAL','645','1406','Charges de sécurité sociale et de prévoyance',NULL,NULL,1),(73,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','XXXXXX','646','1406','Cotisations sociales personnelles de l\'exploitant',NULL,NULL,1),(74,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','XXXXXX','65','1406','Autres charges de gestion courante',NULL,NULL,1),(75,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','XXXXXX','66','1406','Charges financières',NULL,NULL,1),(76,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','XXXXXX','67','1406','Charges exceptionnelles',NULL,NULL,1),(77,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','XXXXXX','681','1406','Dotations aux amortissements et aux provisions',NULL,NULL,1),(78,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','XXXXXX','686','1406','Dotations aux amortissements et aux provisions',NULL,NULL,1),(79,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','XXXXXX','687','1406','Dotations aux amortissements et aux provisions',NULL,NULL,1),(80,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','XXXXXX','691','1406','Participation des salariés aux résultats',NULL,NULL,1),(81,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','XXXXXX','695','1406','Impôts sur les bénéfices',NULL,NULL,1),(82,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','XXXXXX','697','1406','Imposition forfaitaire annuelle des sociétés',NULL,NULL,1),(83,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','XXXXXX','699','1406','Produits',NULL,NULL,1),(84,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','PRODUCT','701','1407','Ventes de produits finis',NULL,NULL,1),(85,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','SERVICE','706','1407','Prestations de services',NULL,NULL,1),(86,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','PRODUCT','707','1407','Ventes de marchandises',NULL,NULL,1),(87,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','PRODUCT','708','1407','Produits des activités annexes',NULL,NULL,1),(88,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','XXXXXX','709','1407','Rabais, remises et ristournes accordés par l\'entreprise',NULL,NULL,1),(89,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','XXXXXX','713','1407','Variation des stocks',NULL,NULL,1),(90,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','XXXXXX','72','1407','Production immobilisée',NULL,NULL,1),(91,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','XXXXXX','73','1407','Produits nets partiels sur opérations à long terme',NULL,NULL,1),(92,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','XXXXXX','74','1407','Subventions d\'exploitation',NULL,NULL,1),(93,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','XXXXXX','75','1407','Autres produits de gestion courante',NULL,NULL,1),(94,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','XXXXXX','753','93','Jetons de présence et rémunérations d\'administrateurs, gérants,...',NULL,NULL,1),(95,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','XXXXXX','754','93','Ristournes perçues des coopératives',NULL,NULL,1),(96,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','XXXXXX','755','93','Quotes-parts de résultat sur opérations faites en commun',NULL,NULL,1),(97,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','XXXXXX','76','1407','Produits financiers',NULL,NULL,1),(98,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','XXXXXX','77','1407','Produits exceptionnels',NULL,NULL,1),(99,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','XXXXXX','781','1407','Reprises sur amortissements et provisions',NULL,NULL,1),(100,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','XXXXXX','786','1407','Reprises sur provisions pour risques',NULL,NULL,1),(101,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','XXXXXX','787','1407','Reprises sur provisions',NULL,NULL,1),(102,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','XXXXXX','79','1407','Transferts de charges',NULL,NULL,1),(103,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','10','1501','Capital et réserves',NULL,NULL,1),(104,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','CAPITAL','101','103','Capital',NULL,NULL,1),(105,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','104','103','Primes liées au capital social',NULL,NULL,1),(106,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','105','103','Ecarts de réévaluation',NULL,NULL,1),(107,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','106','103','Réserves',NULL,NULL,1),(108,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','107','103','Ecart d\'equivalence',NULL,NULL,1),(109,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','108','103','Compte de l\'exploitant',NULL,NULL,1),(110,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','109','103','Actionnaires : capital souscrit - non appelé',NULL,NULL,1),(111,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','11','1501','Report à nouveau (solde créditeur ou débiteur)',NULL,NULL,1),(112,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','110','111','Report à nouveau (solde créditeur)',NULL,NULL,1),(113,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','119','111','Report à nouveau (solde débiteur)',NULL,NULL,1),(114,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','12','1501','Résultat de l\'exercice (bénéfice ou perte)',NULL,NULL,1),(115,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','120','114','Résultat de l\'exercice (bénéfice)',NULL,NULL,1),(116,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','129','114','Résultat de l\'exercice (perte)',NULL,NULL,1),(117,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','13','1501','Subventions d\'investissement',NULL,NULL,1),(118,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','131','117','Subventions d\'équipement',NULL,NULL,1),(119,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','138','117','Autres subventions d\'investissement',NULL,NULL,1),(120,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','139','117','Subventions d\'investissement inscrites au compte de résultat',NULL,NULL,1),(121,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','14','1501','Provisions réglementées',NULL,NULL,1),(122,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','142','121','Provisions réglementées relatives aux immobilisations',NULL,NULL,1),(123,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','143','121','Provisions réglementées relatives aux stocks',NULL,NULL,1),(124,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','144','121','Provisions réglementées relatives aux autres éléments de l\'actif',NULL,NULL,1),(125,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','145','121','Amortissements dérogatoires',NULL,NULL,1),(126,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','146','121','Provision spéciale de réévaluation',NULL,NULL,1),(127,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','147','121','Plus-values réinvesties',NULL,NULL,1),(128,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','148','121','Autres provisions réglementées',NULL,NULL,1),(129,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','15','1501','Provisions pour risques et charges',NULL,NULL,1),(130,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','151','129','Provisions pour risques',NULL,NULL,1),(131,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','153','129','Provisions pour pensions et obligations similaires',NULL,NULL,1),(132,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','154','129','Provisions pour restructurations',NULL,NULL,1),(133,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','155','129','Provisions pour impôts',NULL,NULL,1),(134,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','156','129','Provisions pour renouvellement des immobilisations (entreprises concessionnaires)',NULL,NULL,1),(135,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','157','129','Provisions pour charges à répartir sur plusieurs exercices',NULL,NULL,1),(136,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','158','129','Autres provisions pour charges',NULL,NULL,1),(137,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','16','1501','Emprunts et dettes assimilees',NULL,NULL,1),(138,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','161','137','Emprunts obligataires convertibles',NULL,NULL,1),(139,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','163','137','Autres emprunts obligataires',NULL,NULL,1),(140,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','164','137','Emprunts auprès des établissements de crédit',NULL,NULL,1),(141,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','165','137','Dépôts et cautionnements reçus',NULL,NULL,1),(142,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','166','137','Participation des salariés aux résultats',NULL,NULL,1),(143,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','167','137','Emprunts et dettes assortis de conditions particulières',NULL,NULL,1),(144,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','168','137','Autres emprunts et dettes assimilées',NULL,NULL,1),(145,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','169','137','Primes de remboursement des obligations',NULL,NULL,1),(146,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','17','1501','Dettes rattachées à des participations',NULL,NULL,1),(147,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','171','146','Dettes rattachées à des participations (groupe)',NULL,NULL,1),(148,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','174','146','Dettes rattachées à des participations (hors groupe)',NULL,NULL,1),(149,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','178','146','Dettes rattachées à des sociétés en participation',NULL,NULL,1),(150,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','18','1501','Comptes de liaison des établissements et sociétés en participation',NULL,NULL,1),(151,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','181','150','Comptes de liaison des établissements',NULL,NULL,1),(152,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','186','150','Biens et prestations de services échangés entre établissements (charges)',NULL,NULL,1),(153,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','187','150','Biens et prestations de services échangés entre établissements (produits)',NULL,NULL,1),(154,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','188','150','Comptes de liaison des sociétés en participation',NULL,NULL,1),(155,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','20','1502','Immobilisations incorporelles',NULL,NULL,1),(156,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','201','155','Frais d\'établissement',NULL,NULL,1),(157,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','203','155','Frais de recherche et de développement',NULL,NULL,1),(158,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','205','155','Concessions et droits similaires, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires',NULL,NULL,1),(159,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','206','155','Droit au bail',NULL,NULL,1),(160,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','207','155','Fonds commercial',NULL,NULL,1),(161,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','208','155','Autres immobilisations incorporelles',NULL,NULL,1),(162,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','21','1502','Immobilisations corporelles',NULL,NULL,1),(163,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','211','162','Terrains',NULL,NULL,1),(164,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','212','162','Agencements et aménagements de terrains',NULL,NULL,1),(165,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','213','162','Constructions',NULL,NULL,1),(166,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','214','162','Constructions sur sol d\'autrui',NULL,NULL,1),(167,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','215','162','Installations techniques, matériels et outillage industriels',NULL,NULL,1),(168,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','218','162','Autres immobilisations corporelles',NULL,NULL,1),(169,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','22','1502','Immobilisations mises en concession',NULL,NULL,1),(170,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','23','1502','Immobilisations en cours',NULL,NULL,1),(171,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','231','170','Immobilisations corporelles en cours',NULL,NULL,1),(172,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','232','170','Immobilisations incorporelles en cours',NULL,NULL,1),(173,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','237','170','Avances et acomptes versés sur immobilisations incorporelles',NULL,NULL,1),(174,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','238','170','Avances et acomptes versés sur commandes d\'immobilisations corporelles',NULL,NULL,1),(175,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','25','1502','Parts dans des entreprises liées et créances sur des entreprises liées',NULL,NULL,1),(176,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','26','1502','Participations et créances rattachées à des participations',NULL,NULL,1),(177,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','261','176','Titres de participation',NULL,NULL,1),(178,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','266','176','Autres formes de participation',NULL,NULL,1),(179,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','267','176','Créances rattachées à des participations',NULL,NULL,1),(180,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','268','176','Créances rattachées à des sociétés en participation',NULL,NULL,1),(181,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','269','176','Versements restant à effectuer sur titres de participation non libérés',NULL,NULL,1),(182,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','27','1502','Autres immobilisations financieres',NULL,NULL,1),(183,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','271','183','Titres immobilisés autres que les titres immobilisés de l\'activité de portefeuille (droit de propriété)',NULL,NULL,1),(184,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','272','183','Titres immobilisés (droit de créance)',NULL,NULL,1),(185,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','273','183','Titres immobilisés de l\'activité de portefeuille',NULL,NULL,1),(186,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','274','183','Prêts',NULL,NULL,1),(187,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','275','183','Dépôts et cautionnements versés',NULL,NULL,1),(188,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','276','183','Autres créances immobilisées',NULL,NULL,1),(189,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','277','183','(Actions propres ou parts propres)',NULL,NULL,1),(190,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','279','183','Versements restant à effectuer sur titres immobilisés non libérés',NULL,NULL,1),(191,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','28','1502','Amortissements des immobilisations',NULL,NULL,1),(192,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','280','191','Amortissements des immobilisations incorporelles',NULL,NULL,1),(193,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','281','191','Amortissements des immobilisations corporelles',NULL,NULL,1),(194,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','282','191','Amortissements des immobilisations mises en concession',NULL,NULL,1),(195,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','29','1502','Dépréciations des immobilisations',NULL,NULL,1),(196,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','290','195','Dépréciations des immobilisations incorporelles',NULL,NULL,1),(197,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','291','195','Dépréciations des immobilisations corporelles',NULL,NULL,1),(198,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','292','195','Dépréciations des immobilisations mises en concession',NULL,NULL,1),(199,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','293','195','Dépréciations des immobilisations en cours',NULL,NULL,1),(200,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','296','195','Provisions pour dépréciation des participations et créances rattachées à des participations',NULL,NULL,1),(201,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','297','195','Provisions pour dépréciation des autres immobilisations financières',NULL,NULL,1),(202,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','31','1503','Matières premières (et fournitures)',NULL,NULL,1),(203,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','311','202','Matières (ou groupe) A',NULL,NULL,1),(204,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','312','202','Matières (ou groupe) B',NULL,NULL,1),(205,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','317','202','Fournitures A, B, C,',NULL,NULL,1),(206,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','32','1503','Autres approvisionnements',NULL,NULL,1),(207,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','321','206','Matières consommables',NULL,NULL,1),(208,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','322','206','Fournitures consommables',NULL,NULL,1),(209,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','326','206','Emballages',NULL,NULL,1),(210,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','33','1503','En-cours de production de biens',NULL,NULL,1),(211,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','331','210','Produits en cours',NULL,NULL,1),(212,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','335','210','Travaux en cours',NULL,NULL,1),(213,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','34','1503','En-cours de production de services',NULL,NULL,1),(214,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','341','213','Etudes en cours',NULL,NULL,1),(215,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','345','213','Prestations de services en cours',NULL,NULL,1),(216,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','35','1503','Stocks de produits',NULL,NULL,1),(217,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','351','216','Produits intermédiaires',NULL,NULL,1),(218,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','355','216','Produits finis',NULL,NULL,1),(219,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','358','216','Produits résiduels (ou matières de récupération)',NULL,NULL,1),(220,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','37','1503','Stocks de marchandises',NULL,NULL,1),(221,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','371','220','Marchandises (ou groupe) A',NULL,NULL,1),(222,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','372','220','Marchandises (ou groupe) B',NULL,NULL,1),(223,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','39','1503','Provisions pour dépréciation des stocks et en-cours',NULL,NULL,1),(224,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','391','223','Provisions pour dépréciation des matières premières',NULL,NULL,1),(225,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','392','223','Provisions pour dépréciation des autres approvisionnements',NULL,NULL,1),(226,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','393','223','Provisions pour dépréciation des en-cours de production de biens',NULL,NULL,1),(227,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','394','223','Provisions pour dépréciation des en-cours de production de services',NULL,NULL,1),(228,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','395','223','Provisions pour dépréciation des stocks de produits',NULL,NULL,1),(229,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','397','223','Provisions pour dépréciation des stocks de marchandises',NULL,NULL,1),(230,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','40','1504','Fournisseurs et Comptes rattachés',NULL,NULL,1),(231,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','400','230','Fournisseurs et Comptes rattachés',NULL,NULL,1),(232,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','SUPPLIER','401','230','Fournisseurs',NULL,NULL,1),(233,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','403','230','Fournisseurs - Effets à payer',NULL,NULL,1),(234,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','404','230','Fournisseurs d\'immobilisations',NULL,NULL,1),(235,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','405','230','Fournisseurs d\'immobilisations - Effets à payer',NULL,NULL,1),(236,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','408','230','Fournisseurs - Factures non parvenues',NULL,NULL,1),(237,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','409','230','Fournisseurs débiteurs',NULL,NULL,1),(238,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','41','1504','Clients et comptes rattachés',NULL,NULL,1),(239,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','410','238','Clients et Comptes rattachés',NULL,NULL,1),(240,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','CUSTOMER','411','238','Clients',NULL,NULL,1),(241,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','413','238','Clients - Effets à recevoir',NULL,NULL,1),(242,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','416','238','Clients douteux ou litigieux',NULL,NULL,1),(243,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','418','238','Clients - Produits non encore facturés',NULL,NULL,1),(244,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','419','238','Clients créditeurs',NULL,NULL,1),(245,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','42','1504','Personnel et comptes rattachés',NULL,NULL,1),(246,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','421','245','Personnel - Rémunérations dues',NULL,NULL,1),(247,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','422','245','Comités d\'entreprises, d\'établissement, ...',NULL,NULL,1),(248,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','424','245','Participation des salariés aux résultats',NULL,NULL,1),(249,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','425','245','Personnel - Avances et acomptes',NULL,NULL,1),(250,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','426','245','Personnel - Dépôts',NULL,NULL,1),(251,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','427','245','Personnel - Oppositions',NULL,NULL,1),(252,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','428','245','Personnel - Charges à payer et produits à recevoir',NULL,NULL,1),(253,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','43','1504','Sécurité sociale et autres organismes sociaux',NULL,NULL,1),(254,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','431','253','Sécurité sociale',NULL,NULL,1),(255,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','437','253','Autres organismes sociaux',NULL,NULL,1),(256,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','438','253','Organismes sociaux - Charges à payer et produits à recevoir',NULL,NULL,1),(257,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','44','1504','État et autres collectivités publiques',NULL,NULL,1),(258,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','441','257','État - Subventions à recevoir',NULL,NULL,1),(259,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','442','257','Etat - Impôts et taxes recouvrables sur des tiers',NULL,NULL,1),(260,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','443','257','Opérations particulières avec l\'Etat, les collectivités publiques, les organismes internationaux',NULL,NULL,1),(261,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','444','257','Etat - Impôts sur les bénéfices',NULL,NULL,1),(262,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','445','257','Etat - Taxes sur le chiffre d\'affaires',NULL,NULL,1),(263,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','446','257','Obligations cautionnées',NULL,NULL,1),(264,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','447','257','Autres impôts, taxes et versements assimilés',NULL,NULL,1),(265,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','448','257','Etat - Charges à payer et produits à recevoir',NULL,NULL,1),(266,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','449','257','Quotas d\'émission à restituer à l\'Etat',NULL,NULL,1),(267,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','45','1504','Groupe et associes',NULL,NULL,1),(268,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','451','267','Groupe',NULL,NULL,1),(269,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','455','267','Associés - Comptes courants',NULL,NULL,1),(270,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','456','267','Associés - Opérations sur le capital',NULL,NULL,1),(271,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','457','267','Associés - Dividendes à payer',NULL,NULL,1),(272,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','458','267','Associés - Opérations faites en commun et en G.I.E.',NULL,NULL,1),(273,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','46','1504','Débiteurs divers et créditeurs divers',NULL,NULL,1),(274,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','462','273','Créances sur cessions d\'immobilisations',NULL,NULL,1),(275,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','464','273','Dettes sur acquisitions de valeurs mobilières de placement',NULL,NULL,1),(276,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','465','273','Créances sur cessions de valeurs mobilières de placement',NULL,NULL,1),(277,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','467','273','Autres comptes débiteurs ou créditeurs',NULL,NULL,1),(278,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','468','273','Divers - Charges à payer et produits à recevoir',NULL,NULL,1),(279,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','47','1504','Comptes transitoires ou d\'attente',NULL,NULL,1),(280,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','471','279','Comptes d\'attente',NULL,NULL,1),(281,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','476','279','Différence de conversion - Actif',NULL,NULL,1),(282,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','477','279','Différences de conversion - Passif',NULL,NULL,1),(283,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','478','279','Autres comptes transitoires',NULL,NULL,1),(284,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','48','1504','Comptes de régularisation',NULL,NULL,1),(285,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','481','284','Charges à répartir sur plusieurs exercices',NULL,NULL,1),(286,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','486','284','Charges constatées d\'avance',NULL,NULL,1),(287,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','487','284','Produits constatés d\'avance',NULL,NULL,1),(288,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','488','284','Comptes de répartition périodique des charges et des produits',NULL,NULL,1),(289,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','489','284','Quotas d\'émission alloués par l\'Etat',NULL,NULL,1),(290,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','49','1504','Provisions pour dépréciation des comptes de tiers',NULL,NULL,1),(291,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','491','290','Provisions pour dépréciation des comptes de clients',NULL,NULL,1),(292,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','495','290','Provisions pour dépréciation des comptes du groupe et des associés',NULL,NULL,1),(293,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','496','290','Provisions pour dépréciation des comptes de débiteurs divers',NULL,NULL,1),(294,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','50','1505','Valeurs mobilières de placement',NULL,NULL,1),(295,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','501','294','Parts dans des entreprises liées',NULL,NULL,1),(296,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','502','294','Actions propres',NULL,NULL,1),(297,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','503','294','Actions',NULL,NULL,1),(298,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','504','294','Autres titres conférant un droit de propriété',NULL,NULL,1),(299,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','505','294','Obligations et bons émis par la société et rachetés par elle',NULL,NULL,1),(300,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','506','294','Obligations',NULL,NULL,1),(301,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','507','294','Bons du Trésor et bons de caisse à court terme',NULL,NULL,1),(302,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','508','294','Autres valeurs mobilières de placement et autres créances assimilées',NULL,NULL,1),(303,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','509','294','Versements restant à effectuer sur valeurs mobilières de placement non libérées',NULL,NULL,1),(304,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','51','1505','Banques, établissements financiers et assimilés',NULL,NULL,1),(305,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','511','304','Valeurs à l\'encaissement',NULL,NULL,1),(306,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','BANK','512','304','Banques',NULL,NULL,1),(307,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','514','304','Chèques postaux',NULL,NULL,1),(308,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','515','304','\"Caisses\" du Trésor et des établissements publics',NULL,NULL,1),(309,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','516','304','Sociétés de bourse',NULL,NULL,1),(310,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','517','304','Autres organismes financiers',NULL,NULL,1),(311,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','518','304','Intérêts courus',NULL,NULL,1),(312,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','519','304','Concours bancaires courants',NULL,NULL,1),(313,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','52','1505','Instruments de trésorerie',NULL,NULL,1),(314,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','CASH','53','1505','Caisse',NULL,NULL,1),(315,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','531','314','Caisse siège social',NULL,NULL,1),(316,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','532','314','Caisse succursale (ou usine) A',NULL,NULL,1),(317,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','533','314','Caisse succursale (ou usine) B',NULL,NULL,1),(318,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','54','1505','Régies d\'avance et accréditifs',NULL,NULL,1),(319,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','58','1505','Virements internes',NULL,NULL,1),(320,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','59','1505','Provisions pour dépréciation des comptes financiers',NULL,NULL,1),(321,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','590','320','Provisions pour dépréciation des valeurs mobilières de placement',NULL,NULL,1),(322,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','PRODUCT','60','1506','Achats',NULL,NULL,1),(323,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','601','322','Achats stockés - Matières premières (et fournitures)',NULL,NULL,1),(324,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','602','322','Achats stockés - Autres approvisionnements',NULL,NULL,1),(325,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','603','322','Variations des stocks (approvisionnements et marchandises)',NULL,NULL,1),(326,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','604','322','Achats stockés - Matières premières (et fournitures)',NULL,NULL,1),(327,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','605','322','Achats de matériel, équipements et travaux',NULL,NULL,1),(328,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','606','322','Achats non stockés de matière et fournitures',NULL,NULL,1),(329,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','607','322','Achats de marchandises',NULL,NULL,1),(330,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','608','322','(Compte réservé, le cas échéant, à la récapitulation des frais accessoires incorporés aux achats)',NULL,NULL,1),(331,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','609','322','Rabais, remises et ristournes obtenus sur achats',NULL,NULL,1),(332,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','SERVICE','61','1506','Services extérieurs',NULL,NULL,1),(333,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','611','332','Sous-traitance générale',NULL,NULL,1),(334,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','612','332','Redevances de crédit-bail',NULL,NULL,1),(335,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','613','332','Locations',NULL,NULL,1),(336,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','614','332','Charges locatives et de copropriété',NULL,NULL,1),(337,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','615','332','Entretien et réparations',NULL,NULL,1),(338,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','616','332','Primes d\'assurances',NULL,NULL,1),(339,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','617','332','Etudes et recherches',NULL,NULL,1),(340,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','618','332','Divers',NULL,NULL,1),(341,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','619','332','Rabais, remises et ristournes obtenus sur services extérieurs',NULL,NULL,1),(342,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','62','1506','Autres services extérieurs',NULL,NULL,1),(343,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','621','342','Personnel extérieur à l\'entreprise',NULL,NULL,1),(344,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','622','342','Rémunérations d\'intermédiaires et honoraires',NULL,NULL,1),(345,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','623','342','Publicité, publications, relations publiques',NULL,NULL,1),(346,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','624','342','Transports de biens et transports collectifs du personnel',NULL,NULL,1),(347,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','625','342','Déplacements, missions et réceptions',NULL,NULL,1),(348,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','626','342','Frais postaux et de télécommunications',NULL,NULL,1),(349,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','627','342','Services bancaires et assimilés',NULL,NULL,1),(350,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','628','342','Divers',NULL,NULL,1),(351,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','629','342','Rabais, remises et ristournes obtenus sur autres services extérieurs',NULL,NULL,1),(352,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','63','1506','Impôts, taxes et versements assimilés',NULL,NULL,1),(353,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','631','352','Impôts, taxes et versements assimilés sur rémunérations (administrations des impôts)',NULL,NULL,1),(354,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','633','352','Impôts, taxes et versements assimilés sur rémunérations (autres organismes)',NULL,NULL,1),(355,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','635','352','Autres impôts, taxes et versements assimilés (administrations des impôts)',NULL,NULL,1),(356,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','637','352','Autres impôts, taxes et versements assimilés (autres organismes)',NULL,NULL,1),(357,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','64','1506','Charges de personnel',NULL,NULL,1),(358,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','641','357','Rémunérations du personnel',NULL,NULL,1),(359,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','644','357','Rémunération du travail de l\'exploitant',NULL,NULL,1),(360,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','SOCIAL','645','357','Charges de sécurité sociale et de prévoyance',NULL,NULL,1),(361,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','646','357','Cotisations sociales personnelles de l\'exploitant',NULL,NULL,1),(362,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','647','357','Autres charges sociales',NULL,NULL,1),(363,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','648','357','Autres charges de personnel',NULL,NULL,1),(364,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','65','1506','Autres charges de gestion courante',NULL,NULL,1),(365,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','651','364','Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires',NULL,NULL,1),(366,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','653','364','Jetons de présence',NULL,NULL,1),(367,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','654','364','Pertes sur créances irrécouvrables',NULL,NULL,1),(368,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','655','364','Quote-part de résultat sur opérations faites en commun',NULL,NULL,1),(369,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','658','364','Charges diverses de gestion courante',NULL,NULL,1),(370,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','66','1506','Charges financières',NULL,NULL,1),(371,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','661','370','Charges d\'intérêts',NULL,NULL,1),(372,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','664','370','Pertes sur créances liées à des participations',NULL,NULL,1),(373,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','665','370','Escomptes accordés',NULL,NULL,1),(374,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','666','370','Pertes de change',NULL,NULL,1),(375,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','667','370','Charges nettes sur cessions de valeurs mobilières de placement',NULL,NULL,1),(376,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','668','370','Autres charges financières',NULL,NULL,1),(377,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','67','1506','Charges exceptionnelles',NULL,NULL,1),(378,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','671','377','Charges exceptionnelles sur opérations de gestion',NULL,NULL,1),(379,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','672','377','(Compte à la disposition des entités pour enregistrer, en cours d\'exercice, les charges sur exercices antérieurs)',NULL,NULL,1),(380,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','675','377','Valeurs comptables des éléments d\'actif cédés',NULL,NULL,1),(381,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','678','377','Autres charges exceptionnelles',NULL,NULL,1),(382,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','68','1506','Dotations aux amortissements et aux provisions',NULL,NULL,1),(383,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','681','382','Dotations aux amortissements et aux provisions - Charges d\'exploitation',NULL,NULL,1),(384,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','686','382','Dotations aux amortissements et aux provisions - Charges financières',NULL,NULL,1),(385,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','687','382','Dotations aux amortissements et aux provisions - Charges exceptionnelles',NULL,NULL,1),(386,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','69','1506','Participation des salariés - impôts sur les bénéfices et assimiles',NULL,NULL,1),(387,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','691','386','Participation des salariés aux résultats',NULL,NULL,1),(388,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','695','386','Impôts sur les bénéfices',NULL,NULL,1),(389,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','696','386','Suppléments d\'impôt sur les sociétés liés aux distributions',NULL,NULL,1),(390,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','697','386','Imposition forfaitaire annuelle des sociétés',NULL,NULL,1),(391,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','698','386','Intégration fiscale',NULL,NULL,1),(392,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','699','386','Produits - Reports en arrière des déficits',NULL,NULL,1),(393,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','70','1507','Ventes de produits fabriqués, prestations de services, marchandises',NULL,NULL,1),(394,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','PRODUCT','701','393','Ventes de produits finis',NULL,NULL,1),(395,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','702','393','Ventes de produits intermédiaires',NULL,NULL,1),(396,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','703','393','Ventes de produits résiduels',NULL,NULL,1),(397,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','704','393','Travaux',NULL,NULL,1),(398,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','705','393','Etudes',NULL,NULL,1),(399,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','SERVICE','706','393','Prestations de services',NULL,NULL,1),(400,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','PRODUCT','707','393','Ventes de marchandises',NULL,NULL,1),(401,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','PRODUCT','708','393','Produits des activités annexes',NULL,NULL,1),(402,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','709','393','Rabais, remises et ristournes accordés par l\'entreprise',NULL,NULL,1),(403,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','71','1507','Production stockée (ou déstockage)',NULL,NULL,1),(404,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','713','403','Variation des stocks (en-cours de production, produits)',NULL,NULL,1),(405,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','72','1507','Production immobilisée',NULL,NULL,1),(406,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','721','405','Immobilisations incorporelles',NULL,NULL,1),(407,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','722','405','Immobilisations corporelles',NULL,NULL,1),(408,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','74','1507','Subventions d\'exploitation',NULL,NULL,1),(409,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','75','1507','Autres produits de gestion courante',NULL,NULL,1),(410,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','751','409','Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires',NULL,NULL,1),(411,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','752','409','Revenus des immeubles non affectés à des activités professionnelles',NULL,NULL,1),(412,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','753','409','Jetons de présence et rémunérations d\'administrateurs, gérants,...',NULL,NULL,1),(413,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','754','409','Ristournes perçues des coopératives (provenant des excédents)',NULL,NULL,1),(414,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','755','409','Quotes-parts de résultat sur opérations faites en commun',NULL,NULL,1),(415,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','758','409','Produits divers de gestion courante',NULL,NULL,1),(416,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','76','1507','Produits financiers',NULL,NULL,1),(417,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','761','416','Produits de participations',NULL,NULL,1),(418,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','762','416','Produits des autres immobilisations financières',NULL,NULL,1),(419,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','763','416','Revenus des autres créances',NULL,NULL,1),(420,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','764','416','Revenus des valeurs mobilières de placement',NULL,NULL,1),(421,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','765','416','Escomptes obtenus',NULL,NULL,1),(422,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','766','416','Gains de change',NULL,NULL,1),(423,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','767','416','Produits nets sur cessions de valeurs mobilières de placement',NULL,NULL,1),(424,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','768','416','Autres produits financiers',NULL,NULL,1),(425,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','77','1507','Produits exceptionnels',NULL,NULL,1),(426,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','771','425','Produits exceptionnels sur opérations de gestion',NULL,NULL,1),(427,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','772','425','(Compte à la disposition des entités pour enregistrer, en cours d\'exercice, les produits sur exercices antérieurs)',NULL,NULL,1),(428,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','775','425','Produits des cessions d\'éléments d\'actif',NULL,NULL,1),(429,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','777','425','Quote-part des subventions d\'investissement virée au résultat de l\'exercice',NULL,NULL,1),(430,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','778','425','Autres produits exceptionnels',NULL,NULL,1),(431,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','78','1507','Reprises sur amortissements et provisions',NULL,NULL,1),(432,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','781','431','Reprises sur amortissements et provisions (à inscrire dans les produits d\'exploitation)',NULL,NULL,1),(433,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','786','431','Reprises sur provisions pour risques (à inscrire dans les produits financiers)',NULL,NULL,1),(434,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','787','431','Reprises sur provisions (à inscrire dans les produits exceptionnels)',NULL,NULL,1),(435,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','79','1507','Transferts de charges',NULL,NULL,1),(436,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','791','435','Transferts de charges d\'exploitation ',NULL,NULL,1),(437,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','796','435','Transferts de charges financières',NULL,NULL,1),(438,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','797','435','Transferts de charges exceptionnelles',NULL,NULL,1),(439,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','10','1351','Capital',NULL,NULL,1),(440,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','100','439','Capital souscrit ou capital personnel',NULL,NULL,1),(441,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1000','440','Capital non amorti',NULL,NULL,1),(442,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1001','440','Capital amorti',NULL,NULL,1),(443,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','101','439','Capital non appelé',NULL,NULL,1),(444,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','109','439','Compte de l\'exploitant',NULL,NULL,1),(445,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1090','444','Opérations courantes',NULL,NULL,1),(446,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1091','444','Impôts personnels',NULL,NULL,1),(447,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1092','444','Rémunérations et autres avantages',NULL,NULL,1),(448,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','11','1351','Primes d\'émission',NULL,NULL,1),(449,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','12','1351','Plus-values de réévaluation',NULL,NULL,1),(450,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','120','449','Plus-values de réévaluation sur immobilisations incorporelles',NULL,NULL,1),(451,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1200','450','Plus-values de réévaluation',NULL,NULL,1),(452,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1201','450','Reprises de réductions de valeur',NULL,NULL,1),(453,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','121','449','Plus-values de réévaluation sur immobilisations corporelles',NULL,NULL,1),(454,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1210','453','Plus-values de réévaluation',NULL,NULL,1),(455,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1211','453','Reprises de réductions de valeur',NULL,NULL,1),(456,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','122','449','Plus-values de réévaluation sur immobilisations financières',NULL,NULL,1),(457,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1220','456','Plus-values de réévaluation',NULL,NULL,1),(458,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1221','456','Reprises de réductions de valeur',NULL,NULL,1),(459,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','123','449','Plus-values de réévaluation sur stocks',NULL,NULL,1),(460,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','124','449','Reprises de réductions de valeur sur placements de trésorerie',NULL,NULL,1),(461,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','13','1351','Réserve',NULL,NULL,1),(462,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','130','461','Réserve légale',NULL,NULL,1),(463,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','131','461','Réserves indisponibles',NULL,NULL,1),(464,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1310','463','Réserve pour actions propres',NULL,NULL,1),(465,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1311','463','Autres réserves indisponibles',NULL,NULL,1),(466,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','132','461','Réserves immunisées',NULL,NULL,1),(467,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','133','461','Réserves disponibles',NULL,NULL,1),(468,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1330','467','Réserve pour régularisation de dividendes',NULL,NULL,1),(469,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1331','467','Réserve pour renouvellement des immobilisations',NULL,NULL,1),(470,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1332','467','Réserve pour installations en faveur du personnel 1333 Réserves libres',NULL,NULL,1),(471,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','14','1351','Bénéfice reporté (ou perte reportée)',NULL,NULL,1),(472,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','15','1351','Subsides en capital',NULL,NULL,1),(473,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','150','472','Montants obtenus',NULL,NULL,1),(474,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','151','472','Montants transférés aux résultats',NULL,NULL,1),(475,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','16','1351','Provisions pour risques et charges',NULL,NULL,1),(476,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','160','475','Provisions pour pensions et obligations similaires',NULL,NULL,1),(477,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','161','475','Provisions pour charges fiscales',NULL,NULL,1),(478,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','162','475','Provisions pour grosses réparations et gros entretiens',NULL,NULL,1),(479,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','163','475','à 169 Provisions pour autres risques et charges',NULL,NULL,1),(480,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','164','475','Provisions pour sûretés personnelles ou réelles constituées à l\'appui de dettes et d\'engagements de tiers',NULL,NULL,1),(481,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','165','475','Provisions pour engagements relatifs à l\'acquisition ou à la cession d\'immobilisations',NULL,NULL,1),(482,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','166','475','Provisions pour exécution de commandes passées ou reçues',NULL,NULL,1),(483,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','167','475','Provisions pour positions et marchés à terme en devises ou positions et marchés à terme en marchandises',NULL,NULL,1),(484,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','168','475','Provisions pour garanties techniques attachées aux ventes et prestations déjà effectuées par l\'entreprise',NULL,NULL,1),(485,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','169','475','Provisions pour autres risques et charges',NULL,NULL,1),(486,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1690','485','Pour litiges en cours',NULL,NULL,1),(487,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1691','485','Pour amendes, doubles droits et pénalités',NULL,NULL,1),(488,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1692','485','Pour propre assureur',NULL,NULL,1),(489,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1693','485','Pour risques inhérents aux opérations de crédits à moyen ou long terme',NULL,NULL,1),(490,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1695','485','Provision pour charge de liquidation',NULL,NULL,1),(491,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1696','485','Provision pour départ de personnel',NULL,NULL,1),(492,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1699','485','Pour risques divers',NULL,NULL,1),(493,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','17','1351','Dettes à plus d\'un an',NULL,NULL,1),(494,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','170','493','Emprunts subordonnés',NULL,NULL,1),(495,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1700','494','Convertibles',NULL,NULL,1),(496,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1701','494','Non convertibles',NULL,NULL,1),(497,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','171','493','Emprunts obligataires non subordonnés',NULL,NULL,1),(498,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1710','498','Convertibles',NULL,NULL,1),(499,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1711','498','Non convertibles',NULL,NULL,1),(500,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','172','493','Dettes de location-financement et assimilés',NULL,NULL,1),(501,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1720','500','Dettes de location-financement de biens immobiliers',NULL,NULL,1),(502,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1721','500','Dettes de location-financement de biens mobiliers',NULL,NULL,1),(503,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1722','500','Dettes sur droits réels sur immeubles',NULL,NULL,1),(504,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','173','493','Etablissements de crédit',NULL,NULL,1),(505,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1730','504','Dettes en compte',NULL,NULL,1),(506,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','17300','505','Banque A',NULL,NULL,1),(507,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','17301','505','Banque B',NULL,NULL,1),(508,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','17302','505','Banque C',NULL,NULL,1),(509,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','17303','505','Banque D',NULL,NULL,1),(510,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1731','504','Promesses',NULL,NULL,1),(511,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','17310','510','Banque A',NULL,NULL,1),(512,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','17311','510','Banque B',NULL,NULL,1),(513,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','17312','510','Banque C',NULL,NULL,1),(514,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','17313','510','Banque D',NULL,NULL,1),(515,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1732','504','Crédits d\'acceptation',NULL,NULL,1),(516,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','17320','515','Banque A',NULL,NULL,1),(517,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','17321','515','Banque B',NULL,NULL,1),(518,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','17322','515','Banque C',NULL,NULL,1),(519,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','17323','515','Banque D',NULL,NULL,1),(520,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','174','493','Autres emprunts',NULL,NULL,1),(521,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','175','493','Dettes commerciales',NULL,NULL,1),(522,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1750','521','Fournisseurs : dettes en compte',NULL,NULL,1),(523,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','17500','522','Entreprises apparentées',NULL,NULL,1),(524,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','175000','523','Entreprises liées',NULL,NULL,1),(525,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','175001','523','Entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(526,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','17501','522','Fournisseurs ordinaires',NULL,NULL,1),(527,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','175010','526','Fournisseurs belges',NULL,NULL,1),(528,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','175011','526','Fournisseurs C.E.E.',NULL,NULL,1),(529,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','175012','526','Fournisseurs importation',NULL,NULL,1),(530,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1751','521','Effets à payer',NULL,NULL,1),(531,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','17510','530','Entreprises apparentées',NULL,NULL,1),(532,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','175100','531','Entreprises liées',NULL,NULL,1),(533,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','175101','531','Entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(534,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','17511','530','Fournisseurs ordinaires',NULL,NULL,1),(535,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','175110','534','Fournisseurs belges',NULL,NULL,1),(536,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','175111','534','Fournisseurs C.E.E.',NULL,NULL,1),(537,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','175112','534','Fournisseurs importation',NULL,NULL,1),(538,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','176','493','Acomptes reçus sur commandes',NULL,NULL,1),(539,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','178','493','Cautionnements reçus en numéraires',NULL,NULL,1),(540,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','179','493','Dettes diverses',NULL,NULL,1),(541,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1790','540','Entreprises liées',NULL,NULL,1),(542,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1791','540','Autres entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(543,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1792','540','Administrateurs, gérants et associés',NULL,NULL,1),(544,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1794','540','Rentes viagères capitalisées',NULL,NULL,1),(545,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1798','540','Dettes envers les coparticipants des associations momentanées et en participation',NULL,NULL,1),(546,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1799','540','Autres dettes diverses',NULL,NULL,1),(547,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','18','1351','Comptes de liaison des établissements et succursales',NULL,NULL,1),(548,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','20','1352','Frais d\'établissement',NULL,NULL,1),(549,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','200','548','Frais de constitution et d\'augmentation de capital',NULL,NULL,1),(550,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2000','549','Frais de constitution et d\'augmentation de capital',NULL,NULL,1),(551,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2009','549','Amortissements sur frais de constitution et d\'augmentation de capital',NULL,NULL,1),(552,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','201','548','Frais d\'émission d\'emprunts et primes de remboursement',NULL,NULL,1),(553,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2010','552','Agios sur emprunts et frais d\'émission d\'emprunts',NULL,NULL,1),(554,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2019','552','Amortissements sur agios sur emprunts et frais d\'émission d\'emprunts',NULL,NULL,1),(555,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','202','548','Autres frais d\'établissement',NULL,NULL,1),(556,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2020','555','Autres frais d\'établissement',NULL,NULL,1),(557,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2029','555','Amortissements sur autres frais d\'établissement',NULL,NULL,1),(558,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','203','548','Intérêts intercalaires',NULL,NULL,1),(559,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2030','558','Intérêts intercalaires',NULL,NULL,1),(560,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2039','558','Amortissements sur intérêts intercalaires',NULL,NULL,1),(561,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','204','548','Frais de restructuration',NULL,NULL,1),(562,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2040','561','Coût des frais de restructuration',NULL,NULL,1),(563,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2049','561','Amortissements sur frais de restructuration',NULL,NULL,1),(564,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','21','1352','Immobilisations incorporelles',NULL,NULL,1),(565,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','210','564','Frais de recherche et de développement',NULL,NULL,1),(566,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2100','565','Frais de recherche et de mise au point',NULL,NULL,1),(567,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2108','565','Plus-values actées sur frais de recherche et de mise au point',NULL,NULL,1),(568,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2109','565','Amortissements sur frais de recherche et de mise au point',NULL,NULL,1),(569,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','211','564','Concessions, brevets, licences, savoir-faire, marque et droits similaires',NULL,NULL,1),(570,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2110','569','Concessions, brevets, licences, marques, etc',NULL,NULL,1),(571,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2118','569','Plus-values actées sur concessions, etc',NULL,NULL,1),(572,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2119','569','Amortissements sur concessions, etc',NULL,NULL,1),(573,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','212','564','Goodwill',NULL,NULL,1),(574,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2120','573','Coût d\'acquisition',NULL,NULL,1),(575,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2128','573','Plus-values actées',NULL,NULL,1),(576,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2129','573','Amortissements sur goodwill',NULL,NULL,1),(577,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','213','564','Acomptes versés',NULL,NULL,1),(578,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22','1352','Terrains et constructions',NULL,NULL,1),(579,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','220','578','Terrains',NULL,NULL,1),(580,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2200','579','Terrains',NULL,NULL,1),(581,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2201','579','Frais d\'acquisition sur terrains',NULL,NULL,1),(582,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2208','579','Plus-values actées sur terrains',NULL,NULL,1),(583,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2209','579','Amortissements et réductions de valeur',NULL,NULL,1),(584,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22090','583','Amortissements sur frais d\'acquisition',NULL,NULL,1),(585,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22091','583','Réductions de valeur sur terrains',NULL,NULL,1),(586,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','221','578','Constructions',NULL,NULL,1),(587,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2210','586','Bâtiments industriels',NULL,NULL,1),(588,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2211','586','Bâtiments administratifs et commerciaux',NULL,NULL,1),(589,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2212','586','Autres bâtiments d\'exploitation',NULL,NULL,1),(590,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2213','586','Voies de transport et ouvrages d\'art',NULL,NULL,1),(591,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2215','586','Constructions sur sol d\'autrui',NULL,NULL,1),(592,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2216','586','Frais d\'acquisition sur constructions',NULL,NULL,1),(593,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2218','586','Plus-values actées',NULL,NULL,1),(594,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22180','593','Sur bâtiments industriels',NULL,NULL,1),(595,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22181','593','Sur bâtiments administratifs et commerciaux',NULL,NULL,1),(596,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22182','593','Sur autres bâtiments d\'exploitation',NULL,NULL,1),(597,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22184','593','Sur voies de transport et ouvrages d\'art',NULL,NULL,1),(598,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2219','586','Amortissements sur constructions',NULL,NULL,1),(599,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22190','598','Sur bâtiments industriels',NULL,NULL,1),(600,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22191','598','Sur bâtiments administratifs et commerciaux',NULL,NULL,1),(601,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22192','598','Sur autres bâtiments d\'exploitation',NULL,NULL,1),(602,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22194','598','Sur voies de transport et ouvrages d\'art',NULL,NULL,1),(603,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22195','598','Sur constructions sur sol d\'autrui',NULL,NULL,1),(604,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22196','598','Sur frais d\'acquisition sur constructions',NULL,NULL,1),(605,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','222','578','Terrains bâtis',NULL,NULL,1),(606,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2220','605','Valeur d\'acquisition',NULL,NULL,1),(607,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22200','606','Bâtiments industriels',NULL,NULL,1),(608,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22201','606','Bâtiments administratifs et commerciaux',NULL,NULL,1),(609,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22202','606','Autres bâtiments d\'exploitation',NULL,NULL,1),(610,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22203','606','Voies de transport et ouvrages d\'art',NULL,NULL,1),(611,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22204','606','Frais d\'acquisition des terrains à bâtir',NULL,NULL,1),(612,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2228','605','Plus-values actées',NULL,NULL,1),(613,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22280','612','Sur bâtiments industriels',NULL,NULL,1),(614,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22281','612','Sur bâtiments administratifs et commerciaux',NULL,NULL,1),(615,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22282','612','Sur autres bâtiments d\'exploitation',NULL,NULL,1),(616,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22283','612','Sur voies de transport et ouvrages d\'art',NULL,NULL,1),(617,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2229','605','Amortissements sur terrains bâtis',NULL,NULL,1),(618,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22290','617','Sur bâtiments industriels',NULL,NULL,1),(619,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22291','617','Sur bâtiments administratifs et commerciaux',NULL,NULL,1),(620,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22292','617','Sur autres bâtiments d\'exploitation',NULL,NULL,1),(621,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22293','617','Sur voies de transport et ouvrages d\'art',NULL,NULL,1),(622,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','22294','617','Sur frais d\'acquisition des terrains bâtis',NULL,NULL,1),(623,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','223','578','Autres droits réels sur des immeubles',NULL,NULL,1),(624,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2230','623','Valeur d\'acquisition',NULL,NULL,1),(625,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2238','623','Plus-values actées',NULL,NULL,1),(626,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2239','623','Amortissements',NULL,NULL,1),(627,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','23','1352','Installations, machines et outillages',NULL,NULL,1),(628,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','230','627','Installations',NULL,NULL,1),(629,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2300','628','Installations bâtiments industriels',NULL,NULL,1),(630,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2301','628','Installations bâtiments administratifs et commerciaux',NULL,NULL,1),(631,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2302','628','Installations bâtiments d\'exploitation',NULL,NULL,1),(632,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2303','628','Installations voies de transport et ouvrages d\'art',NULL,NULL,1),(633,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2300','628','Installation d\'eau',NULL,NULL,1),(634,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2301','628','Installation d\'électricité',NULL,NULL,1),(635,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2302','628','Installation de vapeur',NULL,NULL,1),(636,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2303','628','Installation de gaz',NULL,NULL,1),(637,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2304','628','Installation de chauffage',NULL,NULL,1),(638,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2305','628','Installation de conditionnement d\'air',NULL,NULL,1),(639,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2306','628','Installation de chargement',NULL,NULL,1),(640,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','231','627','Machines',NULL,NULL,1),(641,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2310','640','Division A',NULL,NULL,1),(642,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2311','640','Division B',NULL,NULL,1),(643,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2312','640','Division C',NULL,NULL,1),(644,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','237','627','Outillage',NULL,NULL,1),(645,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2370','644','Division A',NULL,NULL,1),(646,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2371','644','Division B',NULL,NULL,1),(647,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2372','644','Division C',NULL,NULL,1),(648,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','238','627','Plus-values actées',NULL,NULL,1),(649,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2380','648','Sur installations',NULL,NULL,1),(650,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2381','648','Sur machines',NULL,NULL,1),(651,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2382','648','Sur outillage',NULL,NULL,1),(652,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','239','627','Amortissements',NULL,NULL,1),(653,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2390','652','Sur installations',NULL,NULL,1),(654,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2391','652','Sur machines',NULL,NULL,1),(655,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2392','652','Sur outillage',NULL,NULL,1),(656,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24','1352','Mobilier et matériel roulant',NULL,NULL,1),(657,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','240','656','Mobilier',NULL,NULL,1),(658,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2400','656','Mobilier',NULL,NULL,1),(659,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24000','658','Mobilier des bâtiments industriels',NULL,NULL,1),(660,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24001','658','Mobilier des bâtiments administratifs et commerciaux',NULL,NULL,1),(661,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24002','658','Mobilier des autres bâtiments d\'exploitation',NULL,NULL,1),(662,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24003','658','Mobilier oeuvres sociales',NULL,NULL,1),(663,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2401','657','Matériel de bureau et de service social',NULL,NULL,1),(664,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24010','663','Des bâtiments industriels',NULL,NULL,1),(665,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24011','663','Des bâtiments administratifs et commerciaux',NULL,NULL,1),(666,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24012','663','Des autres bâtiments d\'exploitation',NULL,NULL,1),(667,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24013','663','Des oeuvres sociales',NULL,NULL,1),(668,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2408','657','Plus-values actées',NULL,NULL,1),(669,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24080','668','Plus-values actées sur mobilier',NULL,NULL,1),(670,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24081','668','Plus-values actées sur matériel de bureau et service social',NULL,NULL,1),(671,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2409','657','Amortissements',NULL,NULL,1),(672,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24090','671','Amortissements sur mobilier',NULL,NULL,1),(673,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24091','671','Amortissements sur matériel de bureau et service social',NULL,NULL,1),(674,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','241','656','Matériel roulant',NULL,NULL,1),(675,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2410','674','Matériel automobile',NULL,NULL,1),(676,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24100','675','Voitures',NULL,NULL,1),(677,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24105','675','Camions',NULL,NULL,1),(678,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2411','674','Matériel ferroviaire',NULL,NULL,1),(679,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2412','674','Matériel fluvial',NULL,NULL,1),(680,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2413','674','Matériel naval',NULL,NULL,1),(681,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2414','674','Matériel aérien',NULL,NULL,1),(682,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2418','674','Plus-values sur matériel roulant',NULL,NULL,1),(683,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24180','682','Plus-values sur matériel automobile',NULL,NULL,1),(684,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24181','682','Idem sur matériel ferroviaire',NULL,NULL,1),(685,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24182','682','Idem sur matériel fluvial',NULL,NULL,1),(686,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24183','682','Idem sur matériel naval',NULL,NULL,1),(687,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24184','682','Idem sur matériel aérien',NULL,NULL,1),(688,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2419','674','Amortissements sur matériel roulant',NULL,NULL,1),(689,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24190','688','Amortissements sur matériel automobile',NULL,NULL,1),(690,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24191','688','Idem sur matériel ferroviaire',NULL,NULL,1),(691,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24192','688','Idem sur matériel fluvial',NULL,NULL,1),(692,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24193','688','Idem sur matériel naval',NULL,NULL,1),(693,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','24194','688','Idem sur matériel aérien',NULL,NULL,1),(694,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','25','1352','Immobilisation détenues en location-financement et droits similaires',NULL,NULL,1),(695,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','250','694','Terrains et constructions',NULL,NULL,1),(696,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2500','695','Terrains',NULL,NULL,1),(697,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2501','695','Constructions',NULL,NULL,1),(698,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2508','695','Plus-values sur emphytéose, leasing et droits similaires : terrains et constructions',NULL,NULL,1),(699,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2509','695','Amortissements et réductions de valeur sur terrains et constructions en leasing',NULL,NULL,1),(700,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','251','694','Installations, machines et outillage',NULL,NULL,1),(701,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2510','700','Installations',NULL,NULL,1),(702,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2511','700','Machines',NULL,NULL,1),(703,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2512','700','Outillage',NULL,NULL,1),(704,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2518','700','Plus-values actées sur installations machines et outillage pris en leasing',NULL,NULL,1),(705,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2519','700','Amortissements sur installations machines et outillage pris en leasing',NULL,NULL,1),(706,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','252','694','Mobilier et matériel roulant',NULL,NULL,1),(707,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2520','706','Mobilier',NULL,NULL,1),(708,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2521','706','Matériel roulant',NULL,NULL,1),(709,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2528','706','Plus-values actées sur mobilier et matériel roulant en leasing',NULL,NULL,1),(710,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2529','706','Amortissements sur mobilier et matériel roulant en leasing',NULL,NULL,1),(711,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','26','1352','Autres immobilisations corporelles',NULL,NULL,1),(712,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','260','711','Frais d\'aménagements de locaux pris en location',NULL,NULL,1),(713,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','261','711','Maison d\'habitation',NULL,NULL,1),(714,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','262','711','Réserve immobilière',NULL,NULL,1),(715,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','263','711','Matériel d\'emballage',NULL,NULL,1),(716,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','264','711','Emballages récupérables',NULL,NULL,1),(717,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','268','711','Plus-values actées sur autres immobilisations corporelles',NULL,NULL,1),(718,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','269','711','Amortissements sur autres immobilisations corporelles',NULL,NULL,1),(719,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2690','718','Amortissements sur frais d\'aménagement des locaux pris en location',NULL,NULL,1),(720,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2691','718','Amortissements sur maison d\'habitation',NULL,NULL,1),(721,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2692','718','Amortissements sur réserve immobilière',NULL,NULL,1),(722,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2693','718','Amortissements sur matériel d\'emballage',NULL,NULL,1),(723,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2694','718','Amortissements sur emballages récupérables',NULL,NULL,1),(724,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','27','1352','Immobilisations corporelles en cours et acomptes versés',NULL,NULL,1),(725,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','270','724','Immobilisations en cours',NULL,NULL,1),(726,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2700','725','Constructions',NULL,NULL,1),(727,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2701','725','Installations machines et outillage',NULL,NULL,1),(728,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2702','725','Mobilier et matériel roulant',NULL,NULL,1),(729,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2703','725','Autres immobilisations corporelles',NULL,NULL,1),(730,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','271','724','Avances et acomptes versés sur immobilisations en cours',NULL,NULL,1),(731,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','28','1352','Immobilisations financières',NULL,NULL,1),(732,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','280','731','Participations dans des entreprises liées',NULL,NULL,1),(733,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2800','732','Valeur d\'acquisition (peut être subdivisé par participation)',NULL,NULL,1),(734,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2801','732','Montants non appelés (idem)',NULL,NULL,1),(735,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2808','732','Plus-values actées (idem)',NULL,NULL,1),(736,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2809','732','Réductions de valeurs actées (idem)',NULL,NULL,1),(737,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','281','731','Créances sur des entreprises liées',NULL,NULL,1),(738,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2810','737','Créances en compte',NULL,NULL,1),(739,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2811','737','Effets à recevoir',NULL,NULL,1),(740,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2812','737','Titres à revenu fixes',NULL,NULL,1),(741,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2817','737','Créances douteuses',NULL,NULL,1),(742,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2819','737','Réductions de valeurs actées',NULL,NULL,1),(743,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','282','731','Participations dans des entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(744,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2820','743','Valeur d\'acquisition (peut être subdivisé par participation)',NULL,NULL,1),(745,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2821','743','Montants non appelés (idem)',NULL,NULL,1),(746,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2828','743','Plus-values actées (idem)',NULL,NULL,1),(747,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2829','743','Réductions de valeurs actées (idem)',NULL,NULL,1),(748,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','283','731','Créances sur des entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(749,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2830','748','Créances en compte',NULL,NULL,1),(750,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2831','748','Effets à recevoir',NULL,NULL,1),(751,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2832','748','Titres à revenu fixe',NULL,NULL,1),(752,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2837','748','Créances douteuses',NULL,NULL,1),(753,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2839','748','Réductions de valeurs actées',NULL,NULL,1),(754,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','284','731','Autres actions et parts',NULL,NULL,1),(755,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2840','754','Valeur d\'acquisition',NULL,NULL,1),(756,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2841','754','Montants non appelés',NULL,NULL,1),(757,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2848','754','Plus-values actées',NULL,NULL,1),(758,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2849','754','Réductions de valeur actées',NULL,NULL,1),(759,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','285','731','Autres créances',NULL,NULL,1),(760,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2850','759','Créances en compte',NULL,NULL,1),(761,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2851','759','Effets à recevoir',NULL,NULL,1),(762,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2852','759','Titres à revenu fixe',NULL,NULL,1),(763,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2857','759','Créances douteuses',NULL,NULL,1),(764,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2859','759','Réductions de valeur actées',NULL,NULL,1),(765,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','288','731','Cautionnements versés en numéraires',NULL,NULL,1),(766,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2880','765','Téléphone, téléfax, télex',NULL,NULL,1),(767,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2881','765','Gaz',NULL,NULL,1),(768,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2882','765','Eau',NULL,NULL,1),(769,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2883','765','Electricité',NULL,NULL,1),(770,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2887','765','Autres cautionnements versés en numéraires',NULL,NULL,1),(771,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29','1352','Créances à plus d\'un an',NULL,NULL,1),(772,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','290','771','Créances commerciales',NULL,NULL,1),(773,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2900','772','Clients',NULL,NULL,1),(774,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29000','773','Créances en compte sur entreprises liées',NULL,NULL,1),(775,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29001','773','Sur entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(776,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29002','773','Sur clients Belgique',NULL,NULL,1),(777,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29003','773','Sur clients C.E.E.',NULL,NULL,1),(778,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29004','773','Sur clients exportation hors C.E.E.',NULL,NULL,1),(779,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29005','773','Créances sur les coparticipants (associations momentanées)',NULL,NULL,1),(780,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2901','772','Effets à recevoir',NULL,NULL,1),(781,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29010','780','Sur entreprises liées',NULL,NULL,1),(782,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29011','780','Sur entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(783,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29012','780','Sur clients Belgique',NULL,NULL,1),(784,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29013','780','Sur clients C.E.E.',NULL,NULL,1),(785,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29014','780','Sur clients exportation hors C.E.E.',NULL,NULL,1),(786,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2905','772','Retenues sur garanties',NULL,NULL,1),(787,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2906','772','Acomptes versés',NULL,NULL,1),(788,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2907','772','Créances douteuses (à ventiler comme clients 2900)',NULL,NULL,1),(789,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2909','772','Réductions de valeur actées (à ventiler comme clients 2900)',NULL,NULL,1),(790,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','291','771','Autres créances',NULL,NULL,1),(791,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2910','790','Créances en compte',NULL,NULL,1),(792,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29100','791','Sur entreprises liées',NULL,NULL,1),(793,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29101','791','Sur entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(794,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29102','791','Sur autres débiteurs',NULL,NULL,1),(795,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2911','790','Effets à recevoir',NULL,NULL,1),(796,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29110','795','Sur entreprises liées',NULL,NULL,1),(797,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29111','795','Sur entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(798,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','29112','795','Sur autres débiteurs',NULL,NULL,1),(799,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2912','790','Créances résultant de la cession d\'immobilisations données en leasing',NULL,NULL,1),(800,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2917','790','Créances douteuses',NULL,NULL,1),(801,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2919','790','Réductions de valeur actées',NULL,NULL,1),(802,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','30','1353','Approvisionnements - matières premières',NULL,NULL,1),(803,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','300','802','Valeur d\'acquisition',NULL,NULL,1),(804,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','309','802','Réductions de valeur actées',NULL,NULL,1),(805,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','31','1353','Approvsionnements et fournitures',NULL,NULL,1),(806,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','310','805','Valeur d\'acquisition',NULL,NULL,1),(807,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3100','806','Matières d\'approvisionnement',NULL,NULL,1),(808,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3101','806','Energie, charbon, coke, mazout, essence, propane',NULL,NULL,1),(809,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3102','806','Produits d\'entretien',NULL,NULL,1),(810,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3103','806','Fournitures diverses et petit outillage',NULL,NULL,1),(811,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3104','806','Imprimés et fournitures de bureau',NULL,NULL,1),(812,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3105','806','Fournitures de services sociaux',NULL,NULL,1),(813,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3106','806','Emballages commerciaux',NULL,NULL,1),(814,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','31060','813','Emballages perdus',NULL,NULL,1),(815,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','31061','813','Emballages récupérables',NULL,NULL,1),(816,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','319','805','Réductions de valeur actées',NULL,NULL,1),(817,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','32','1353','En cours de fabrication',NULL,NULL,1),(818,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','320','817','Valeur d\'acquisition',NULL,NULL,1),(819,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3200','818','Produits semi-ouvrés',NULL,NULL,1),(820,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3201','818','Produits en cours de fabrication',NULL,NULL,1),(821,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3202','818','Travaux en cours',NULL,NULL,1),(822,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3205','818','Déchets',NULL,NULL,1),(823,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3206','818','Rebuts',NULL,NULL,1),(824,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3209','818','Travaux en association momentanée',NULL,NULL,1),(825,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','329','817','Réductions de valeur actées',NULL,NULL,1),(826,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','33','1353','Produits finis',NULL,NULL,1),(827,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','330','826','Valeur d\'acquisition',NULL,NULL,1),(828,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3300','827','Produits finis',NULL,NULL,1),(829,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','339','826','Réductions de valeur actées',NULL,NULL,1),(830,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','34','1353','Marchandises',NULL,NULL,1),(831,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','340','830','Valeur d\'acquisition',NULL,NULL,1),(832,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3400','831','Groupe A',NULL,NULL,1),(833,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3401','831','Groupe B',NULL,NULL,1),(834,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3402','831','Groupe C',NULL,NULL,1),(835,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','349','830','Réductions de valeur actées',NULL,NULL,1),(836,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','35','1353','Immeubles destinés à la vente',NULL,NULL,1),(837,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','350','836','Valeur d\'acquisition',NULL,NULL,1),(838,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3500','837','Immeuble A',NULL,NULL,1),(839,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3501','837','Immeuble B',NULL,NULL,1),(840,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3502','837','Immeuble C',NULL,NULL,1),(841,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','351','836','Immeubles construits en vue de leur revente',NULL,NULL,1),(842,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3510','841','Immeuble A',NULL,NULL,1),(843,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3511','841','Immeuble B',NULL,NULL,1),(844,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3512','841','Immeuble C',NULL,NULL,1),(845,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','359','836','Réductions de valeurs actées',NULL,NULL,1),(846,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','36','1353','Acomptes versés sur achats pour stocks',NULL,NULL,1),(847,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','360','846','Acomptes versés (à ventiler éventuellement par catégorie)',NULL,NULL,1),(848,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','369','846','Réductions de valeur actées',NULL,NULL,1),(849,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','37','1353','Commandes en cours d\'exécution',NULL,NULL,1),(850,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','370','849','Valeur d\'acquisition',NULL,NULL,1),(851,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','371','849','Bénéfice pris en compte',NULL,NULL,1),(852,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','379','849','Réductions de valeur actées',NULL,NULL,1),(853,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','40','1354','Créances commerciales',NULL,NULL,1),(854,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','400','853','Clients',NULL,NULL,1),(855,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4007','854','Rabais, remises et ristournes à accorder et autres notes de crédit à établir',NULL,NULL,1),(856,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4008','854','Créances résultant de livraisons de biens (associations momentanées)',NULL,NULL,1),(857,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','401','853','Effets à recevoir',NULL,NULL,1),(858,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4010','857','Effets à recevoir',NULL,NULL,1),(859,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4013','857','Effets à l\'encaissement',NULL,NULL,1),(860,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4015','857','Effets à l\'escompte',NULL,NULL,1),(861,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','402','853','Clients, créances courantes, entreprises apparentées, administrateurs et gérants',NULL,NULL,1),(862,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4020','861','Entreprises liées',NULL,NULL,1),(863,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4021','861','Autres entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(864,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4022','861','Administrateurs et gérants d\'entreprise',NULL,NULL,1),(865,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','403','853','Effets à recevoir sur entreprises apparentées et administrateurs et gérants',NULL,NULL,1),(866,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4030','865','Entreprises liées',NULL,NULL,1),(867,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4031','865','Autres entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(868,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4032','865','Administrateurs et gérants de l\'entreprise',NULL,NULL,1),(869,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','404','853','Produits à recevoir (factures à établir)',NULL,NULL,1),(870,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','405','853','Clients : retenues sur garanties',NULL,NULL,1),(871,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','406','853','Acomptes versés',NULL,NULL,1),(872,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','407','853','Créances douteuses',NULL,NULL,1),(873,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','408','853','Compensation clients',NULL,NULL,1),(874,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','409','853','Réductions de valeur actées',NULL,NULL,1),(875,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','41','1354','Autres créances',NULL,NULL,1),(876,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','410','875','Capital appelé, non versé',NULL,NULL,1),(877,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4100','876','Appels de fonds',NULL,NULL,1),(878,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4101','876','Actionnaires défaillants',NULL,NULL,1),(879,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','411','875','T.V.A. à récupérer',NULL,NULL,1),(880,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4110','879','T.V.A. due',NULL,NULL,1),(881,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4111','879','T.V.A. déductible',NULL,NULL,1),(882,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4112','879','Compte courant administration T.V.A.',NULL,NULL,1),(883,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4118','879','Taxe d\'égalisation due',NULL,NULL,1),(884,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','412','875','Impôts et versements fiscaux à récupérer',NULL,NULL,1),(885,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4120','884','Impôts belges sur le résultat',NULL,NULL,1),(886,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4125','884','Autres impôts belges',NULL,NULL,1),(887,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4128','884','Impôts étrangers',NULL,NULL,1),(888,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','414','875','Produits à recevoir',NULL,NULL,1),(889,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','416','875','Créances diverses',NULL,NULL,1),(890,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4160','889','Associés (compte d\'apport en société)',NULL,NULL,1),(891,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4161','889','Avances et prêts au personnel',NULL,NULL,1),(892,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4162','889','Compte courant des associés en S.P.R.L.',NULL,NULL,1),(893,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4163','889','Compte courant des administrateurs et gérants',NULL,NULL,1),(894,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4164','889','Créances sur sociétés apparentées',NULL,NULL,1),(895,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4166','889','Emballages et matériel à rendre',NULL,NULL,1),(896,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4167','889','Etat et établissements publics',NULL,NULL,1),(897,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','41670','896','Subsides à recevoir',NULL,NULL,1),(898,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','41671','896','Autres créances',NULL,NULL,1),(899,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4168','889','Rabais, ristournes et remises à obtenir et autres avoirs non encore reçus',NULL,NULL,1),(900,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','417','875','Créances douteuses',NULL,NULL,1),(901,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','418','875','Cautionnements versés en numéraires',NULL,NULL,1),(902,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','419','875','Réductions de valeur actées',NULL,NULL,1),(903,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','42','1354','Dettes à plus d\'un an échéant dans l\'année',NULL,NULL,1),(904,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','420','903','Emprunts subordonnés',NULL,NULL,1),(905,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4200','904','Convertibles',NULL,NULL,1),(906,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4201','904','Non convertibles',NULL,NULL,1),(907,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','421','903','Emprunts obligataires non subordonnés',NULL,NULL,1),(908,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4210','907','Convertibles',NULL,NULL,1),(909,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4211','907','Non convertibles',NULL,NULL,1),(910,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','422','903','Dettes de location-financement et assimilées',NULL,NULL,1),(911,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4220','910','Financement de biens immobiliers',NULL,NULL,1),(912,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4221','910','Financement de biens mobiliers',NULL,NULL,1),(913,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','423','903','Etablissements de crédit',NULL,NULL,1),(914,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4230','913','Dettes en compte',NULL,NULL,1),(915,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4231','913','Promesses',NULL,NULL,1),(916,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4232','913','Crédits d\'acceptation',NULL,NULL,1),(917,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','424','903','Autres emprunts',NULL,NULL,1),(918,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','425','903','Dettes commerciales',NULL,NULL,1),(919,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4250','918','Fournisseurs',NULL,NULL,1),(920,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4251','918','Effets à payer',NULL,NULL,1),(921,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','426','903','Cautionnements reçus en numéraires',NULL,NULL,1),(922,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','429','903','Dettes diverses',NULL,NULL,1),(923,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4290','922','Entreprises liées',NULL,NULL,1),(924,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4291','922','Entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(925,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4292','922','Administrateurs, gérants, associés',NULL,NULL,1),(926,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4299','922','Autres dettes',NULL,NULL,1),(927,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','43','1354','Dettes financières',NULL,NULL,1),(928,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','430','927','Etablissements de crédit. Emprunts en compte à terme fixe',NULL,NULL,1),(929,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','431','927','Etablissements de crédit. Promesses',NULL,NULL,1),(930,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','432','927','Etablissements de crédit. Crédits d\'acceptation',NULL,NULL,1),(931,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','433','927','Etablissements de crédit. Dettes en compte courant',NULL,NULL,1),(932,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','439','927','Autres emprunts',NULL,NULL,1),(933,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','44','1354','Dettes commerciales',NULL,NULL,1),(934,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','440','933','Fournisseurs',NULL,NULL,1),(935,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4400','934','Entreprises apparentées',NULL,NULL,1),(936,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','44000','935','Entreprises liées',NULL,NULL,1),(937,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','44001','935','Entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(938,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4401','934','Fournisseurs ordinaires',NULL,NULL,1),(939,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','44010','938','Fournisseurs belges',NULL,NULL,1),(940,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','44011','938','Fournisseurs CEE',NULL,NULL,1),(941,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','44012','938','Fournisseurs importation',NULL,NULL,1),(942,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4402','934','Dettes envers les coparticipants (associations momentanées)',NULL,NULL,1),(943,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4403','934','Fournisseurs - retenues de garanties',NULL,NULL,1),(944,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','441','933','Effets à payer',NULL,NULL,1),(945,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4410','944','Entreprises apparentées',NULL,NULL,1),(946,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','44100','945','Entreprises liées',NULL,NULL,1),(947,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','44101','945','Entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(948,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4411','944','Fournisseurs ordinaires',NULL,NULL,1),(949,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','44110','948','Fournisseurs belges',NULL,NULL,1),(950,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','44111','948','Fournisseurs CEE',NULL,NULL,1),(951,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','44112','948','Fournisseurs importation',NULL,NULL,1),(952,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','444','933','Factures à recevoir',NULL,NULL,1),(953,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','446','933','Acomptes reçus',NULL,NULL,1),(954,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','448','933','Compensations fournisseurs',NULL,NULL,1),(955,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','45','1354','Dettes fiscales, salariales et sociales',NULL,NULL,1),(956,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','450','955','Dettes fiscales estimées',NULL,NULL,1),(957,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4501','956','Impôts sur le résultat',NULL,NULL,1),(958,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4505','956','Autres impôts en Belgique',NULL,NULL,1),(959,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4508','956','Impôts à l\'étranger',NULL,NULL,1),(960,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','451','955','T.V.A. à payer',NULL,NULL,1),(961,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4510','960','T.V.A. due',NULL,NULL,1),(962,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4511','960','T.V.A. déductible',NULL,NULL,1),(963,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4512','960','Compte courant administration T.V.A.',NULL,NULL,1),(964,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4518','960','Taxe d\'égalisation due',NULL,NULL,1),(965,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','452','955','Impôts et taxes à payer',NULL,NULL,1),(966,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4520','965','Autres impôts sur le résultat',NULL,NULL,1),(967,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4525','965','Autres impôts et taxes en Belgique',NULL,NULL,1),(968,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','45250','967','Précompte immobilier',NULL,NULL,1),(969,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','45251','967','Impôts communaux à payer',NULL,NULL,1),(970,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','45252','967','Impôts provinciaux à payer',NULL,NULL,1),(971,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','45253','967','Autres impôts et taxes à payer',NULL,NULL,1),(972,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4528','965','Impôts et taxes à l\'étranger',NULL,NULL,1),(973,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','453','955','Précomptes retenus',NULL,NULL,1),(974,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4530','973','Précompte professionnel retenu sur rémunérations',NULL,NULL,1),(975,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4531','973','Précompte professionnel retenu sur tantièmes',NULL,NULL,1),(976,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4532','973','Précompte mobilier retenu sur dividendes attribués',NULL,NULL,1),(977,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4533','973','Précompte mobilier retenu sur intérêts payés',NULL,NULL,1),(978,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4538','973','Autres précomptes retenus',NULL,NULL,1),(979,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','454','955','Office National de la Sécurité Sociale',NULL,NULL,1),(980,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4540','979','Arriérés',NULL,NULL,1),(981,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4541','979','1er trimestre',NULL,NULL,1),(982,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4542','979','2ème trimestre',NULL,NULL,1),(983,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4543','979','3ème trimestre',NULL,NULL,1),(984,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4544','979','4ème trimestre',NULL,NULL,1),(985,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','455','955','Rémunérations',NULL,NULL,1),(986,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4550','985','Administrateurs, gérants et commissaires (non réviseurs)',NULL,NULL,1),(987,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4551','985','Direction',NULL,NULL,1),(988,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4552','985','Employés',NULL,NULL,1),(989,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4553','985','Ouvriers',NULL,NULL,1),(990,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','456','955','Pécules de vacances',NULL,NULL,1),(991,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4560','990','Direction',NULL,NULL,1),(992,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4561','990','Employés',NULL,NULL,1),(993,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4562','990','Ouvriers',NULL,NULL,1),(994,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','459','955','Autres dettes sociales',NULL,NULL,1),(995,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4590','994','Provision pour gratifications de fin d\'année',NULL,NULL,1),(996,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4591','994','Départs de personnel',NULL,NULL,1),(997,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4592','994','Oppositions sur rémunérations',NULL,NULL,1),(998,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4593','994','Assurances relatives au personnel',NULL,NULL,1),(999,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','45930','998','Assurance loi',NULL,NULL,1),(1000,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','45931','998','Assurance salaire garanti',NULL,NULL,1),(1001,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','45932','998','Assurance groupe',NULL,NULL,1),(1002,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','45933','998','Assurances individuelles',NULL,NULL,1),(1003,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4594','994','Caisse d\'assurances sociales pour travailleurs indépendants',NULL,NULL,1),(1004,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4597','994','Dettes et provisions sociales diverses',NULL,NULL,1),(1005,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','46','1354','Acomptes reçus sur commande',NULL,NULL,1),(1006,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','47','1354','Dettes découlant de l\'affectation des résultats',NULL,NULL,1),(1007,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','470','1006','Dividendes et tantièmes d\'exercices antérieurs',NULL,NULL,1),(1008,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','471','1006','Dividendes de l\'exercice',NULL,NULL,1),(1009,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','472','1006','Tantièmes de l\'exercice',NULL,NULL,1),(1010,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','473','1006','Autres allocataires',NULL,NULL,1),(1011,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','48','4','Dettes diverses',NULL,NULL,1),(1012,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','480','1011','Obligations et coupons échus',NULL,NULL,1),(1013,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','481','1011','Actionnaires - capital à rembourser',NULL,NULL,1),(1014,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','482','1011','Participation du personnel à payer',NULL,NULL,1),(1015,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','483','1011','Acomptes reçus d\'autres tiers à moins d\'un an',NULL,NULL,1),(1016,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','486','1011','Emballages et matériel consignés',NULL,NULL,1),(1017,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','488','1011','Cautionnements reçus en numéraires',NULL,NULL,1),(1018,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','489','1011','Autres dettes diverses',NULL,NULL,1),(1019,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','49','1354','Comptes de régularisation et compte d\'attente',NULL,NULL,1),(1020,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','490','1019','Charges à reporter (à subdiviser par catégorie de charges)',NULL,NULL,1),(1021,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','491','1019','Produits acquis',NULL,NULL,1),(1022,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4910','1021','Produits d\'exploitation',NULL,NULL,1),(1023,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','49100','1022','Ristournes et rabais à obtenir',NULL,NULL,1),(1024,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','49101','1022','Commissions à obtenir',NULL,NULL,1),(1025,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','49102','1022','Autres produits d\'exploitation (redevances par exemple)',NULL,NULL,1),(1026,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4911','1021','Produits financiers',NULL,NULL,1),(1027,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','49110','1026','Intérêts courus et non échus sur prêts et débits',NULL,NULL,1),(1028,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','49111','1026','Autres produits financiers',NULL,NULL,1),(1029,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','492','1019','Charges à imputer (à subdiviser par catégorie de charges)',NULL,NULL,1),(1030,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','493','1019','Produits à reporter',NULL,NULL,1),(1031,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4930','1030','Produits d\'exploitation à reporter',NULL,NULL,1),(1032,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4931','1030','Produits financiers à reporter',NULL,NULL,1),(1033,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','499','1019','Comptes d\'attente',NULL,NULL,1),(1034,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4990','1033','Compte d\'attente',NULL,NULL,1),(1035,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4991','1033','Compte de répartition périodique des charges',NULL,NULL,1),(1036,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4999','1033','Transferts d\'exercice',NULL,NULL,1),(1037,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','50','1355','Actions propres',NULL,NULL,1),(1038,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','51','1355','Actions et parts',NULL,NULL,1),(1039,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','510','1038','Valeur d\'acquisition',NULL,NULL,1),(1040,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','511','1038','Montants non appelés',NULL,NULL,1),(1041,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','519','1038','Réductions de valeur actées',NULL,NULL,1),(1042,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','52','1355','Titres à revenus fixes',NULL,NULL,1),(1043,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','520','1042','Valeur d\'acquisition',NULL,NULL,1),(1044,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','529','1042','Réductions de valeur actées',NULL,NULL,1),(1045,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','53','1355','Dépots à terme',NULL,NULL,1),(1046,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','530','1045','De plus d\'un an',NULL,NULL,1),(1047,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','531','1045','De plus d\'un mois et à un an au plus',NULL,NULL,1),(1048,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','532','1045','d\'un mois au plus',NULL,NULL,1),(1049,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','539','1045','Réductions de valeur actées',NULL,NULL,1),(1050,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','54','1355','Valeurs échues à l\'encaissement',NULL,NULL,1),(1051,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','540','1050','Chèques à encaisser',NULL,NULL,1),(1052,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','541','1050','Coupons à encaisser',NULL,NULL,1),(1053,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','55','1355','Etablissements de crédit - Comptes ouverts auprès des divers établissements.',NULL,NULL,1),(1054,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','550','1053','Comptes courants',NULL,NULL,1),(1055,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','551','1053','Chèques émis',NULL,NULL,1),(1056,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','559','1053','Réductions de valeur actées',NULL,NULL,1),(1057,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','56','1355','Office des chèques postaux',NULL,NULL,1),(1058,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','560','1057','Compte courant',NULL,NULL,1),(1059,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','561','1057','Chèques émis',NULL,NULL,1),(1060,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','57','1355','Caisses',NULL,NULL,1),(1061,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','570','1060','à 577 Caisses - espèces ( 0 - centrale ; 7 - succursales et agences)',NULL,NULL,1),(1062,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','578','1060','Caisses - timbres ( 0 - fiscaux ; 1 - postaux)',NULL,NULL,1),(1063,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','58','1355','Virements internes',NULL,NULL,1),(1064,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','60','1356','Approvisionnements et marchandises',NULL,NULL,1),(1065,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','600','1064','Achats de matières premières',NULL,NULL,1),(1066,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','601','1064','Achats de fournitures',NULL,NULL,1),(1067,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','602','1064','Achats de services, travaux et études',NULL,NULL,1),(1068,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','603','1064','Sous-traitances générales',NULL,NULL,1),(1069,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','604','1064','Achats de marchandises',NULL,NULL,1),(1070,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','605','1064','Achats d\'immeubles destinés à la revente',NULL,NULL,1),(1071,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','608','1064','Remises , ristournes et rabais obtenus sur achats',NULL,NULL,1),(1072,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','609','1064','Variations de stocks',NULL,NULL,1),(1073,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6090','1072','De matières premières',NULL,NULL,1),(1074,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6091','1072','De fournitures',NULL,NULL,1),(1075,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6094','1072','De marchandises',NULL,NULL,1),(1076,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6095','1072','d\'immeubles destinés à la vente',NULL,NULL,1),(1077,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61','1356','Services et biens divers',NULL,NULL,1),(1078,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','610','1077','Loyers et charges locatives',NULL,NULL,1),(1079,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6100','1078','Loyers divers',NULL,NULL,1),(1080,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6101','1078','Charges locatives (assurances, frais de confort,etc)',NULL,NULL,1),(1081,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','611','1077','Entretien et réparation (fournitures et prestations)',NULL,NULL,1),(1082,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','612','1077','Fournitures faites à l\'entreprise',NULL,NULL,1),(1083,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6120','1082','Eau, gaz, électricité, vapeur',NULL,NULL,1),(1084,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61200','1083','Eau',NULL,NULL,1),(1085,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61201','1083','Gaz',NULL,NULL,1),(1086,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61202','1083','Electricité',NULL,NULL,1),(1087,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61203','1083','Vapeur',NULL,NULL,1),(1088,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6121','1082','Téléphone, télégrammes, télex, téléfax, frais postaux',NULL,NULL,1),(1089,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61210','1088','Téléphone',NULL,NULL,1),(1090,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61211','1088','Télégrammes',NULL,NULL,1),(1091,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61212','1088','Télex et téléfax',NULL,NULL,1),(1092,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61213','1088','Frais postaux',NULL,NULL,1),(1093,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6122','1082','Livres, bibliothèque',NULL,NULL,1),(1094,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6123','1082','Imprimés et fournitures de bureau (si non comptabilisé au 601)',NULL,NULL,1),(1095,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','613','1077','Rétributions de tiers',NULL,NULL,1),(1096,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6130','1095','Redevances et royalties',NULL,NULL,1),(1097,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61300','1096','Redevances pour brevets, licences, marques et accessoires',NULL,NULL,1),(1098,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61301','1096','Autres redevances (procédés de fabrication)',NULL,NULL,1),(1099,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6131','1095','Assurances non relatives au personnel',NULL,NULL,1),(1100,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61310','1099','Assurance incendie',NULL,NULL,1),(1101,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61311','1099','Assurance vol',NULL,NULL,1),(1102,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61312','1099','Assurance autos',NULL,NULL,1),(1103,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61313','1099','Assurance crédit',NULL,NULL,1),(1104,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61314','1099','Assurances frais généraux',NULL,NULL,1),(1105,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6132','1095','Divers',NULL,NULL,1),(1106,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61320','1105','Commissions aux tiers',NULL,NULL,1),(1107,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61321','1105','Honoraires d\'avocats, d\'experts, etc',NULL,NULL,1),(1108,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61322','1105','Cotisations aux groupements professionnels',NULL,NULL,1),(1109,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61323','1105','Dons, libéralités, etc',NULL,NULL,1),(1110,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61324','1105','Frais de contentieux',NULL,NULL,1),(1111,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61325','1105','Publications légales',NULL,NULL,1),(1112,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6133','1095','Transports et déplacements',NULL,NULL,1),(1113,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61330','1112','Transports de personnel',NULL,NULL,1),(1114,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','61331','1112','Voyages, déplacements et représentations',NULL,NULL,1),(1115,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6134','1095','Personnel intérimaire',NULL,NULL,1),(1116,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','614','1077','Annonces, publicité, propagande et documentation',NULL,NULL,1),(1117,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6140','1116','Annonces et insertions',NULL,NULL,1),(1118,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6141','1116','Catalogues et imprimés',NULL,NULL,1),(1119,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6142','1116','Echantillons',NULL,NULL,1),(1120,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6143','1116','Foires et expositions',NULL,NULL,1),(1121,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6144','1116','Primes',NULL,NULL,1),(1122,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6145','1116','Cadeaux à la clientèle',NULL,NULL,1),(1123,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6146','1116','Missions et réceptions',NULL,NULL,1),(1124,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6147','1116','Documentation',NULL,NULL,1),(1125,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','615','1077','Sous-traitants',NULL,NULL,1),(1126,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6150','1125','Sous-traitants pour activités propres',NULL,NULL,1),(1127,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6151','1125','Sous-traitants d\'associations momentanées (coparticipants)',NULL,NULL,1),(1128,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6152','1125','Quote-part bénéficiaire des coparticipants',NULL,NULL,1),(1129,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','617','1077','Personnel intérimaire et personnes mises à la disposition de l\'entreprise',NULL,NULL,1),(1130,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','618','1077','Rémunérations, primes pour assurances extralégales, pensions de retraite et de survie des administrateurs, gérants et associés actifs qui ne sont pas attribuées en vertu d\'un contrat de travail',NULL,NULL,1),(1131,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','62','1356','Rémunérations, charges sociales et pensions',NULL,NULL,1),(1132,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','620','1131','Rémunérations et avantages sociaux directs',NULL,NULL,1),(1133,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6200','1132','Administrateurs ou gérants',NULL,NULL,1),(1134,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6201','1132','Personnel de direction',NULL,NULL,1),(1135,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6202','1132','Employés',NULL,NULL,1),(1136,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6203','1132','Ouvriers',NULL,NULL,1),(1137,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6204','1132','Autres membres du personnel',NULL,NULL,1),(1138,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','621','1131','Cotisations patronales d\'assurances sociales',NULL,NULL,1),(1139,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6210','1138','Sur salaires',NULL,NULL,1),(1140,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6211','1138','Sur appointements et commissions',NULL,NULL,1),(1141,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','622','1131','Primes patronales pour assurances extralégales',NULL,NULL,1),(1142,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','623','1131','Autres frais de personnel',NULL,NULL,1),(1143,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6230','1142','Assurances du personnel',NULL,NULL,1),(1144,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','62300','1143','Assurances loi, responsabilité civile, chemin du travail',NULL,NULL,1),(1145,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','62301','1143','Assurance salaire garanti',NULL,NULL,1),(1146,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','62302','1143','Assurances individuelles',NULL,NULL,1),(1147,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6231','1142','Charges sociales diverses',NULL,NULL,1),(1148,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','62310','1147','Jours fériés payés',NULL,NULL,1),(1149,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','62311','1147','Salaire hebdomadaire garanti',NULL,NULL,1),(1150,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','62312','1147','Allocations familiales complémentaires',NULL,NULL,1),(1151,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6232','1142','Charges sociales des administrateurs, gérants et commissaires',NULL,NULL,1),(1152,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','62320','1151','Allocations familiales complémentaires pour non salariés',NULL,NULL,1),(1153,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','62321','1151','Lois sociales pour indépendants',NULL,NULL,1),(1154,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','62322','1151','Divers',NULL,NULL,1),(1155,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','624','1131','Pensions de retraite et de survie',NULL,NULL,1),(1156,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6240','1155','Administrateurs et gérants',NULL,NULL,1),(1157,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6241','1155','Personnel',NULL,NULL,1),(1158,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','625','1131','Provision pour pécule de vacances',NULL,NULL,1),(1159,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6250','1158','Dotations',NULL,NULL,1),(1160,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6251','1158','Utilisations et reprises',NULL,NULL,1),(1161,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','63','1356','Amortissements, réductions de valeur et provisions pour risques et charges',NULL,NULL,1),(1162,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','630','1161','Dotations aux amortissements et aux réductions de valeur sur immobilisations',NULL,NULL,1),(1163,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6300','1162','Dotations aux amortissements sur frais d\'établissement',NULL,NULL,1),(1164,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6301','1162','Dotations aux amortissements sur immobilisations incorporelles',NULL,NULL,1),(1165,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6302','1162','Dotations aux amortissements sur immobilisations corporelles',NULL,NULL,1),(1166,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6308','1162','Dotations aux réductions de valeur sur immobilisations incorporelles',NULL,NULL,1),(1167,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6309','1162','Dotations aux réductions de valeur sur immobilisations corporelles',NULL,NULL,1),(1168,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','631','1161','Réductions de valeur sur stocks',NULL,NULL,1),(1169,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6310','1168','Dotations',NULL,NULL,1),(1170,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6311','1168','Reprises',NULL,NULL,1),(1171,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','632','1161','Réductions de valeur sur commandes en cours d\'exécution',NULL,NULL,1),(1172,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6320','1171','Dotations',NULL,NULL,1),(1173,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6321','1171','Reprises',NULL,NULL,1),(1174,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','633','1161','Réductions de valeur sur créances commerciales à plus d\'un an',NULL,NULL,1),(1175,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6330','1174','Dotations',NULL,NULL,1),(1176,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6331','1174','Reprises',NULL,NULL,1),(1177,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','634','1161','Réductions de valeur sur créances commerciales à un an au plus',NULL,NULL,1),(1178,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6340','1177','Dotations',NULL,NULL,1),(1179,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6341','1177','Reprises',NULL,NULL,1),(1180,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','635','1161','Provisions pour pensions et obligations similaires',NULL,NULL,1),(1181,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6350','1180','Dotations',NULL,NULL,1),(1182,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6351','1180','Utilisations et reprises',NULL,NULL,1),(1183,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','636','11613','Provisions pour grosses réparations et gros entretiens',NULL,NULL,1),(1184,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6360','1183','Dotations',NULL,NULL,1),(1185,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6361','1183','Utilisations et reprises',NULL,NULL,1),(1186,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','637','1161','Provisions pour autres risques et charges',NULL,NULL,1),(1187,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6370','1186','Dotations',NULL,NULL,1),(1188,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6371','1186','Utilisations et reprises',NULL,NULL,1),(1189,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','64','1356','Autres charges d\'exploitation',NULL,NULL,1),(1190,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','640','1189','Charges fiscales d\'exploitation',NULL,NULL,1),(1191,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6400','1190','Taxes et impôts directs',NULL,NULL,1),(1192,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','64000','1191','Taxes sur autos et camions',NULL,NULL,1),(1193,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6401','1190','Taxes et impôts indirects',NULL,NULL,1),(1194,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','64010','1193','Timbres fiscaux pris en charge par la firme',NULL,NULL,1),(1195,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','64011','1193','Droits d\'enregistrement',NULL,NULL,1),(1196,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','64012','1193','T.V.A. non déductible',NULL,NULL,1),(1197,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6402','1190','Impôts provinciaux et communaux',NULL,NULL,1),(1198,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','64020','1197','Taxe sur la force motrice',NULL,NULL,1),(1199,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','64021','1197','Taxe sur le personnel occupé',NULL,NULL,1),(1200,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6403','1190','Taxes diverses',NULL,NULL,1),(1201,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','641','1189','Moins-values sur réalisations courantes d\'immobilisations corporelles',NULL,NULL,1),(1202,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','642','1189','Moins-values sur réalisations de créances commerciales',NULL,NULL,1),(1203,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','643','1189','à 648 Charges d\'exploitations diverses',NULL,NULL,1),(1204,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','649','1189','Charges d\'exploitation portées à l\'actif au titre de restructuration',NULL,NULL,1),(1205,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','65','1356','Charges financières',NULL,NULL,1),(1206,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','650','1205','Charges des dettes',NULL,NULL,1),(1207,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6500','1206','Intérêts, commissions et frais afférents aux dettes',NULL,NULL,1),(1208,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6501','1206','Amortissements des agios et frais d\'émission d\'emprunts',NULL,NULL,1),(1209,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6502','1206','Autres charges de dettes',NULL,NULL,1),(1210,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6503','1206','Intérêts intercalaires portés à l\'actif',NULL,NULL,1),(1211,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','651','1205','Réductions de valeur sur actifs circulants',NULL,NULL,1),(1212,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6510','1211','Dotations',NULL,NULL,1),(1213,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6511','1211','Reprises',NULL,NULL,1),(1214,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','652','1205','Moins-values sur réalisation d\'actifs circulants',NULL,NULL,1),(1215,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','653','1205','Charges d\'escompte de créances',NULL,NULL,1),(1216,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','654','1205','Différences de change',NULL,NULL,1),(1217,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','655','1205','Ecarts de conversion des devises',NULL,NULL,1),(1218,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','656','1205','Frais de banques, de chèques postaux',NULL,NULL,1),(1219,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','657','1205','Commissions sur ouvertures de crédit, cautions et avals',NULL,NULL,1),(1220,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','658','1205','Frais de vente des titres',NULL,NULL,1),(1221,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','66','1356','Charges exceptionnelles',NULL,NULL,1),(1222,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','660','1221','Amortissements et réductions de valeur exceptionnels',NULL,NULL,1),(1223,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6600','1222','Sur frais d\'établissement',NULL,NULL,1),(1224,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6601','1222','Sur immobilisations incorporelles',NULL,NULL,1),(1225,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6602','1222','Sur immobilisations corporelles',NULL,NULL,1),(1226,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','661','1221','Réductions de valeur sur immobilisations financières',NULL,NULL,1),(1227,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','662','1221','Provisions pour risques et charges exceptionnels',NULL,NULL,1),(1228,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','663','1221','Moins-values sur réalisation d\'actifs immobilisés',NULL,NULL,1),(1229,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6630','1228','Sur immobilisations incorporelles',NULL,NULL,1),(1230,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6631','1228','Sur immobilisations corporelles',NULL,NULL,1),(1231,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6632','1228','Sur immobilisations détenues en location-financement et droits similaires',NULL,NULL,1),(1232,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6633','1228','Sur immobilisations financières',NULL,NULL,1),(1233,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6634','1228','Sur immeubles acquis ou construits en vue de la revente',NULL,NULL,1),(1234,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','664','1221','à 668 Autres charges exceptionnelles',NULL,NULL,1),(1235,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','664','1221','Pénalités et amendes diverses',NULL,NULL,1),(1236,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','665','1221','Différence de charge',NULL,NULL,1),(1237,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','669','1221','Charges exceptionnelles transférées à l\'actif en frais de restructuration',NULL,NULL,1),(1238,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','67','1356','Impôts sur le résultat',NULL,NULL,1),(1239,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','670','1238','Impôts belges sur le résultat de l\'exercice',NULL,NULL,1),(1240,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6700','1239','Impôts et précomptes dus ou versés',NULL,NULL,1),(1241,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6701','1239','Excédent de versements d\'impôts et précomptes porté à l\'actif',NULL,NULL,1),(1242,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6702','1239','Charges fiscales estimées',NULL,NULL,1),(1243,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','671','1238','Impôts belges sur le résultat d\'exercices antérieurs',NULL,NULL,1),(1244,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6710','1243','Suppléments d\'impôts dus ou versés',NULL,NULL,1),(1245,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6711','1243','Suppléments d\'impôts estimés',NULL,NULL,1),(1246,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6712','1243','Provisions fiscales constituées',NULL,NULL,1),(1247,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','672','1238','Impôts étrangers sur le résultat de l\'exercice',NULL,NULL,1),(1248,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','673','1238','Impôts étrangers sur le résultat d\'exercices antérieurs',NULL,NULL,1),(1249,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','68','1356','Transferts aux réserves immunisées',NULL,NULL,1),(1250,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','69','1356','Affectation des résultats',NULL,NULL,1),(1251,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','690','1250','Perte reportée de l\'exercice précédent',NULL,NULL,1),(1252,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','691','1250','Dotation à la réserve légale',NULL,NULL,1),(1253,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','692','1250','Dotation aux autres réserves',NULL,NULL,1),(1254,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','693','1250','Bénéfice à reporter',NULL,NULL,1),(1255,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','694','1250','Rémunération du capital',NULL,NULL,1),(1256,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','695','1250','Administrateurs ou gérants',NULL,NULL,1),(1257,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','696','1250','Autres allocataires',NULL,NULL,1),(1258,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','70','1357','Chiffre d\'affaires',NULL,NULL,1),(1260,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','700','1258','Ventes de marchandises',NULL,NULL,1),(1261,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7000','1260','Ventes en Belgique',NULL,NULL,1),(1262,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7001','1260','Ventes dans les pays membres de la C.E.E.',NULL,NULL,1),(1263,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7002','1260','Ventes à l\'exportation',NULL,NULL,1),(1264,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','701','1258','Ventes de produits finis',NULL,NULL,1),(1265,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7010','1264','Ventes en Belgique',NULL,NULL,1),(1266,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7011','1264','Ventes dans les pays membres de la C.E.E.',NULL,NULL,1),(1267,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7012','1264','Ventes à l\'exportation',NULL,NULL,1),(1268,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','702','1258','Ventes de déchets et rebuts',NULL,NULL,1),(1269,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7020','1268','Ventes en Belgique',NULL,NULL,1),(1270,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7021','1268','Ventes dans les pays membres de la C.E.E.',NULL,NULL,1),(1271,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7022','1268','Ventes à l\'exportation',NULL,NULL,1),(1272,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','703','1258','Ventes d\'emballages récupérables',NULL,NULL,1),(1273,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','704','1258','Facturations des travaux en cours (associations momentanées)',NULL,NULL,1),(1274,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','705','1258','Prestations de services',NULL,NULL,1),(1275,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7050','1274','Prestations de services en Belgique',NULL,NULL,1),(1276,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7051','1274','Prestations de services dans les pays membres de la C.E.E.',NULL,NULL,1),(1277,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7052','1274','Prestations de services en vue de l\'exportation',NULL,NULL,1),(1278,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','706','1258','Pénalités et dédits obtenus par l\'entreprise',NULL,NULL,1),(1279,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','708','1258','Remises, ristournes et rabais accordés',NULL,NULL,1),(1280,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7080','1279','Sur ventes de marchandises',NULL,NULL,1),(1281,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7081','1279','Sur ventes de produits finis',NULL,NULL,1),(1282,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7082','1279','Sur ventes de déchets et rebuts',NULL,NULL,1),(1283,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7083','1279','Sur prestations de services',NULL,NULL,1),(1284,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7084','1279','Mali sur travaux facturés aux associations momentanées',NULL,NULL,1),(1285,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','71','1357','Variation des stocks et des commandes en cours d\'exécution',NULL,NULL,1),(1286,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','712','1285','Des en cours de fabrication',NULL,NULL,1),(1287,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','713','1285','Des produits finis',NULL,NULL,1),(1288,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','715','1285','Des immeubles construits destinés à la vente',NULL,NULL,1),(1289,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','717','1285','Des commandes en cours d\'exécution',NULL,NULL,1),(1290,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7170','1289','Commandes en cours - Coût de revient',NULL,NULL,1),(1291,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','71700','1290','Coût des commandes en cours d\'exécution',NULL,NULL,1),(1292,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','71701','1290','Coût des travaux en cours des associations momentanées',NULL,NULL,1),(1293,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7171','1289','Bénéfices portés en compte sur commandes en cours',NULL,NULL,1),(1294,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','71710','1293','Sur commandes en cours d\'exécution',NULL,NULL,1),(1295,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','71711','1293','Sur travaux en cours des associations momentanées',NULL,NULL,1),(1296,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','72','1357','Production immobilisée',NULL,NULL,1),(1297,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','720','1296','En frais d\'établissement',NULL,NULL,1),(1298,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','721','1296','En immobilisations incorporelles',NULL,NULL,1),(1299,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','722','1296','En immobilisations corporelles',NULL,NULL,1),(1300,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','723','1296','En immobilisations en cours',NULL,NULL,1),(1301,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','74','1357','Autres produits d\'exploitation',NULL,NULL,1),(1302,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','740','1301','Subsides d\'exploitation et montants compensatoires',NULL,NULL,1),(1303,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','741','1301','Plus-values sur réalisations courantes d\'immobilisations corporelles',NULL,NULL,1),(1304,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','742','1301','Plus-values sur réalisations de créances commerciales',NULL,NULL,1),(1305,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','743','1301','à 749 Produits d\'exploitation divers',NULL,NULL,1),(1306,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','743','1301','Produits de services exploités dans l\'intérêt du personnel',NULL,NULL,1),(1307,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','744','1301','Commissions et courtages',NULL,NULL,1),(1308,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','745','1301','Redevances pour brevets et licences',NULL,NULL,1),(1309,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','746','1301','Prestations de services (transports, études, etc)',NULL,NULL,1),(1310,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','747','1301','Revenus des immeubles affectés aux activités non professionnelles',NULL,NULL,1),(1311,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','748','1301','Locations diverses à caractère professionnel',NULL,NULL,1),(1312,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','749','1301','Produits divers',NULL,NULL,1),(1313,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7490','1312','Bonis sur reprises d\'emballages consignés',NULL,NULL,1),(1314,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7491','1312','Bonis sur travaux en associations momentanées',NULL,NULL,1),(1315,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','75','1357','Produits financiers',NULL,NULL,1),(1316,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','750','1315','Produits des immobilisations financières',NULL,NULL,1),(1317,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7500','1316','Revenus des actions',NULL,NULL,1),(1318,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7501','1316','Revenus des obligations',NULL,NULL,1),(1319,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7502','1316','Revenus des créances à plus d\'un an',NULL,NULL,1),(1320,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','751','1315','Produits des actifs circulants',NULL,NULL,1),(1321,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','752','1315','Plus-values sur réalisations d\'actifs circulants',NULL,NULL,1),(1322,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','753','1315','Subsides en capital et en intérêts',NULL,NULL,1),(1323,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','754','1315','Différences de change',NULL,NULL,1),(1324,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','755','1315','Ecarts de conversion des devises',NULL,NULL,1),(1325,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','756','1315','à 759 Produits financiers divers',NULL,NULL,1),(1326,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','756','1315','Produits des autres créances',NULL,NULL,1),(1327,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','757','1315','Escomptes obtenus',NULL,NULL,1),(1328,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','76','1357','Produits exceptionnels',NULL,NULL,1),(1329,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','760','1328','Reprises d\'amortissements et de réductions de valeur',NULL,NULL,1),(1330,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7600','1329','Sur immobilisations incorporelles',NULL,NULL,1),(1331,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7601','1329','Sur immobilisations corporelles',NULL,NULL,1),(1332,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','761','1328','Reprises de réductions de valeur sur immobilisations financières',NULL,NULL,1),(1333,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','762','1328','Reprises de provisions pour risques et charges exceptionnelles',NULL,NULL,1),(1334,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','763','1328','Plus-values sur réalisation d\'actifs immobilisés',NULL,NULL,1),(1335,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7630','1334','Sur immobilisations incorporelles',NULL,NULL,1),(1336,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7631','1334','Sur immobilisations corporelles',NULL,NULL,1),(1337,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7632','1334','Sur immobilisations financières',NULL,NULL,1),(1338,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','764','1328','Autres produits exceptionnels',NULL,NULL,1),(1339,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','77','1357','Régularisations d\'impôts et reprises de provisions fiscales',NULL,NULL,1),(1340,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','771','1339','Impôts belges sur le résultat',NULL,NULL,1),(1341,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7710','1340','Régularisations d\'impôts dus ou versés',NULL,NULL,1),(1342,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7711','1340','Régularisations d\'impôts estimés',NULL,NULL,1),(1343,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7712','1340','Reprises de provisions fiscales',NULL,NULL,1),(1344,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','773','1339','Impôts étrangers sur le résultat',NULL,NULL,1),(1345,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','79','1357','Affectation aux résultats',NULL,NULL,1),(1346,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','790','1345','Bénéfice reporté de l\'exercice précédent',NULL,NULL,1),(1347,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','791','1345','Prélèvement sur le capital et les primes d\'émission',NULL,NULL,1),(1348,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','792','1345','Prélèvement sur les réserves',NULL,NULL,1),(1349,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','793','1345','Perte à reporter',NULL,NULL,1),(1350,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','794','1345','Intervention d\'associés (ou du propriétaire) dans la perte',NULL,NULL,1),(1351,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CAPIT','XXXXXX','1','','Fonds propres, provisions pour risques et charges et dettes à plus d\'un an',NULL,NULL,1),(1352,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','IMMO','XXXXXX','2','','Frais d\'établissement. Actifs immobilisés et créances à plus d\'un an',NULL,NULL,1),(1353,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','STOCK','XXXXXX','3','','Stock et commandes en cours d\'exécution',NULL,NULL,1),(1354,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','TIERS','XXXXXX','4','','Créances et dettes à un an au plus',NULL,NULL,1),(1355,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','FINAN','XXXXXX','5','','Placement de trésorerie et de valeurs disponibles',NULL,NULL,1),(1356,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','CHARGE','XXXXXX','6','','Charges',NULL,NULL,1),(1357,1,NULL,'0000-00-00 00:00:00','PCMN-BASE','PROD','XXXXXX','7','','Produits',NULL,NULL,1),(1401,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CAPIT','XXXXXX','1','','Fonds propres, provisions pour risques et charges et dettes à plus d\'un an',NULL,NULL,1),(1402,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','IMMO','XXXXXX','2','','Frais d\'établissement. Actifs immobilisés et créances à plus d\'un an',NULL,NULL,1),(1403,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','STOCK','XXXXXX','3','','Stock et commandes en cours d\'exécution',NULL,NULL,1),(1404,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','TIERS','XXXXXX','4','','Créances et dettes à un an au plus',NULL,NULL,1),(1405,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','FINAN','XXXXXX','5','','Placement de trésorerie et de valeurs disponibles',NULL,NULL,1),(1406,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','CHARGE','XXXXXX','6','','Charges',NULL,NULL,1),(1407,1,NULL,'0000-00-00 00:00:00','PCG99-ABREGE','PROD','XXXXXX','7','','Produits',NULL,NULL,1),(1501,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CAPIT','XXXXXX','1','','Fonds propres, provisions pour risques et charges et dettes à plus d\'un an',NULL,NULL,1),(1502,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','IMMO','XXXXXX','2','','Frais d\'établissement. Actifs immobilisés et créances à plus d\'un an',NULL,NULL,1),(1503,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','STOCK','XXXXXX','3','','Stock et commandes en cours d\'exécution',NULL,NULL,1),(1504,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','TIERS','XXXXXX','4','','Créances et dettes à un an au plus',NULL,NULL,1),(1505,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','FINAN','XXXXXX','5','','Placement de trésorerie et de valeurs disponibles',NULL,NULL,1),(1506,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','CHARGE','XXXXXX','6','','Charges',NULL,NULL,1),(1507,1,NULL,'0000-00-00 00:00:00','PCG99-BASE','PROD','XXXXXX','7','','Produits',NULL,NULL,1),(4001,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1','','Financiación básica',NULL,NULL,1),(4002,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','ACTIVO','XXXXXX','2','','Activo no corriente',NULL,NULL,1),(4003,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','EXISTENCIAS','XXXXXX','3','','Existencias',NULL,NULL,1),(4004,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4','','Acreedores y deudores por operaciones comerciales',NULL,NULL,1),(4005,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5','','Cuentas financieras',NULL,NULL,1),(4006,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6','','Compras y gastos',NULL,NULL,1),(4007,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7','','Ventas e ingresos',NULL,NULL,1),(4008,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','10','4001','CAPITAL',NULL,NULL,1),(4009,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','100','4008','Capital social',NULL,NULL,1),(4010,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','101','4008','Fondo social',NULL,NULL,1),(4011,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','CAPITAL','102','4008','Capital',NULL,NULL,1),(4012,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','103','4008','Socios por desembolsos no exigidos',NULL,NULL,1),(4013,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1030','4012','Socios por desembolsos no exigidos capital social',NULL,NULL,1),(4014,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1034','4012','Socios por desembolsos no exigidos capital pendiente de inscripción',NULL,NULL,1),(4015,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','104','4008','Socios por aportaciones no dineradas pendientes',NULL,NULL,1),(4016,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1040','4015','Socios por aportaciones no dineradas pendientes capital social',NULL,NULL,1),(4017,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1044','4015','Socios por aportaciones no dineradas pendientes capital pendiente de inscripción',NULL,NULL,1),(4018,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','108','4008','Acciones o participaciones propias en situaciones especiales',NULL,NULL,1),(4019,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','109','4008','Acciones o participaciones propias para reducción de capital',NULL,NULL,1),(4020,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','11','4001','Reservas y otros instrumentos de patrimonio',NULL,NULL,1),(4021,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','110','4020','Prima de emisión o asunción',NULL,NULL,1),(4022,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','111','4020','Otros instrumentos de patrimonio neto',NULL,NULL,1),(4023,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1110','4022','Patrimonio neto por emisión de instrumentos financieros compuestos',NULL,NULL,1),(4024,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1111','4022','Resto de instrumentos de patrimoio neto',NULL,NULL,1),(4025,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','112','4020','Reserva legal',NULL,NULL,1),(4026,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','113','4020','Reservas voluntarias',NULL,NULL,1),(4027,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','114','4020','Reservas especiales',NULL,NULL,1),(4028,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1140','4027','Reservas para acciones o participaciones de la sociedad dominante',NULL,NULL,1),(4029,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1141','4027','Reservas estatutarias',NULL,NULL,1),(4030,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1142','4027','Reservas por capital amortizado',NULL,NULL,1),(4031,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1143','4027','Reservas por fondo de comercio',NULL,NULL,1),(4032,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1144','4028','Reservas por acciones propias aceptadas en garantía',NULL,NULL,1),(4033,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','115','4020','Reservas por pérdidas y ganancias actuariales y otros ajustes',NULL,NULL,1),(4034,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','118','4020','Aportaciones de socios o propietarios',NULL,NULL,1),(4035,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','119','4020','Diferencias por ajuste del capital a euros',NULL,NULL,1),(4036,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','12','4001','Resultados pendientes de aplicación',NULL,NULL,1),(4037,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','120','4036','Remanente',NULL,NULL,1),(4038,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','121','4036','Resultados negativos de ejercicios anteriores',NULL,NULL,1),(4039,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','129','4036','Resultado del ejercicio',NULL,NULL,1),(4040,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','13','4001','Subvenciones, donaciones y ajustes por cambio de valor',NULL,NULL,1),(4041,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','130','4040','Subvenciones oficiales de capital',NULL,NULL,1),(4042,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','131','4040','Donaciones y legados de capital',NULL,NULL,1),(4043,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','132','4040','Otras subvenciones, donaciones y legados',NULL,NULL,1),(4044,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','133','4040','Ajustes por valoración en activos financieros disponibles para la venta',NULL,NULL,1),(4045,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','134','4040','Operaciones de cobertura',NULL,NULL,1),(4046,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1340','4045','Cobertura de flujos de efectivo',NULL,NULL,1),(4047,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1341','4045','Cobertura de una inversión neta en un negocio extranjero',NULL,NULL,1),(4048,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','135','4040','Diferencias de conversión',NULL,NULL,1),(4049,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','136','4040','Ajustes por valoración en activos no corrientes y grupos enajenables de elementos mantenidos para la venta',NULL,NULL,1),(4050,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','137','4040','Ingresos fiscales a distribuir en varios ejercicios',NULL,NULL,1),(4051,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1370','4050','Ingresos fiscales por diferencias permanentes a distribuir en varios ejercicios',NULL,NULL,1),(4052,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1371','4050','Ingresos fiscales por deducciones y bonificaciones a distribuir en varios ejercicios',NULL,NULL,1),(4053,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','14','4001','Provisiones',NULL,NULL,1),(4054,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','141','4053','Provisión para impuestos',NULL,NULL,1),(4055,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','142','4053','Provisión para otras responsabilidades',NULL,NULL,1),(4056,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','143','4053','Provisión por desmantelamiento, retiro o rehabilitación del inmovilizado',NULL,NULL,1),(4057,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','145','4053','Provisión para actuaciones medioambientales',NULL,NULL,1),(4058,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','15','4001','Deudas a largo plazo con características especiales',NULL,NULL,1),(4059,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','150','4058','Acciones o participaciones a largo plazo consideradas como pasivos financieros',NULL,NULL,1),(4060,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','153','4058','Desembolsos no exigidos por acciones o participaciones consideradas como pasivos financieros',NULL,NULL,1),(4061,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1533','4060','Desembolsos no exigidos empresas del grupo',NULL,NULL,1),(4062,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1534','4060','Desembolsos no exigidos empresas asociadas',NULL,NULL,1),(4063,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1535','4060','Desembolsos no exigidos otras partes vinculadas',NULL,NULL,1),(4064,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1536','4060','Otros desembolsos no exigidos',NULL,NULL,1),(4065,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','154','4058','Aportaciones no dinerarias pendientes por acciones o participaciones consideradas como pasivos financieros',NULL,NULL,1),(4066,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1543','4065','Aportaciones no dinerarias pendientes empresas del grupo',NULL,NULL,1),(4067,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1544','4065','Aportaciones no dinerarias pendientes empresas asociadas',NULL,NULL,1),(4068,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1545','4065','Aportaciones no dinerarias pendientes otras partes vinculadas',NULL,NULL,1),(4069,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1546','4065','Otras aportaciones no dinerarias pendientes',NULL,NULL,1),(4070,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','16','4001','Deudas a largo plazo con partes vinculadas',NULL,NULL,1),(4071,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','160','4070','Deudas a largo plazo con entidades de crédito vinculadas',NULL,NULL,1),(4072,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1603','4071','Deudas a largo plazo con entidades de crédito empresas del grupo',NULL,NULL,1),(4073,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1604','4071','Deudas a largo plazo con entidades de crédito empresas asociadas',NULL,NULL,1),(4074,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1605','4071','Deudas a largo plazo con otras entidades de crédito vinculadas',NULL,NULL,1),(4075,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','161','4070','Proveedores de inmovilizado a largo plazo partes vinculadas',NULL,NULL,1),(4076,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1613','4075','Proveedores de inmovilizado a largo plazo empresas del grupo',NULL,NULL,1),(4077,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1614','4075','Proveedores de inmovilizado a largo plazo empresas asociadas',NULL,NULL,1),(4078,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1615','4075','Proveedores de inmovilizado a largo plazo otras partes vinculadas',NULL,NULL,1),(4079,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','162','4070','Acreedores por arrendamiento financiero a largo plazo partes vinculadas',NULL,NULL,1),(4080,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1623','4079','Acreedores por arrendamiento financiero a largo plazo empresas del grupo',NULL,NULL,1),(4081,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1624','4080','Acreedores por arrendamiento financiero a largo plazo empresas asociadas',NULL,NULL,1),(4082,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1625','4080','Acreedores por arrendamiento financiero a largo plazo otras partes vinculadas',NULL,NULL,1),(4083,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','163','4070','Otras deudas a largo plazo con partes vinculadas',NULL,NULL,1),(4084,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1633','4083','Otras deudas a largo plazo empresas del grupo',NULL,NULL,1),(4085,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1634','4083','Otras deudas a largo plazo empresas asociadas',NULL,NULL,1),(4086,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1635','4083','Otras deudas a largo plazo otras partes vinculadas',NULL,NULL,1),(4087,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','17','4001','Deudas a largo plazo por préstamos recibidos empresitos y otros conceptos',NULL,NULL,1),(4088,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','170','4087','Deudas a largo plazo con entidades de crédito',NULL,NULL,1),(4089,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','171','4087','Deudas a largo plazo',NULL,NULL,1),(4090,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','172','4087','Deudas a largo plazo transformables en suvbenciones donaciones y legados',NULL,NULL,1),(4091,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','173','4087','Proveedores de inmovilizado a largo plazo',NULL,NULL,1),(4092,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','174','4087','Acreedores por arrendamiento financiero a largo plazo',NULL,NULL,1),(4093,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','175','4087','Efectos a pagar a largo plazo',NULL,NULL,1),(4094,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','176','4087','Pasivos por derivados financieros a largo plazo',NULL,NULL,1),(4095,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','177','4087','Obligaciones y bonos',NULL,NULL,1),(4096,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','179','4087','Deudas representadas en otros valores negociables',NULL,NULL,1),(4097,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','18','4001','Pasivos por fianzas garantias y otros conceptos a largo plazo',NULL,NULL,1),(4098,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','180','4097','Fianzas recibidas a largo plazo',NULL,NULL,1),(4099,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','181','4097','Anticipos recibidos por ventas o prestaciones de servicios a largo plazo',NULL,NULL,1),(4100,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','185','4097','Depositos recibidos a largo plazo',NULL,NULL,1),(4101,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','19','4001','Situaciones transitorias de financiación',NULL,NULL,1),(4102,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','190','4101','Acciones o participaciones emitidas',NULL,NULL,1),(4103,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','192','4101','Suscriptores de acciones',NULL,NULL,1),(4104,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','194','4101','Capital emitido pendiente de inscripción',NULL,NULL,1),(4105,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','195','4101','Acciones o participaciones emitidas consideradas como pasivos financieros',NULL,NULL,1),(4106,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','197','4101','Suscriptores de acciones consideradas como pasivos financieros',NULL,NULL,1),(4107,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','199','4101','Acciones o participaciones emitidas consideradas como pasivos financieros pendientes de inscripción',NULL,NULL,1),(4108,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','20','4002','Inmovilizaciones intangibles',NULL,NULL,1),(4109,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','200','4108','Investigación',NULL,NULL,1),(4110,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','201','4108','Desarrollo',NULL,NULL,1),(4111,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','202','4108','Concesiones administrativas',NULL,NULL,1),(4112,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','203','4108','Propiedad industrial',NULL,NULL,1),(4113,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','205','4108','Derechos de transpaso',NULL,NULL,1),(4114,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','206','4108','Aplicaciones informáticas',NULL,NULL,1),(4115,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','209','4108','Anticipos para inmovilizaciones intangibles',NULL,NULL,1),(4116,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','21','4002','Inmovilizaciones materiales',NULL,NULL,1),(4117,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','210','4116','Terrenos y bienes naturales',NULL,NULL,1),(4118,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','211','4116','Construcciones',NULL,NULL,1),(4119,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','212','4116','Instalaciones técnicas',NULL,NULL,1),(4120,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','213','4116','Maquinaria',NULL,NULL,1),(4121,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','214','4116','Utillaje',NULL,NULL,1),(4122,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','215','4116','Otras instalaciones',NULL,NULL,1),(4123,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','216','4116','Mobiliario',NULL,NULL,1),(4124,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','217','4116','Equipos para procesos de información',NULL,NULL,1),(4125,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','218','4116','Elementos de transporte',NULL,NULL,1),(4126,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','219','4116','Otro inmovilizado material',NULL,NULL,1),(4127,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','22','4002','Inversiones inmobiliarias',NULL,NULL,1),(4128,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','220','4127','Inversiones en terreons y bienes naturales',NULL,NULL,1),(4129,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','221','4127','Inversiones en construcciones',NULL,NULL,1),(4130,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','23','4002','Inmovilizaciones materiales en curso',NULL,NULL,1),(4131,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','230','4130','Adaptación de terrenos y bienes naturales',NULL,NULL,1),(4132,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','231','4130','Construcciones en curso',NULL,NULL,1),(4133,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','232','4130','Instalaciones técnicas en montaje',NULL,NULL,1),(4134,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','233','4130','Maquinaria en montaje',NULL,NULL,1),(4135,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','237','4130','Equipos para procesos de información en montaje',NULL,NULL,1),(4136,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','239','4130','Anticipos para inmovilizaciones materiales',NULL,NULL,1),(4137,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','24','4002','Inversiones financieras a largo plazo en partes vinculadas',NULL,NULL,1),(4138,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','240','4137','Participaciones a largo plazo en partes vinculadas',NULL,NULL,1),(4139,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2403','4138','Participaciones a largo plazo en empresas del grupo',NULL,NULL,1),(4140,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2404','4138','Participaciones a largo plazo en empresas asociadas',NULL,NULL,1),(4141,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2405','4138','Participaciones a largo plazo en otras partes vinculadas',NULL,NULL,1),(4142,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','241','4137','Valores representativos de deuda a largo plazo de partes vinculadas',NULL,NULL,1),(4143,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2413','4142','Valores representativos de deuda a largo plazo de empresas del grupo',NULL,NULL,1),(4144,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2414','4142','Valores representativos de deuda a largo plazo de empresas asociadas',NULL,NULL,1),(4145,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2415','4142','Valores representativos de deuda a largo plazo de otras partes vinculadas',NULL,NULL,1),(4146,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','242','4137','Créditos a largo plazo a partes vinculadas',NULL,NULL,1),(4147,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2423','4146','Créditos a largo plazo a empresas del grupo',NULL,NULL,1),(4148,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2424','4146','Créditos a largo plazo a empresas asociadas',NULL,NULL,1),(4149,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2425','4146','Créditos a largo plazo a otras partes vinculadas',NULL,NULL,1),(4150,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','249','4137','Desembolsos pendientes sobre participaciones a largo plazo en partes vinculadas',NULL,NULL,1),(4151,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2493','4150','Desembolsos pendientes sobre participaciones a largo plazo en empresas del grupo',NULL,NULL,1),(4152,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2494','4150','Desembolsos pendientes sobre participaciones a largo plazo en empresas asociadas',NULL,NULL,1),(4153,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2495','4150','Desembolsos pendientes sobre participaciones a largo plazo en otras partes vinculadas',NULL,NULL,1),(4154,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','25','4002','Otras inversiones financieras a largo plazo',NULL,NULL,1),(4155,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','250','4154','Inversiones financieras a largo plazo en instrumentos de patrimonio',NULL,NULL,1),(4156,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','251','4154','Valores representativos de deuda a largo plazo',NULL,NULL,1),(4157,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','252','4154','Créditos a largo plazo',NULL,NULL,1),(4158,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','253','4154','Créditos a largo plazo por enajenación de inmovilizado',NULL,NULL,1),(4159,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','254','4154','Créditos a largo plazo al personal',NULL,NULL,1),(4160,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','255','4154','Activos por derivados financieros a largo plazo',NULL,NULL,1),(4161,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','258','4154','Imposiciones a largo plazo',NULL,NULL,1),(4162,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','259','4154','Desembolsos pendientes sobre participaciones en el patrimonio neto a largo plazo',NULL,NULL,1),(4163,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','26','4002','Fianzas y depósitos constituidos a largo plazo',NULL,NULL,1),(4164,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','260','4163','Fianzas constituidas a largo plazo',NULL,NULL,1),(4165,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','261','4163','Depósitos constituidos a largo plazo',NULL,NULL,1),(4166,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','28','4002','Amortización acumulada del inmovilizado',NULL,NULL,1),(4167,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','280','4166','Amortización acumulado del inmovilizado intangible',NULL,NULL,1),(4168,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2800','4167','Amortización acumulada de investigación',NULL,NULL,1),(4169,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2801','4167','Amortización acumulada de desarrollo',NULL,NULL,1),(4170,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2802','4167','Amortización acumulada de concesiones administrativas',NULL,NULL,1),(4171,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2803','4167','Amortización acumulada de propiedad industrial',NULL,NULL,1),(4172,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2805','4167','Amortización acumulada de derechos de transpaso',NULL,NULL,1),(4173,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2806','4167','Amortización acumulada de aplicaciones informáticas',NULL,NULL,1),(4174,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','281','4166','Amortización acumulado del inmovilizado material',NULL,NULL,1),(4175,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2811','4174','Amortización acumulada de construcciones',NULL,NULL,1),(4176,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2812','4174','Amortización acumulada de instalaciones técnicas',NULL,NULL,1),(4177,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2813','4174','Amortización acumulada de maquinaria',NULL,NULL,1),(4178,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2814','4174','Amortización acumulada de utillaje',NULL,NULL,1),(4179,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2815','4174','Amortización acumulada de otras instalaciones',NULL,NULL,1),(4180,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2816','4174','Amortización acumulada de mobiliario',NULL,NULL,1),(4181,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2817','4174','Amortización acumulada de equipos para proceso de información',NULL,NULL,1),(4182,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2818','4174','Amortización acumulada de elementos de transporte',NULL,NULL,1),(4183,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2819','4175','Amortización acumulada de otro inmovilizado material',NULL,NULL,1),(4184,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','282','4166','Amortización acumulada de las inversiones inmobiliarias',NULL,NULL,1),(4185,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','29','4002','Deterioro de valor de activos no corrientes',NULL,NULL,1),(4186,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','290','4185','Deterioro de valor del inmovilizado intangible',NULL,NULL,1),(4187,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2900','4186','Deterioro de valor de investigación',NULL,NULL,1),(4188,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2901','4186','Deterioro de valor de desarrollo',NULL,NULL,1),(4189,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2902','4186','Deterioro de valor de concesiones administrativas',NULL,NULL,1),(4190,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2903','4186','Deterioro de valor de propiedad industrial',NULL,NULL,1),(4191,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2905','4186','Deterioro de valor de derechos de transpaso',NULL,NULL,1),(4192,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2906','4186','Deterioro de valor de aplicaciones informáticas',NULL,NULL,1),(4193,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','291','4185','Deterioro de valor del inmovilizado material',NULL,NULL,1),(4194,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2910','4193','Deterioro de valor de terrenos y bienes naturales',NULL,NULL,1),(4195,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2911','4193','Deterioro de valor de construcciones',NULL,NULL,1),(4196,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2912','4193','Deterioro de valor de instalaciones técnicas',NULL,NULL,1),(4197,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2913','4193','Deterioro de valor de maquinaria',NULL,NULL,1),(4198,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2914','4193','Deterioro de valor de utillajes',NULL,NULL,1),(4199,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2915','4194','Deterioro de valor de otras instalaciones',NULL,NULL,1),(4200,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2916','4194','Deterioro de valor de mobiliario',NULL,NULL,1),(4201,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2917','4194','Deterioro de valor de equipos para proceso de información',NULL,NULL,1),(4202,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2918','4194','Deterioro de valor de elementos de transporte',NULL,NULL,1),(4203,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2919','4194','Deterioro de valor de otro inmovilizado material',NULL,NULL,1),(4204,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','292','4185','Deterioro de valor de las inversiones inmobiliarias',NULL,NULL,1),(4205,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2920','4204','Deterioro de valor de terrenos y bienes naturales',NULL,NULL,1),(4206,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2921','4204','Deterioro de valor de construcciones',NULL,NULL,1),(4207,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','293','4185','Deterioro de valor de participaciones a largo plazo en partes vinculadas',NULL,NULL,1),(4208,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2933','4207','Deterioro de valor de participaciones a largo plazo en empresas del grupo',NULL,NULL,1),(4209,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2934','4207','Deterioro de valor de sobre participaciones a largo plazo en empresas asociadas',NULL,NULL,1),(4210,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2935','4207','Deterioro de valor de sobre participaciones a largo plazo en otras partes vinculadas',NULL,NULL,1),(4211,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','294','4185','Deterioro de valor de valores representativos de deuda a largo plazo en partes vinculadas',NULL,NULL,1),(4212,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2943','4211','Deterioro de valor de valores representativos de deuda a largo plazo en empresas del grupo',NULL,NULL,1),(4213,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2944','4211','Deterioro de valor de valores representativos de deuda a largo plazo en empresas asociadas',NULL,NULL,1),(4214,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2945','4211','Deterioro de valor de valores representativos de deuda a largo plazo en otras partes vinculadas',NULL,NULL,1),(4215,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','295','4185','Deterioro de valor de créditos a largo plazo a partes vinculadas',NULL,NULL,1),(4216,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2953','4215','Deterioro de valor de créditos a largo plazo a empresas del grupo',NULL,NULL,1),(4217,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2954','4215','Deterioro de valor de créditos a largo plazo a empresas asociadas',NULL,NULL,1),(4218,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2955','4215','Deterioro de valor de créditos a largo plazo a otras partes vinculadas',NULL,NULL,1),(4219,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','296','4185','Deterioro de valor de participaciones en el patrimonio netoa largo plazo',NULL,NULL,1),(4220,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','297','4185','Deterioro de valor de valores representativos de deuda a largo plazo',NULL,NULL,1),(4221,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','298','4185','Deterioro de valor de créditos a largo plazo',NULL,NULL,1),(4222,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','30','4003','Comerciales',NULL,NULL,1),(4223,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','300','4222','Mercaderías A',NULL,NULL,1),(4224,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','301','4222','Mercaderías B',NULL,NULL,1),(4225,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','31','4003','Materias primas',NULL,NULL,1),(4226,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','310','4225','Materias primas A',NULL,NULL,1),(4227,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','311','4225','Materias primas B',NULL,NULL,1),(4228,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','32','4003','Otros aprovisionamientos',NULL,NULL,1),(4229,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','320','4228','Elementos y conjuntos incorporables',NULL,NULL,1),(4230,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','321','4228','Combustibles',NULL,NULL,1),(4231,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','322','4228','Repuestos',NULL,NULL,1),(4232,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','325','4228','Materiales diversos',NULL,NULL,1),(4233,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','326','4228','Embalajes',NULL,NULL,1),(4234,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','327','4228','Envases',NULL,NULL,1),(4235,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','328','4229','Material de oficina',NULL,NULL,1),(4236,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','33','4003','Productos en curso',NULL,NULL,1),(4237,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','330','4236','Productos en curos A',NULL,NULL,1),(4238,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','331','4236','Productos en curso B',NULL,NULL,1),(4239,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','34','4003','Productos semiterminados',NULL,NULL,1),(4240,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','340','4239','Productos semiterminados A',NULL,NULL,1),(4241,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','341','4239','Productos semiterminados B',NULL,NULL,1),(4242,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','35','4003','Productos terminados',NULL,NULL,1),(4243,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','350','4242','Productos terminados A',NULL,NULL,1),(4244,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','351','4242','Productos terminados B',NULL,NULL,1),(4245,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','36','4003','Subproductos, residuos y materiales recuperados',NULL,NULL,1),(4246,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','360','4245','Subproductos A',NULL,NULL,1),(4247,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','361','4245','Subproductos B',NULL,NULL,1),(4248,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','365','4245','Residuos A',NULL,NULL,1),(4249,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','366','4245','Residuos B',NULL,NULL,1),(4250,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','368','4245','Materiales recuperados A',NULL,NULL,1),(4251,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','369','4245','Materiales recuperados B',NULL,NULL,1),(4252,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','39','4003','Deterioro de valor de las existencias',NULL,NULL,1),(4253,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','390','4252','Deterioro de valor de las mercaderías',NULL,NULL,1),(4254,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','391','4252','Deterioro de valor de las materias primas',NULL,NULL,1),(4255,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','392','4252','Deterioro de valor de otros aprovisionamientos',NULL,NULL,1),(4256,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','393','4252','Deterioro de valor de los productos en curso',NULL,NULL,1),(4257,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','394','4252','Deterioro de valor de los productos semiterminados',NULL,NULL,1),(4258,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','395','4252','Deterioro de valor de los productos terminados',NULL,NULL,1),(4259,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','396','4252','Deterioro de valor de los subproductos, residuos y materiales recuperados',NULL,NULL,1),(4260,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACREEDORES_DEUDORES','PROVEEDORES','40','4004','Proveedores',NULL,NULL,1),(4261,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACREEDORES_DEUDORES','PROVEEDORES','400','4260','Proveedores',NULL,NULL,1),(4262,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4000','4261','Proveedores euros',NULL,NULL,1),(4263,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4004','4261','Proveedores moneda extranjera',NULL,NULL,1),(4264,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4009','4261','Proveedores facturas pendientes de recibir o formalizar',NULL,NULL,1),(4265,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','401','4260','Proveedores efectos comerciales a pagar',NULL,NULL,1),(4266,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','403','4260','Proveedores empresas del grupo',NULL,NULL,1),(4267,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4030','4266','Proveedores empresas del grupo euros',NULL,NULL,1),(4268,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4031','4266','Efectos comerciales a pagar empresas del grupo',NULL,NULL,1),(4269,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4034','4266','Proveedores empresas del grupo moneda extranjera',NULL,NULL,1),(4270,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4036','4266','Envases y embalajes a devolver a proveedores empresas del grupo',NULL,NULL,1),(4271,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4039','4266','Proveedores empresas del grupo facturas pendientes de recibir o de formalizar',NULL,NULL,1),(4272,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','404','4260','Proveedores empresas asociadas',NULL,NULL,1),(4273,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','405','4260','Proveedores otras partes vinculadas',NULL,NULL,1),(4274,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','406','4260','Envases y embalajes a devolver a proveedores',NULL,NULL,1),(4275,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','407','4260','Anticipos a proveedores',NULL,NULL,1),(4276,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','41','4004','Acreedores varios',NULL,NULL,1),(4277,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','410','4276','Acreedores por prestaciones de servicios',NULL,NULL,1),(4278,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4100','4277','Acreedores por prestaciones de servicios euros',NULL,NULL,1),(4279,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4104','4277','Acreedores por prestaciones de servicios moneda extranjera',NULL,NULL,1),(4280,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4109','4277','Acreedores por prestaciones de servicios facturas pendientes de recibir o formalizar',NULL,NULL,1),(4281,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','411','4276','Acreedores efectos comerciales a pagar',NULL,NULL,1),(4282,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','419','4276','Acreedores por operaciones en común',NULL,NULL,1),(4283,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','CLIENTES','43','4004','Clientes',NULL,NULL,1),(4284,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','CLIENTES','430','4283','Clientes',NULL,NULL,1),(4285,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4300','4284','Clientes euros',NULL,NULL,1),(4286,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4304','4284','Clientes moneda extranjera',NULL,NULL,1),(4287,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4309','4284','Clientes facturas pendientes de formalizar',NULL,NULL,1),(4288,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','431','4283','Clientes efectos comerciales a cobrar',NULL,NULL,1),(4289,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4310','4288','Efectos comerciales en cartera',NULL,NULL,1),(4290,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4311','4288','Efectos comerciales descontados',NULL,NULL,1),(4291,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4312','4288','Efectos comerciales en gestión de cobro',NULL,NULL,1),(4292,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4315','4288','Efectos comerciales impagados',NULL,NULL,1),(4293,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','432','4283','Clientes operaciones de factoring',NULL,NULL,1),(4294,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','433','4283','Clientes empresas del grupo',NULL,NULL,1),(4295,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4330','4294','Clientes empresas del grupo euros',NULL,NULL,1),(4296,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4331','4294','Efectos comerciales a cobrar empresas del grupo',NULL,NULL,1),(4297,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4332','4294','Clientes empresas del grupo operaciones de factoring',NULL,NULL,1),(4298,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4334','4294','Clientes empresas del grupo moneda extranjera',NULL,NULL,1),(4299,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4336','4294','Clientes empresas del grupo dudoso cobro',NULL,NULL,1),(4300,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4337','4294','Envases y embalajes a devolver a clientes empresas del grupo',NULL,NULL,1),(4301,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4339','4294','Clientes empresas del grupo facturas pendientes de formalizar',NULL,NULL,1),(4302,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','434','4283','Clientes empresas asociadas',NULL,NULL,1),(4303,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','435','4283','Clientes otras partes vinculadas',NULL,NULL,1),(4304,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','436','4283','Clientes de dudoso cobro',NULL,NULL,1),(4305,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','437','4283','Envases y embalajes a devolver por clientes',NULL,NULL,1),(4306,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','438','4283','Anticipos de clientes',NULL,NULL,1),(4307,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','44','4004','Deudores varios',NULL,NULL,1),(4308,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','440','4307','Deudores',NULL,NULL,1),(4309,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4400','4308','Deudores euros',NULL,NULL,1),(4310,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4404','4308','Deudores moneda extranjera',NULL,NULL,1),(4311,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4409','4308','Deudores facturas pendientes de formalizar',NULL,NULL,1),(4312,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','441','4307','Deudores efectos comerciales a cobrar',NULL,NULL,1),(4313,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4410','4312','Deudores efectos comerciales en cartera',NULL,NULL,1),(4314,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4411','4312','Deudores efectos comerciales descontados',NULL,NULL,1),(4315,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4412','4312','Deudores efectos comerciales en gestión de cobro',NULL,NULL,1),(4316,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4415','4312','Deudores efectos comerciales impagados',NULL,NULL,1),(4317,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','446','4307','Deudores de dusoso cobro',NULL,NULL,1),(4318,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','449','4307','Deudores por operaciones en común',NULL,NULL,1),(4319,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','46','4004','Personal',NULL,NULL,1),(4320,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','460','4319','Anticipos de renumeraciones',NULL,NULL,1),(4321,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','465','4319','Renumeraciones pendientes de pago',NULL,NULL,1),(4322,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','47','4004','Administraciones Públicas',NULL,NULL,1),(4323,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','470','4322','Hacienda Pública deudora por diversos conceptos',NULL,NULL,1),(4324,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4700','4323','Hacienda Pública deudora por IVA',NULL,NULL,1),(4325,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4708','4323','Hacienda Pública deudora por subvenciones concedidas',NULL,NULL,1),(4326,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4709','4323','Hacienda Pública deudora por devolución de impuestos',NULL,NULL,1),(4327,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','471','4322','Organismos de la Seguridad Social deudores',NULL,NULL,1),(4328,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','472','4322','Hacienda Pública IVA soportado',NULL,NULL,1),(4329,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','473','4322','Hacienda Pública retenciones y pagos a cuenta',NULL,NULL,1),(4330,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','474','4322','Activos por impuesto diferido',NULL,NULL,1),(4331,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4740','4330','Activos por diferencias temporarias deducibles',NULL,NULL,1),(4332,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4742','4330','Derechos por deducciones y bonificaciones pendientes de aplicar',NULL,NULL,1),(4333,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4745','4330','Crédito por pérdidasa compensar del ejercicio',NULL,NULL,1),(4334,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','475','4322','Hacienda Pública acreedora por conceptos fiscales',NULL,NULL,1),(4335,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4750','4334','Hacienda Pública acreedora por IVA',NULL,NULL,1),(4336,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4751','4334','Hacienda Pública acreedora por retenciones practicadas',NULL,NULL,1),(4337,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4752','4334','Hacienda Pública acreedora por impuesto sobre sociedades',NULL,NULL,1),(4338,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4758','4334','Hacienda Pública acreedora por subvenciones a integrar',NULL,NULL,1),(4339,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','476','4322','Organismos de la Seguridad Social acreedores',NULL,NULL,1),(4340,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','477','4322','Hacienda Pública IVA repercutido',NULL,NULL,1),(4341,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','479','4322','Pasivos por diferencias temporarias imponibles',NULL,NULL,1),(4342,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','48','4004','Ajustes por periodificación',NULL,NULL,1),(4343,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','480','4342','Gastos anticipados',NULL,NULL,1),(4344,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','485','4342','Ingresos anticipados',NULL,NULL,1),(4345,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','49','4004','Deterioro de valor de créditos comerciales y provisiones a corto plazo',NULL,NULL,1),(4346,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','490','4345','Deterioro de valor de créditos por operaciones comerciales',NULL,NULL,1),(4347,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','493','4345','Deterioro de valor de créditos por operaciones comerciales con partes vinculadas',NULL,NULL,1),(4348,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4933','4347','Deterioro de valor de créditos por operaciones comerciales con empresas del grupo',NULL,NULL,1),(4349,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4934','4347','Deterioro de valor de créditos por operaciones comerciales con empresas asociadas',NULL,NULL,1),(4350,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4935','4347','Deterioro de valor de créditos por operaciones comerciales con otras partes vinculadas',NULL,NULL,1),(4351,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','499','4345','Provisiones por operaciones comerciales',NULL,NULL,1),(4352,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4994','4351','Provisión para contratos anerosos',NULL,NULL,1),(4353,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4999','4351','Provisión para otras operaciones comerciales',NULL,NULL,1),(4354,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','50','4005','Emprésitos deudas con características especiales y otras emisiones análogas a corto plazo',NULL,NULL,1),(4355,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','500','4354','Obligaciones y bonos a corto plazo',NULL,NULL,1),(4356,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','502','4354','Acciones o participaciones a corto plazo consideradas como pasivos financieros',NULL,NULL,1),(4357,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','505','4354','Deudas representadas en otros valores negociables a corto plazo',NULL,NULL,1),(4358,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','506','4354','Intereses a corto plazo de emprésitos y otras emisiones analógicas',NULL,NULL,1),(4359,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','507','4354','Dividendos de acciones o participaciones consideradas como pasivos financieros',NULL,NULL,1),(4360,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','509','4354','Valores negociables amortizados',NULL,NULL,1),(4361,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5090','4360','Obligaciones y bonos amortizados',NULL,NULL,1),(4362,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5095','4360','Otros valores negociables amortizados',NULL,NULL,1),(4363,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','51','4005','Deudas a corto plazo con partes vinculadas',NULL,NULL,1),(4364,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','510','4363','Deudas a corto plazo con entidades de crédito vinculadas',NULL,NULL,1),(4365,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5103','4364','Deudas a corto plazo con entidades de crédito empresas del grupo',NULL,NULL,1),(4366,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5104','4364','Deudas a corto plazo con entidades de crédito empresas asociadas',NULL,NULL,1),(4367,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5105','4364','Deudas a corto plazo con otras entidades de crédito vinculadas',NULL,NULL,1),(4368,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','511','4363','Proveedores de inmovilizado a corto plazo partes vinculadas',NULL,NULL,1),(4369,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5113','4368','Proveedores de inmovilizado a corto plazo empresas del grupo',NULL,NULL,1),(4370,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5114','4368','Proveedores de inmovilizado a corto plazo empresas asociadas',NULL,NULL,1),(4371,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5115','4368','Proveedores de inmovilizado a corto plazo otras partes vinculadas',NULL,NULL,1),(4372,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','512','4363','Acreedores por arrendamiento financiero a corto plazo partes vinculadas',NULL,NULL,1),(4373,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5123','4372','Acreedores por arrendamiento financiero a corto plazo empresas del grupo',NULL,NULL,1),(4374,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5124','4372','Acreedores por arrendamiento financiero a corto plazo empresas asociadas',NULL,NULL,1),(4375,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5125','4372','Acreedores por arrendamiento financiero a corto plazo otras partes vinculadas',NULL,NULL,1),(4376,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','513','4363','Otras deudas a corto plazo con partes vinculadas',NULL,NULL,1),(4377,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5133','4376','Otras deudas a corto plazo con empresas del grupo',NULL,NULL,1),(4378,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5134','4376','Otras deudas a corto plazo con empresas asociadas',NULL,NULL,1),(4379,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5135','4376','Otras deudas a corto plazo con partes vinculadas',NULL,NULL,1),(4380,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','514','4363','Intereses a corto plazo con partes vinculadas',NULL,NULL,1),(4381,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5143','4380','Intereses a corto plazo empresas del grupo',NULL,NULL,1),(4382,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5144','4380','Intereses a corto plazo empresas asociadas',NULL,NULL,1),(4383,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5145','4380','Intereses deudas a corto plazo partes vinculadas',NULL,NULL,1),(4384,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','52','4005','Deudas a corto plazo por préstamos recibidos y otros conceptos',NULL,NULL,1),(4385,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','520','4384','Deudas a corto plazo con entidades de crédito',NULL,NULL,1),(4386,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5200','4385','Préstamos a corto plazo de entidades de crédito',NULL,NULL,1),(4387,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5201','4385','Deudas a corto plazo por crédito dispuesto',NULL,NULL,1),(4388,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5208','4385','Deudas por efectos descontados',NULL,NULL,1),(4389,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5209','4385','Deudas por operaciones de factoring',NULL,NULL,1),(4390,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','521','4384','Deudas a corto plazo',NULL,NULL,1),(4391,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','522','4384','Deudas a corto plazo transformables en subvenciones donaciones y legados',NULL,NULL,1),(4392,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','523','4384','Proveedores de inmovilizado a corto plazo',NULL,NULL,1),(4393,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','526','4384','Dividendo activo a pagar',NULL,NULL,1),(4394,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','527','4384','Intereses a corto plazo de deudas con entidades de crédito',NULL,NULL,1),(4395,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','528','4384','Intereses a corto plazo de deudas',NULL,NULL,1),(4396,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','529','4384','Provisiones a corto plazo',NULL,NULL,1),(4397,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5291','4396','Provisión a corto plazo para impuestos',NULL,NULL,1),(4398,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5292','4396','Provisión a corto plazo para otras responsabilidades',NULL,NULL,1),(4399,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5293','4396','Provisión a corto plazo por desmantelamiento retiro o rehabilitación del inmovilizado',NULL,NULL,1),(4400,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5295','4396','Provisión a corto plazo para actuaciones medioambientales',NULL,NULL,1),(4401,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','53','4005','Inversiones financieras a corto plazo en partes vinculadas',NULL,NULL,1),(4402,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','530','4401','Participaciones a corto plazo en partes vinculadas',NULL,NULL,1),(4403,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5303','4402','Participaciones a corto plazo en empresas del grupo',NULL,NULL,1),(4404,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5304','4402','Participaciones a corto plazo en empresas asociadas',NULL,NULL,1),(4405,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5305','4402','Participaciones a corto plazo en otras partes vinculadas',NULL,NULL,1),(4406,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','531','4401','Valores representativos de deuda a corto plazo de partes vinculadas',NULL,NULL,1),(4407,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5313','4406','Valores representativos de deuda a corto plazo de empresas del grupo',NULL,NULL,1),(4408,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5314','4406','Valores representativos de deuda a corto plazo de empresas asociadas',NULL,NULL,1),(4409,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5315','4406','Valores representativos de deuda a corto plazo de otras partes vinculadas',NULL,NULL,1),(4410,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','532','4401','Créditos a corto plazo a partes vinculadas',NULL,NULL,1),(4411,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5323','4410','Créditos a corto plazo a empresas del grupo',NULL,NULL,1),(4412,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5324','4410','Créditos a corto plazo a empresas asociadas',NULL,NULL,1),(4413,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5325','4410','Créditos a corto plazo a otras partes vinculadas',NULL,NULL,1),(4414,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','533','4401','Intereses a corto plazo de valores representativos de deuda de partes vinculadas',NULL,NULL,1),(4415,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5333','4414','Intereses a corto plazo de valores representativos de deuda en empresas del grupo',NULL,NULL,1),(4416,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5334','4414','Intereses a corto plazo de valores representativos de deuda en empresas asociadas',NULL,NULL,1),(4417,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5335','4414','Intereses a corto plazo de valores representativos de deuda en otras partes vinculadas',NULL,NULL,1),(4418,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','534','4401','Intereses a corto plazo de créditos a partes vinculadas',NULL,NULL,1),(4419,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5343','4418','Intereses a corto plazo de créditos a empresas del grupo',NULL,NULL,1),(4420,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5344','4418','Intereses a corto plazo de créditos a empresas asociadas',NULL,NULL,1),(4421,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5345','4418','Intereses a corto plazo de créditos a otras partes vinculadas',NULL,NULL,1),(4422,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','535','4401','Dividendo a cobrar de inversiones financieras en partes vinculadas',NULL,NULL,1),(4423,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5353','4422','Dividendo a cobrar de empresas del grupo',NULL,NULL,1),(4424,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5354','4422','Dividendo a cobrar de empresas asociadas',NULL,NULL,1),(4425,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5355','4422','Dividendo a cobrar de otras partes vinculadas',NULL,NULL,1),(4426,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','539','4401','Desembolsos pendientes sobre participaciones a corto plazo en partes vinculadas',NULL,NULL,1),(4427,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5393','4426','Desembolsos pendientes sobre participaciones a corto plazo en empresas del grupo',NULL,NULL,1),(4428,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5394','4426','Desembolsos pendientes sobre participaciones a corto plazo en empresas asociadas',NULL,NULL,1),(4429,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5395','4426','Desembolsos pendientes sobre participaciones a corto plazo en otras partes vinculadas',NULL,NULL,1),(4430,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','54','4005','Otras inversiones financieras a corto plazo',NULL,NULL,1),(4431,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','540','4430','Inversiones financieras a corto plazo en instrumentos de patrimonio',NULL,NULL,1),(4432,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','541','4430','Valores representativos de deuda a corto plazo',NULL,NULL,1),(4433,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','542','4430','Créditos a corto plazo',NULL,NULL,1),(4434,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','543','4430','Créditos a corto plazo por enejenación de inmovilizado',NULL,NULL,1),(4435,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','544','4430','Créditos a corto plazo al personal',NULL,NULL,1),(4436,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','545','4430','Dividendo a cobrar',NULL,NULL,1),(4437,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','546','4430','Intereses a corto plazo de valores reprsentativos de deuda',NULL,NULL,1),(4438,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','547','4430','Intereses a corto plazo de créditos',NULL,NULL,1),(4439,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','548','4430','Imposiciones a corto plazo',NULL,NULL,1),(4440,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','549','4430','Desembolsos pendientes sobre participaciones en el patrimonio neto a corto plazo',NULL,NULL,1),(4441,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','55','4005','Otras cuentas no bancarias',NULL,NULL,1),(4442,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','550','4441','Titular de la explotación',NULL,NULL,1),(4443,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','551','4441','Cuenta corriente con socios y administradores',NULL,NULL,1),(4444,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','552','4441','Cuenta corriente otras personas y entidades vinculadas',NULL,NULL,1),(4445,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5523','4444','Cuenta corriente con empresas del grupo',NULL,NULL,1),(4446,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5524','4444','Cuenta corriente con empresas asociadas',NULL,NULL,1),(4447,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5525','4444','Cuenta corriente con otras partes vinculadas',NULL,NULL,1),(4448,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','554','4441','Cuenta corriente con uniones temporales de empresas y comunidades de bienes',NULL,NULL,1),(4449,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','555','4441','Partidas pendientes de aplicación',NULL,NULL,1),(4450,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','556','4441','Desembolsos exigidos sobre participaciones en el patrimonio neto',NULL,NULL,1),(4451,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5563','4450','Desembolsos exigidos sobre participaciones empresas del grupo',NULL,NULL,1),(4452,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5564','4450','Desembolsos exigidos sobre participaciones empresas asociadas',NULL,NULL,1),(4453,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5565','4450','Desembolsos exigidos sobre participaciones otras partes vinculadas',NULL,NULL,1),(4454,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5566','4450','Desembolsos exigidos sobre participaciones otras empresas',NULL,NULL,1),(4455,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','557','4441','Dividendo activo a cuenta',NULL,NULL,1),(4456,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','558','4441','Socios por desembolsos exigidos',NULL,NULL,1),(4457,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5580','4456','Socios por desembolsos exigidos sobre acciones o participaciones ordinarias',NULL,NULL,1),(4458,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5585','4456','Socios por desembolsos exigidos sobre acciones o participaciones consideradas como pasivos financieros',NULL,NULL,1),(4459,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','559','4441','Derivados financieros a corto plazo',NULL,NULL,1),(4460,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5590','4459','Activos por derivados financieros a corto plazo',NULL,NULL,1),(4461,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5595','4459','Pasivos por derivados financieros a corto plazo',NULL,NULL,1),(4462,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','56','4005','Finanzas y depósitos recibidos y constituidos a corto plazo y ajustes por periodificación',NULL,NULL,1),(4463,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','560','4462','Finanzas recibidas a corto plazo',NULL,NULL,1),(4464,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','561','4462','Depósitos recibidos a corto plazo',NULL,NULL,1),(4465,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','565','4462','Finanzas constituidas a corto plazo',NULL,NULL,1),(4466,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','566','4462','Depósitos constituidos a corto plazo',NULL,NULL,1),(4467,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','567','4462','Intereses pagados por anticipado',NULL,NULL,1),(4468,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','568','4462','Intereses cobrados a corto plazo',NULL,NULL,1),(4469,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','57','4005','Tesorería',NULL,NULL,1),(4470,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','CAJA','570','4469','Caja euros',NULL,NULL,1),(4471,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','571','4469','Caja moneda extranjera',NULL,NULL,1),(4472,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','BANCOS','572','4469','Bancos e instituciones de crédito cc vista euros',NULL,NULL,1),(4473,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','573','4469','Bancos e instituciones de crédito cc vista moneda extranjera',NULL,NULL,1),(4474,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','574','4469','Bancos e instituciones de crédito cuentas de ahorro euros',NULL,NULL,1),(4475,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','575','4469','Bancos e instituciones de crédito cuentas de ahorro moneda extranjera',NULL,NULL,1),(4476,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','576','4469','Inversiones a corto plazo de gran liquidez',NULL,NULL,1),(4477,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','59','4005','Deterioro del valor de las inversiones financieras a corto plazo',NULL,NULL,1),(4478,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','593','4477','Deterioro del valor de participaciones a corto plazo en partes vinculadas',NULL,NULL,1),(4479,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5933','4478','Deterioro del valor de participaciones a corto plazo en empresas del grupo',NULL,NULL,1),(4480,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5934','4478','Deterioro del valor de participaciones a corto plazo en empresas asociadas',NULL,NULL,1),(4481,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5935','4478','Deterioro del valor de participaciones a corto plazo en otras partes vinculadas',NULL,NULL,1),(4482,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','594','4477','Deterioro del valor de valores representativos de deuda a corto plazo en partes vinculadas',NULL,NULL,1),(4483,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5943','4482','Deterioro del valor de valores representativos de deuda a corto plazo en empresas del grupo',NULL,NULL,1),(4484,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5944','4482','Deterioro del valor de valores representativos de deuda a corto plazo en empresas asociadas',NULL,NULL,1),(4485,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5945','4482','Deterioro del valor de valores representativos de deuda a corto plazo en otras partes vinculadas',NULL,NULL,1),(4486,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','595','4477','Deterioro del valor de créditos a corto plazo en partes vinculadas',NULL,NULL,1),(4487,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5953','4486','Deterioro del valor de créditos a corto plazo en empresas del grupo',NULL,NULL,1),(4488,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5954','4486','Deterioro del valor de créditos a corto plazo en empresas asociadas',NULL,NULL,1),(4489,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5955','4486','Deterioro del valor de créditos a corto plazo en otras partes vinculadas',NULL,NULL,1),(4490,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','596','4477','Deterioro del valor de participaciones a corto plazo',NULL,NULL,1),(4491,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','597','4477','Deterioro del valor de valores representativos de deuda a corto plazo',NULL,NULL,1),(4492,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','598','4477','Deterioro de valor de créditos a corto plazo',NULL,NULL,1),(4493,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','60','4006','Compras',NULL,NULL,1),(4494,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','COMPRAS','600','4493','Compras de mercaderías',NULL,NULL,1),(4495,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','COMPRAS','601','4493','Compras de materias primas',NULL,NULL,1),(4496,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','602','4493','Compras de otros aprovisionamientos',NULL,NULL,1),(4497,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','606','4493','Descuentos sobre compras por pronto pago',NULL,NULL,1),(4498,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6060','4497','Descuentos sobre compras por pronto pago de mercaderías',NULL,NULL,1),(4499,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6061','4497','Descuentos sobre compras por pronto pago de materias primas',NULL,NULL,1),(4500,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6062','4497','Descuentos sobre compras por pronto pago de otros aprovisionamientos',NULL,NULL,1),(4501,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','COMPRAS','607','4493','Trabajos realizados por otras empresas',NULL,NULL,1),(4502,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','608','4493','Devoluciones de compras y operaciones similares',NULL,NULL,1),(4503,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6080','4502','Devoluciones de compras de mercaderías',NULL,NULL,1),(4504,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6081','4502','Devoluciones de compras de materias primas',NULL,NULL,1),(4505,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6082','4502','Devoluciones de compras de otros aprovisionamientos',NULL,NULL,1),(4506,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','609','4493','Rappels por compras',NULL,NULL,1),(4507,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6090','4506','Rappels por compras de mercaderías',NULL,NULL,1),(4508,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6091','4506','Rappels por compras de materias primas',NULL,NULL,1),(4509,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6092','4506','Rappels por compras de otros aprovisionamientos',NULL,NULL,1),(4510,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','61','4006','Variación de existencias',NULL,NULL,1),(4511,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','610','4510','Variación de existencias de mercaderías',NULL,NULL,1),(4512,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','611','4510','Variación de existencias de materias primas',NULL,NULL,1),(4513,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','612','4510','Variación de existencias de otros aprovisionamientos',NULL,NULL,1),(4514,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','62','4006','Servicios exteriores',NULL,NULL,1),(4515,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','620','4514','Gastos en investigación y desarrollo del ejercicio',NULL,NULL,1),(4516,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','621','4514','Arrendamientos y cánones',NULL,NULL,1),(4517,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','622','4514','Reparaciones y conservación',NULL,NULL,1),(4518,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','623','4514','Servicios profesionales independientes',NULL,NULL,1),(4519,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','624','4514','Transportes',NULL,NULL,1),(4520,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','625','4514','Primas de seguros',NULL,NULL,1),(4521,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','626','4514','Servicios bancarios y similares',NULL,NULL,1),(4522,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','627','4514','Publicidad, propaganda y relaciones públicas',NULL,NULL,1),(4523,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','628','4514','Suministros',NULL,NULL,1),(4524,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','629','4514','Otros servicios',NULL,NULL,1),(4525,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','63','4006','Tributos',NULL,NULL,1),(4526,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','630','4525','Impuesto sobre benecifios',NULL,NULL,1),(4527,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6300','4526','Impuesto corriente',NULL,NULL,1),(4528,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6301','4526','Impuesto diferido',NULL,NULL,1),(4529,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','631','4525','Otros tributos',NULL,NULL,1),(4530,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','633','4525','Ajustes negativos en la imposición sobre beneficios',NULL,NULL,1),(4531,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','634','4525','Ajustes negativos en la imposición indirecta',NULL,NULL,1),(4532,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6341','4531','Ajustes negativos en IVA de activo corriente',NULL,NULL,1),(4533,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6342','4531','Ajustes negativos en IVA de inversiones',NULL,NULL,1),(4534,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','636','4525','Devolución de impuestos',NULL,NULL,1),(4535,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','638','4525','Ajustes positivos en la imposición sobre beneficios',NULL,NULL,1),(4536,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','639','4525','Ajustes positivos en la imposición directa',NULL,NULL,1),(4537,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6391','4536','Ajustes positivos en IVA de activo corriente',NULL,NULL,1),(4538,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6392','4536','Ajustes positivos en IVA de inversiones',NULL,NULL,1),(4539,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','64','4006','Gastos de personal',NULL,NULL,1),(4540,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','640','4539','Sueldos y salarios',NULL,NULL,1),(4541,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','641','4539','Indemnizaciones',NULL,NULL,1),(4542,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','642','4539','Seguridad social a cargo de la empresa',NULL,NULL,1),(4543,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','649','4539','Otros gastos sociales',NULL,NULL,1),(4544,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','65','4006','Otros gastos de gestión',NULL,NULL,1),(4545,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','650','4544','Pérdidas de créditos comerciales incobrables',NULL,NULL,1),(4546,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','651','4544','Resultados de operaciones en común',NULL,NULL,1),(4547,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6510','4546','Beneficio transferido gestor',NULL,NULL,1),(4548,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6511','4546','Pérdida soportada participe o asociado no gestor',NULL,NULL,1),(4549,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','659','4544','Otras pérdidas en gestión corriente',NULL,NULL,1),(4550,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','66','4006','Gastos financieros',NULL,NULL,1),(4551,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','660','4550','Gastos financieros por actualización de provisiones',NULL,NULL,1),(4552,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','661','4550','Intereses de obligaciones y bonos',NULL,NULL,1),(4553,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6610','4452','Intereses de obligaciones y bonos a largo plazo empresas del grupo',NULL,NULL,1),(4554,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6611','4452','Intereses de obligaciones y bonos a largo plazo empresas asociadas',NULL,NULL,1),(4555,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6612','4452','Intereses de obligaciones y bonos a largo plazo otras partes vinculadas',NULL,NULL,1),(4556,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6613','4452','Intereses de obligaciones y bonos a largo plazo otras empresas',NULL,NULL,1),(4557,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6615','4452','Intereses de obligaciones y bonos a corto plazo empresas del grupo',NULL,NULL,1),(4558,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6616','4452','Intereses de obligaciones y bonos a corto plazo empresas asociadas',NULL,NULL,1),(4559,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6617','4452','Intereses de obligaciones y bonos a corto plazo otras partes vinculadas',NULL,NULL,1),(4560,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6618','4452','Intereses de obligaciones y bonos a corto plazo otras empresas',NULL,NULL,1),(4561,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','662','4550','Intereses de deudas',NULL,NULL,1),(4562,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6620','4561','Intereses de deudas empresas del grupo',NULL,NULL,1),(4563,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6621','4561','Intereses de deudas empresas asociadas',NULL,NULL,1),(4564,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6622','4561','Intereses de deudas otras partes vinculadas',NULL,NULL,1),(4565,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6623','4561','Intereses de deudas con entidades de crédito',NULL,NULL,1),(4566,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6624','4561','Intereses de deudas otras empresas',NULL,NULL,1),(4567,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','663','4550','Pérdidas por valorización de activos y pasivos financieros por su valor razonable',NULL,NULL,1),(4568,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','664','4550','Gastos por dividendos de acciones o participaciones consideradas como pasivos financieros',NULL,NULL,1),(4569,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6640','4568','Dividendos de pasivos empresas del grupo',NULL,NULL,1),(4570,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6641','4568','Dividendos de pasivos empresas asociadas',NULL,NULL,1),(4571,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6642','4568','Dividendos de pasivos otras partes vinculadas',NULL,NULL,1),(4572,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6643','4568','Dividendos de pasivos otras empresas',NULL,NULL,1),(4573,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','665','4550','Intereses por descuento de efectos y operaciones de factoring',NULL,NULL,1),(4574,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6650','4573','Intereses por descuento de efectos en entidades de crédito del grupo',NULL,NULL,1),(4575,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6651','4573','Intereses por descuento de efectos en entidades de crédito asociadas',NULL,NULL,1),(4576,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6652','4573','Intereses por descuento de efectos en entidades de crédito vinculadas',NULL,NULL,1),(4577,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6653','4573','Intereses por descuento de efectos en otras entidades de crédito',NULL,NULL,1),(4578,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6654','4573','Intereses por operaciones de factoring con entidades de crédito del grupo',NULL,NULL,1),(4579,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6655','4573','Intereses por operaciones de factoring con entidades de crédito asociadas',NULL,NULL,1),(4580,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6656','4573','Intereses por operaciones de factoring con otras entidades de crédito vinculadas',NULL,NULL,1),(4581,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6657','4573','Intereses por operaciones de factoring con otras entidades de crédito',NULL,NULL,1),(4582,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','666','4550','Pérdidas en participaciones y valores representativos de deuda',NULL,NULL,1),(4583,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6660','4582','Pérdidas en valores representativos de deuda a largo plazo empresas del grupo',NULL,NULL,1),(4584,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6661','4582','Pérdidas en valores representativos de deuda a largo plazo empresas asociadas',NULL,NULL,1),(4585,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6662','4582','Pérdidas en valores representativos de deuda a largo plazo otras partes vinculadas',NULL,NULL,1),(4586,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6663','4582','Pérdidas en participaciones y valores representativos de deuda a largo plazo otras empresas',NULL,NULL,1),(4587,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6665','4582','Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas del grupo',NULL,NULL,1),(4588,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6666','4582','Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas asociadas',NULL,NULL,1),(4589,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6667','4582','Pérdidas en valores representativos de deuda a corto plazo otras partes vinculadas',NULL,NULL,1),(4590,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6668','4582','Pérdidas en valores representativos de deuda a corto plazo otras empresas',NULL,NULL,1),(4591,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','667','4550','Pérdidas de créditos no comerciales',NULL,NULL,1),(4592,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6670','4591','Pérdidas de créditos a largo plazo empresas del grupo',NULL,NULL,1),(4593,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6671','4591','Pérdidas de créditos a largo plazo empresas asociadas',NULL,NULL,1),(4594,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6672','4591','Pérdidas de créditos a largo plazo otras partes vinculadas',NULL,NULL,1),(4595,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6673','4591','Pérdidas de créditos a largo plazo otras empresas',NULL,NULL,1),(4596,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6675','4591','Pérdidas de créditos a corto plazo empresas del grupo',NULL,NULL,1),(4597,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6676','4591','Pérdidas de créditos a corto plazo empresas asociadas',NULL,NULL,1),(4598,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6677','4591','Pérdidas de créditos a corto plazo otras partes vinculadas',NULL,NULL,1),(4599,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6678','4591','Pérdidas de créditos a corto plazo otras empresas',NULL,NULL,1),(4600,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','668','4550','Diferencias negativas de cambio',NULL,NULL,1),(4601,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','669','4550','Otros gastos financieros',NULL,NULL,1),(4602,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','67','4006','Pérdidas procedentes de activos no corrientes y gastos excepcionales',NULL,NULL,1),(4603,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','670','4602','Pérdidas procedentes del inmovilizado intangible',NULL,NULL,1),(4604,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','671','4602','Pérdidas procedentes del inmovilizado material',NULL,NULL,1),(4605,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','672','4602','Pérdidas procedentes de las inversiones inmobiliarias',NULL,NULL,1),(4607,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','673','4602','Pérdidas procedentes de participaciones a largo plazo en partes vinculadas',NULL,NULL,1),(4608,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6733','4607','Pérdidas procedentes de participaciones a largo plazo empresas del grupo',NULL,NULL,1),(4609,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6734','4607','Pérdidas procedentes de participaciones a largo plazo empresas asociadas',NULL,NULL,1),(4610,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6735','4607','Pérdidas procedentes de participaciones a largo plazo otras partes vinculadas',NULL,NULL,1),(4611,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','675','4602','Pérdidas por operaciones con obligaciones propias',NULL,NULL,1),(4612,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','678','4602','Gastos excepcionales',NULL,NULL,1),(4613,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','68','4006','Dotaciones para amortizaciones',NULL,NULL,1),(4614,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','680','4613','Amortización del inmovilizado intangible',NULL,NULL,1),(4615,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','681','4613','Amortización del inmovilizado material',NULL,NULL,1),(4616,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','682','4613','Amortización de las inversiones inmobiliarias',NULL,NULL,1),(4617,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','69','4006','Pérdidas por deterioro y otras dotaciones',NULL,NULL,1),(4618,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','690','4617','Pérdidas por deterioro del inmovilizado intangible',NULL,NULL,1),(4619,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','691','4617','Pérdidas por deterioro del inmovilizado material',NULL,NULL,1),(4620,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','692','4617','Pérdidas por deterioro de las inversiones inmobiliarias',NULL,NULL,1),(4621,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','693','4617','Pérdidas por deterioro de existencias',NULL,NULL,1),(4622,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6930','4621','Pérdidas por deterioro de productos terminados y en curso de fabricación',NULL,NULL,1),(4623,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6931','4621','Pérdidas por deterioro de mercaderías',NULL,NULL,1),(4624,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6932','4621','Pérdidas por deterioro de materias primas',NULL,NULL,1),(4625,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6933','4621','Pérdidas por deterioro de otros aprovisionamientos',NULL,NULL,1),(4626,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','694','4617','Pérdidas por deterioro de créditos por operaciones comerciales',NULL,NULL,1),(4627,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','695','4617','Dotación a la provisión por operaciones comerciales',NULL,NULL,1),(4628,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6954','4627','Dotación a la provisión por contratos onerosos',NULL,NULL,1),(4629,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6959','4628','Dotación a la provisión para otras operaciones comerciales',NULL,NULL,1),(4630,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','696','4617','Pérdidas por deterioro de participaciones y valores representativos de deuda a largo plazo',NULL,NULL,1),(4631,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6960','4630','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo',NULL,NULL,1),(4632,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6961','4630','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas',NULL,NULL,1),(4633,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6962','4630','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas',NULL,NULL,1),(4634,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6963','4630','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas',NULL,NULL,1),(4635,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6965','4630','Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas del grupo',NULL,NULL,1),(4636,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6966','4630','Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas asociadas',NULL,NULL,1),(4637,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6967','4630','Pérdidas por deterioro en valores representativos de deuda a largo plazo otras partes vinculadas',NULL,NULL,1),(4638,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6968','4630','Pérdidas por deterioro en valores representativos de deuda a largo plazo otras empresas',NULL,NULL,1),(4639,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','697','4617','Pérdidas por deterioro de créditos a largo plazo',NULL,NULL,1),(4640,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6970','4639','Pérdidas por deterioro de créditos a largo plazo empresas del grupo',NULL,NULL,1),(4641,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6971','4639','Pérdidas por deterioro de créditos a largo plazo empresas asociadas',NULL,NULL,1),(4642,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6972','4639','Pérdidas por deterioro de créditos a largo plazo otras partes vinculadas',NULL,NULL,1),(4643,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6973','4639','Pérdidas por deterioro de créditos a largo plazo otras empresas',NULL,NULL,1),(4644,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','698','4617','Pérdidas por deterioro de participaciones y valores representativos de deuda a corto plazo',NULL,NULL,1),(4645,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6980','4644','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo',NULL,NULL,1),(4646,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6981','4644','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas',NULL,NULL,1),(4647,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6985','4644','Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas del grupo',NULL,NULL,1),(4648,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6986','4644','Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas asociadas',NULL,NULL,1),(4649,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6988','4644','Pérdidas por deterioro en valores representativos de deuda a corto plazo de otras empresas',NULL,NULL,1),(4650,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','699','4617','Pérdidas por deterioro de crédito a corto plazo',NULL,NULL,1),(4651,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6990','4650','Pérdidas por deterioro de crédito a corto plazo empresas del grupo',NULL,NULL,1),(4652,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6991','4650','Pérdidas por deterioro de crédito a corto plazo empresas asociadas',NULL,NULL,1),(4653,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6992','4650','Pérdidas por deterioro de crédito a corto plazo otras partes vinculadas',NULL,NULL,1),(4654,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6993','4650','Pérdidas por deterioro de crédito a corto plazo otras empresas',NULL,NULL,1),(4655,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','70','4007','Ventas',NULL,NULL,1),(4656,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','VENTAS','700','4655','Ventas de mercaderías',NULL,NULL,1),(4657,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','VENTAS','701','4655','Ventas de productos terminados',NULL,NULL,1),(4658,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','702','4655','Ventas de productos semiterminados',NULL,NULL,1),(4659,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','703','4655','Ventas de subproductos y residuos',NULL,NULL,1),(4660,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','704','4655','Ventas de envases y embalajes',NULL,NULL,1),(4661,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','VENTAS','705','4655','Prestaciones de servicios',NULL,NULL,1),(4662,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','706','4655','Descuentos sobre ventas por pronto pago',NULL,NULL,1),(4663,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7060','4662','Descuentos sobre ventas por pronto pago de mercaderías',NULL,NULL,1),(4664,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7061','4662','Descuentos sobre ventas por pronto pago de productos terminados',NULL,NULL,1),(4665,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7062','4662','Descuentos sobre ventas por pronto pago de productos semiterminados',NULL,NULL,1),(4666,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7063','4662','Descuentos sobre ventas por pronto pago de subproductos y residuos',NULL,NULL,1),(4667,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','708','4655','Devoluciones de ventas y operacioes similares',NULL,NULL,1),(4668,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7080','4667','Devoluciones de ventas de mercaderías',NULL,NULL,1),(4669,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7081','4667','Devoluciones de ventas de productos terminados',NULL,NULL,1),(4670,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7082','4667','Devoluciones de ventas de productos semiterminados',NULL,NULL,1),(4671,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7083','4667','Devoluciones de ventas de subproductos y residuos',NULL,NULL,1),(4672,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7084','4667','Devoluciones de ventas de envases y embalajes',NULL,NULL,1),(4673,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','71','4007','Variación de existencias',NULL,NULL,1),(4674,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','710','4673','Variación de existencias de productos en curso',NULL,NULL,1),(4675,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','711','4673','Variación de existencias de productos semiterminados',NULL,NULL,1),(4676,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','712','4673','Variación de existencias de productos terminados',NULL,NULL,1),(4677,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','713','4673','Variación de existencias de subproductos, residuos y materiales recuperados',NULL,NULL,1),(4678,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','73','4007','Trabajos realizados para la empresa',NULL,NULL,1),(4679,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','730','4678','Trabajos realizados para el inmovilizado intangible',NULL,NULL,1),(4680,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','731','4678','Trabajos realizados para el inmovilizado tangible',NULL,NULL,1),(4681,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','732','4678','Trabajos realizados en inversiones inmobiliarias',NULL,NULL,1),(4682,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','733','4678','Trabajos realizados para el inmovilizado material en curso',NULL,NULL,1),(4683,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','74','4007','Subvenciones, donaciones y legados',NULL,NULL,1),(4684,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','740','4683','Subvenciones, donaciones y legados a la explotación',NULL,NULL,1),(4685,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','746','4683','Subvenciones, donaciones y legados de capital transferidos al resultado del ejercicio',NULL,NULL,1),(4686,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','747','4683','Otras subvenciones, donaciones y legados transferidos al resultado del ejercicio',NULL,NULL,1),(4687,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','75','4007','Otros ingresos de gestión',NULL,NULL,1),(4688,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','751','4687','Resultados de operaciones en común',NULL,NULL,1),(4689,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7510','4688','Pérdida transferida gestor',NULL,NULL,1),(4690,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7511','4688','Beneficio atribuido participe o asociado no gestor',NULL,NULL,1),(4691,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','752','4687','Ingreso por arrendamiento',NULL,NULL,1),(4692,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','753','4687','Ingresos de propiedad industrial cedida en explotación',NULL,NULL,1),(4693,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','754','4687','Ingresos por comisiones',NULL,NULL,1),(4694,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','755','4687','Ingresos por servicios al personal',NULL,NULL,1),(4695,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','759','4687','Ingresos por servicios diversos',NULL,NULL,1),(4696,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76','4007','Ingresos financieros',NULL,NULL,1),(4697,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','760','4696','Ingresos de participaciones en instrumentos de patrimonio',NULL,NULL,1),(4698,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7600','4697','Ingresos de participaciones en instrumentos de patrimonio empresas del grupo',NULL,NULL,1),(4699,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7601','4697','Ingresos de participaciones en instrumentos de patrimonio empresas asociadas',NULL,NULL,1),(4700,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7602','4697','Ingresos de participaciones en instrumentos de patrimonio otras partes asociadas',NULL,NULL,1),(4701,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7603','4697','Ingresos de participaciones en instrumentos de patrimonio otras empresas',NULL,NULL,1),(4702,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','761','4696','Ingresos de valores representativos de deuda',NULL,NULL,1),(4703,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7610','4702','Ingresos de valores representativos de deuda empresas del grupo',NULL,NULL,1),(4704,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7611','4702','Ingresos de valores representativos de deuda empresas asociadas',NULL,NULL,1),(4705,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7612','4702','Ingresos de valores representativos de deuda otras partes asociadas',NULL,NULL,1),(4706,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7613','4702','Ingresos de valores representativos de deuda otras empresas',NULL,NULL,1),(4707,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','762','4696','Ingresos de créditos',NULL,NULL,1),(4708,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7620','4707','Ingresos de créditos a largo plazo',NULL,NULL,1),(4709,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76200','4708','Ingresos de crédito a largo plazo empresas del grupo',NULL,NULL,1),(4710,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76201','4708','Ingresos de crédito a largo plazo empresas asociadas',NULL,NULL,1),(4711,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76202','4708','Ingresos de crédito a largo plazo otras partes asociadas',NULL,NULL,1),(4712,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76203','4708','Ingresos de crédito a largo plazo otras empresas',NULL,NULL,1),(4713,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7621','4707','Ingresos de créditos a corto plazo',NULL,NULL,1),(4714,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76210','4713','Ingresos de crédito a corto plazo empresas del grupo',NULL,NULL,1),(4715,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76211','4713','Ingresos de crédito a corto plazo empresas asociadas',NULL,NULL,1),(4716,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76212','4713','Ingresos de crédito a corto plazo otras partes asociadas',NULL,NULL,1),(4717,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76213','4713','Ingresos de crédito a corto plazo otras empresas',NULL,NULL,1),(4718,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','763','4696','Beneficios por valorización de activos y pasivos financieros por su valor razonable',NULL,NULL,1),(4719,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','766','4696','Beneficios en participaciones y valores representativos de deuda',NULL,NULL,1),(4720,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7660','4719','Beneficios en participaciones y valores representativos de deuda a largo plazo empresas del grupo',NULL,NULL,1),(4721,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7661','4719','Beneficios en participaciones y valores representativos de deuda a largo plazo empresas asociadas',NULL,NULL,1),(4722,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7662','4719','Beneficios en participaciones y valores representativos de deuda a largo plazo otras partes asociadas',NULL,NULL,1),(4723,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7663','4719','Beneficios en participaciones y valores representativos de deuda a largo plazo otras empresas',NULL,NULL,1),(4724,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7665','4719','Beneficios en participaciones y valores representativos de deuda a corto plazo empresas del grupo',NULL,NULL,1),(4725,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7666','4719','Beneficios en participaciones y valores representativos de deuda a corto plazo empresas asociadas',NULL,NULL,1),(4726,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7667','4719','Beneficios en participaciones y valores representativos de deuda a corto plazo otras partes asociadas',NULL,NULL,1),(4727,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7668','4719','Beneficios en participaciones y valores representativos de deuda a corto plazo otras empresas',NULL,NULL,1),(4728,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','768','4696','Diferencias positivas de cambio',NULL,NULL,1),(4729,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','769','4696','Otros ingresos financieros',NULL,NULL,1),(4730,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','77','4007','Beneficios procedentes de activos no corrientes e ingresos excepcionales',NULL,NULL,1),(4731,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','770','4730','Beneficios procedentes del inmovilizado intangible',NULL,NULL,1),(4732,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','771','4730','Beneficios procedentes del inmovilizado material',NULL,NULL,1),(4733,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','772','4730','Beneficios procedentes de las inversiones inmobiliarias',NULL,NULL,1),(4734,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','773','4730','Beneficios procedentes de participaciones a largo plazo en partes vinculadas',NULL,NULL,1),(4735,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7733','4734','Beneficios procedentes de participaciones a largo plazo empresas del grupo',NULL,NULL,1),(4736,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7734','4734','Beneficios procedentes de participaciones a largo plazo empresas asociadas',NULL,NULL,1),(4737,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7735','4734','Beneficios procedentes de participaciones a largo plazo otras partes vinculadas',NULL,NULL,1),(4738,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','775','4730','Beneficios por operaciones con obligaciones propias',NULL,NULL,1),(4739,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','778','4730','Ingresos excepcionales',NULL,NULL,1),(4741,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','79','4007','Excesos y aplicaciones de provisiones y pérdidas por deterioro',NULL,NULL,1),(4742,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','790','4741','Revisión del deterioro del inmovilizado intangible',NULL,NULL,1),(4743,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','791','4741','Revisión del deterioro del inmovilizado material',NULL,NULL,1),(4744,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','792','4741','Revisión del deterioro de las inversiones inmobiliarias',NULL,NULL,1),(4745,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','793','4741','Revisión del deterioro de las existencias',NULL,NULL,1),(4746,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7930','4745','Revisión del deterioro de productos terminados y en curso de fabricación',NULL,NULL,1),(4747,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7931','4745','Revisión del deterioro de mercaderías',NULL,NULL,1),(4748,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7932','4745','Revisión del deterioro de materias primas',NULL,NULL,1),(4749,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7933','4745','Revisión del deterioro de otros aprovisionamientos',NULL,NULL,1),(4750,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','794','4741','Revisión del deterioro de créditos por operaciones comerciales',NULL,NULL,1),(4751,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','795','4741','Exceso de provisiones',NULL,NULL,1),(4752,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7951','4751','Exceso de provisión para impuestos',NULL,NULL,1),(4753,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7952','4751','Exceso de provisión para otras responsabilidades',NULL,NULL,1),(4755,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7954','4751','Exceso de provisión para operaciones comerciales',NULL,NULL,1),(4756,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','79544','4755','Exceso de provisión por contratos onerosos',NULL,NULL,1),(4757,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','79549','4755','Exceso de provisión para otras operaciones comerciales',NULL,NULL,1),(4758,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7955','4751','Exceso de provisión para actuaciones medioambienteales',NULL,NULL,1),(4759,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','796','4741','Revisión del deterioro de participaciones y valores representativos de deuda a largo plazo',NULL,NULL,1),(4760,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7960','4759','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo',NULL,NULL,1),(4761,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7961','4759','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas',NULL,NULL,1),(4762,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7962','4759','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas',NULL,NULL,1),(4763,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7963','4759','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas',NULL,NULL,1),(4764,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7965','4759','Revisión del deterioro de valores representativos a largo plazo empresas del grupo',NULL,NULL,1),(4765,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7966','4759','Revisión del deterioro de valores representativos a largo plazo empresas asociadas',NULL,NULL,1),(4766,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7967','4759','Revisión del deterioro de valores representativos a largo otras partes vinculadas',NULL,NULL,1),(4767,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7968','4759','Revisión del deterioro de valores representativos a largo plazo otras empresas',NULL,NULL,1),(4768,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','797','4741','Revisión del deterioro de créditos a largo plazo',NULL,NULL,1),(4769,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7970','4768','Revisión del deterioro de créditos a largo plazo empresas del grupo',NULL,NULL,1),(4770,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7971','4768','Revisión del deterioro de créditos a largo plazo empresas asociadas',NULL,NULL,1),(4771,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7972','4768','Revisión del deterioro de créditos a largo plazo otras partes vinculadas',NULL,NULL,1),(4772,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7973','4768','Revisión del deterioro de créditos a largo plazo otras empresas',NULL,NULL,1),(4773,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','798','4741','Revisión del deterioro de participaciones y valores representativos de deuda a corto plazo',NULL,NULL,1),(4774,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7980','4773','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo',NULL,NULL,1),(4775,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7981','4773','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas',NULL,NULL,1),(4776,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7985','4773','Revisión del deterioro de valores representativos de deuda a corto plazo empresas del grupo',NULL,NULL,1),(4777,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7986','4773','Revisión del deterioro de valores representativos de deuda a corto plazo empresas asociadas',NULL,NULL,1),(4778,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7987','4773','Revisión del deterioro de valores representativos de deuda a corto plazo otras partes vinculadas',NULL,NULL,1),(4779,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7988','4773','Revisión del deterioro de valores representativos de deuda a corto plazo otras empresas',NULL,NULL,1),(4780,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','799','4741','Revisión del deterioro de créditos a corto plazo',NULL,NULL,1),(4781,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7990','4780','Revisión del deterioro de créditos a corto plazo empresas del grupo',NULL,NULL,1),(4782,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7991','4780','Revisión del deterioro de créditos a corto plazo empresas asociadas',NULL,NULL,1),(4783,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7992','4780','Revisión del deterioro de créditos a corto plazo otras partes vinculadas',NULL,NULL,1),(4784,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7993','4780','Revisión del deterioro de créditos a corto plazo otras empresas',NULL,NULL,1); +INSERT INTO `llx_accountingaccount` VALUES (1,1,NULL,NOW(),'PCG99-ABREGE','CAPIT','CAPITAL','101','1401','Capital',NULL,NULL,1),(2,1,NULL,NOW(),'PCG99-ABREGE','CAPIT','XXXXXX','105','1401','Ecarts de réévaluation',NULL,NULL,1),(3,1,NULL,NOW(),'PCG99-ABREGE','CAPIT','XXXXXX','1061','1401','Réserve légale',NULL,NULL,1),(4,1,NULL,NOW(),'PCG99-ABREGE','CAPIT','XXXXXX','1063','1401','Réserves statutaires ou contractuelles',NULL,NULL,1),(5,1,NULL,NOW(),'PCG99-ABREGE','CAPIT','XXXXXX','1064','1401','Réserves réglementées',NULL,NULL,1),(6,1,NULL,NOW(),'PCG99-ABREGE','CAPIT','XXXXXX','1068','1401','Autres réserves',NULL,NULL,1),(7,1,NULL,NOW(),'PCG99-ABREGE','CAPIT','XXXXXX','108','1401','Compte de l\'exploitant',NULL,NULL,1),(8,1,NULL,NOW(),'PCG99-ABREGE','CAPIT','XXXXXX','12','1401','Résultat de l\'exercice',NULL,NULL,1),(9,1,NULL,NOW(),'PCG99-ABREGE','CAPIT','XXXXXX','145','1401','Amortissements dérogatoires',NULL,NULL,1),(10,1,NULL,NOW(),'PCG99-ABREGE','CAPIT','XXXXXX','146','1401','Provision spéciale de réévaluation',NULL,NULL,1),(11,1,NULL,NOW(),'PCG99-ABREGE','CAPIT','XXXXXX','147','1401','Plus-values réinvesties',NULL,NULL,1),(12,1,NULL,NOW(),'PCG99-ABREGE','CAPIT','XXXXXX','148','1401','Autres provisions réglementées',NULL,NULL,1),(13,1,NULL,NOW(),'PCG99-ABREGE','CAPIT','XXXXXX','15','1401','Provisions pour risques et charges',NULL,NULL,1),(14,1,NULL,NOW(),'PCG99-ABREGE','CAPIT','XXXXXX','16','1401','Emprunts et dettes assimilees',NULL,NULL,1),(15,1,NULL,NOW(),'PCG99-ABREGE','IMMO','XXXXXX','20','1402','Immobilisations incorporelles',NULL,NULL,1),(16,1,NULL,NOW(),'PCG99-ABREGE','IMMO','XXXXXX','201','15','Frais d\'établissement',NULL,NULL,1),(17,1,NULL,NOW(),'PCG99-ABREGE','IMMO','XXXXXX','206','15','Droit au bail',NULL,NULL,1),(18,1,NULL,NOW(),'PCG99-ABREGE','IMMO','XXXXXX','207','15','Fonds commercial',NULL,NULL,1),(19,1,NULL,NOW(),'PCG99-ABREGE','IMMO','XXXXXX','208','15','Autres immobilisations incorporelles',NULL,NULL,1),(20,1,NULL,NOW(),'PCG99-ABREGE','IMMO','XXXXXX','21','1402','Immobilisations corporelles',NULL,NULL,1),(21,1,NULL,NOW(),'PCG99-ABREGE','IMMO','XXXXXX','23','1402','Immobilisations en cours',NULL,NULL,1),(22,1,NULL,NOW(),'PCG99-ABREGE','IMMO','XXXXXX','27','1402','Autres immobilisations financieres',NULL,NULL,1),(23,1,NULL,NOW(),'PCG99-ABREGE','IMMO','XXXXXX','280','1402','Amortissements des immobilisations incorporelles',NULL,NULL,1),(24,1,NULL,NOW(),'PCG99-ABREGE','IMMO','XXXXXX','281','1402','Amortissements des immobilisations corporelles',NULL,NULL,1),(25,1,NULL,NOW(),'PCG99-ABREGE','IMMO','XXXXXX','290','1402','Provisions pour dépréciation des immobilisations incorporelles',NULL,NULL,1),(26,1,NULL,NOW(),'PCG99-ABREGE','IMMO','XXXXXX','291','1402','Provisions pour dépréciation des immobilisations corporelles',NULL,NULL,1),(27,1,NULL,NOW(),'PCG99-ABREGE','IMMO','XXXXXX','297','1402','Provisions pour dépréciation des autres immobilisations financières',NULL,NULL,1),(28,1,NULL,NOW(),'PCG99-ABREGE','STOCK','XXXXXX','31','1403','Matieres premières',NULL,NULL,1),(29,1,NULL,NOW(),'PCG99-ABREGE','STOCK','XXXXXX','32','1403','Autres approvisionnements',NULL,NULL,1),(30,1,NULL,NOW(),'PCG99-ABREGE','STOCK','XXXXXX','33','1403','En-cours de production de biens',NULL,NULL,1),(31,1,NULL,NOW(),'PCG99-ABREGE','STOCK','XXXXXX','34','1403','En-cours de production de services',NULL,NULL,1),(32,1,NULL,NOW(),'PCG99-ABREGE','STOCK','XXXXXX','35','1403','Stocks de produits',NULL,NULL,1),(33,1,NULL,NOW(),'PCG99-ABREGE','STOCK','XXXXXX','37','1403','Stocks de marchandises',NULL,NULL,1),(34,1,NULL,NOW(),'PCG99-ABREGE','STOCK','XXXXXX','391','1403','Provisions pour dépréciation des matières premières',NULL,NULL,1),(35,1,NULL,NOW(),'PCG99-ABREGE','STOCK','XXXXXX','392','1403','Provisions pour dépréciation des autres approvisionnements',NULL,NULL,1),(36,1,NULL,NOW(),'PCG99-ABREGE','STOCK','XXXXXX','393','1403','Provisions pour dépréciation des en-cours de production de biens',NULL,NULL,1),(37,1,NULL,NOW(),'PCG99-ABREGE','STOCK','XXXXXX','394','1403','Provisions pour dépréciation des en-cours de production de services',NULL,NULL,1),(38,1,NULL,NOW(),'PCG99-ABREGE','STOCK','XXXXXX','395','1403','Provisions pour dépréciation des stocks de produits',NULL,NULL,1),(39,1,NULL,NOW(),'PCG99-ABREGE','STOCK','XXXXXX','397','1403','Provisions pour dépréciation des stocks de marchandises',NULL,NULL,1),(40,1,NULL,NOW(),'PCG99-ABREGE','TIERS','SUPPLIER','400','1404','Fournisseurs et Comptes rattachés',NULL,NULL,1),(41,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','409','1404','Fournisseurs débiteurs',NULL,NULL,1),(42,1,NULL,NOW(),'PCG99-ABREGE','TIERS','CUSTOMER','410','1404','Clients et Comptes rattachés',NULL,NULL,1),(43,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','419','1404','Clients créditeurs',NULL,NULL,1),(44,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','421','1404','Personnel',NULL,NULL,1),(45,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','428','1404','Personnel',NULL,NULL,1),(46,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','43','1404','Sécurité sociale et autres organismes sociaux',NULL,NULL,1),(47,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','444','1404','Etat - impôts sur bénéfice',NULL,NULL,1),(48,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','445','1404','Etat - Taxes sur chiffre affaires',NULL,NULL,1),(49,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','447','1404','Autres impôts, taxes et versements assimilés',NULL,NULL,1),(50,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','45','1404','Groupe et associes',NULL,NULL,1),(51,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','455','50','Associés',NULL,NULL,1),(52,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','46','1404','Débiteurs divers et créditeurs divers',NULL,NULL,1),(53,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','47','1404','Comptes transitoires ou d\'attente',NULL,NULL,1),(54,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','481','1404','Charges à répartir sur plusieurs exercices',NULL,NULL,1),(55,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','486','1404','Charges constatées d\'avance',NULL,NULL,1),(56,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','487','1404','Produits constatés d\'avance',NULL,NULL,1),(57,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','491','1404','Provisions pour dépréciation des comptes de clients',NULL,NULL,1),(58,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','496','1404','Provisions pour dépréciation des comptes de débiteurs divers',NULL,NULL,1),(59,1,NULL,NOW(),'PCG99-ABREGE','FINAN','XXXXXX','50','1405','Valeurs mobilières de placement',NULL,NULL,1),(60,1,NULL,NOW(),'PCG99-ABREGE','FINAN','BANK','51','1405','Banques, établissements financiers et assimilés',NULL,NULL,1),(61,1,NULL,NOW(),'PCG99-ABREGE','FINAN','CASH','53','1405','Caisse',NULL,NULL,1),(62,1,NULL,NOW(),'PCG99-ABREGE','FINAN','XXXXXX','54','1405','Régies d\'avance et accréditifs',NULL,NULL,1),(63,1,NULL,NOW(),'PCG99-ABREGE','FINAN','XXXXXX','58','1405','Virements internes',NULL,NULL,1),(64,1,NULL,NOW(),'PCG99-ABREGE','FINAN','XXXXXX','590','1405','Provisions pour dépréciation des valeurs mobilières de placement',NULL,NULL,1),(65,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','PRODUCT','60','1406','Achats',NULL,NULL,1),(66,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','XXXXXX','603','65','Variations des stocks',NULL,NULL,1),(67,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','SERVICE','61','1406','Services extérieurs',NULL,NULL,1),(68,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','XXXXXX','62','1406','Autres services extérieurs',NULL,NULL,1),(69,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','XXXXXX','63','1406','Impôts, taxes et versements assimiles',NULL,NULL,1),(70,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','XXXXXX','641','1406','Rémunérations du personnel',NULL,NULL,1),(71,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','XXXXXX','644','1406','Rémunération du travail de l\'exploitant',NULL,NULL,1),(72,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','SOCIAL','645','1406','Charges de sécurité sociale et de prévoyance',NULL,NULL,1),(73,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','XXXXXX','646','1406','Cotisations sociales personnelles de l\'exploitant',NULL,NULL,1),(74,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','XXXXXX','65','1406','Autres charges de gestion courante',NULL,NULL,1),(75,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','XXXXXX','66','1406','Charges financières',NULL,NULL,1),(76,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','XXXXXX','67','1406','Charges exceptionnelles',NULL,NULL,1),(77,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','XXXXXX','681','1406','Dotations aux amortissements et aux provisions',NULL,NULL,1),(78,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','XXXXXX','686','1406','Dotations aux amortissements et aux provisions',NULL,NULL,1),(79,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','XXXXXX','687','1406','Dotations aux amortissements et aux provisions',NULL,NULL,1),(80,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','XXXXXX','691','1406','Participation des salariés aux résultats',NULL,NULL,1),(81,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','XXXXXX','695','1406','Impôts sur les bénéfices',NULL,NULL,1),(82,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','XXXXXX','697','1406','Imposition forfaitaire annuelle des sociétés',NULL,NULL,1),(83,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','XXXXXX','699','1406','Produits',NULL,NULL,1),(84,1,NULL,NOW(),'PCG99-ABREGE','PROD','PRODUCT','701','1407','Ventes de produits finis',NULL,NULL,1),(85,1,NULL,NOW(),'PCG99-ABREGE','PROD','SERVICE','706','1407','Prestations de services',NULL,NULL,1),(86,1,NULL,NOW(),'PCG99-ABREGE','PROD','PRODUCT','707','1407','Ventes de marchandises',NULL,NULL,1),(87,1,NULL,NOW(),'PCG99-ABREGE','PROD','PRODUCT','708','1407','Produits des activités annexes',NULL,NULL,1),(88,1,NULL,NOW(),'PCG99-ABREGE','PROD','XXXXXX','709','1407','Rabais, remises et ristournes accordés par l\'entreprise',NULL,NULL,1),(89,1,NULL,NOW(),'PCG99-ABREGE','PROD','XXXXXX','713','1407','Variation des stocks',NULL,NULL,1),(90,1,NULL,NOW(),'PCG99-ABREGE','PROD','XXXXXX','72','1407','Production immobilisée',NULL,NULL,1),(91,1,NULL,NOW(),'PCG99-ABREGE','PROD','XXXXXX','73','1407','Produits nets partiels sur opérations à long terme',NULL,NULL,1),(92,1,NULL,NOW(),'PCG99-ABREGE','PROD','XXXXXX','74','1407','Subventions d\'exploitation',NULL,NULL,1),(93,1,NULL,NOW(),'PCG99-ABREGE','PROD','XXXXXX','75','1407','Autres produits de gestion courante',NULL,NULL,1),(94,1,NULL,NOW(),'PCG99-ABREGE','PROD','XXXXXX','753','93','Jetons de présence et rémunérations d\'administrateurs, gérants,...',NULL,NULL,1),(95,1,NULL,NOW(),'PCG99-ABREGE','PROD','XXXXXX','754','93','Ristournes perçues des coopératives',NULL,NULL,1),(96,1,NULL,NOW(),'PCG99-ABREGE','PROD','XXXXXX','755','93','Quotes-parts de résultat sur opérations faites en commun',NULL,NULL,1),(97,1,NULL,NOW(),'PCG99-ABREGE','PROD','XXXXXX','76','1407','Produits financiers',NULL,NULL,1),(98,1,NULL,NOW(),'PCG99-ABREGE','PROD','XXXXXX','77','1407','Produits exceptionnels',NULL,NULL,1),(99,1,NULL,NOW(),'PCG99-ABREGE','PROD','XXXXXX','781','1407','Reprises sur amortissements et provisions',NULL,NULL,1),(100,1,NULL,NOW(),'PCG99-ABREGE','PROD','XXXXXX','786','1407','Reprises sur provisions pour risques',NULL,NULL,1),(101,1,NULL,NOW(),'PCG99-ABREGE','PROD','XXXXXX','787','1407','Reprises sur provisions',NULL,NULL,1),(102,1,NULL,NOW(),'PCG99-ABREGE','PROD','XXXXXX','79','1407','Transferts de charges',NULL,NULL,1),(103,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','10','1501','Capital et réserves',NULL,NULL,1),(104,1,NULL,NOW(),'PCG99-BASE','CAPIT','CAPITAL','101','103','Capital',NULL,NULL,1),(105,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','104','103','Primes liées au capital social',NULL,NULL,1),(106,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','105','103','Ecarts de réévaluation',NULL,NULL,1),(107,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','106','103','Réserves',NULL,NULL,1),(108,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','107','103','Ecart d\'equivalence',NULL,NULL,1),(109,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','108','103','Compte de l\'exploitant',NULL,NULL,1),(110,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','109','103','Actionnaires : capital souscrit - non appelé',NULL,NULL,1),(111,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','11','1501','Report à nouveau (solde créditeur ou débiteur)',NULL,NULL,1),(112,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','110','111','Report à nouveau (solde créditeur)',NULL,NULL,1),(113,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','119','111','Report à nouveau (solde débiteur)',NULL,NULL,1),(114,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','12','1501','Résultat de l\'exercice (bénéfice ou perte)',NULL,NULL,1),(115,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','120','114','Résultat de l\'exercice (bénéfice)',NULL,NULL,1),(116,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','129','114','Résultat de l\'exercice (perte)',NULL,NULL,1),(117,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','13','1501','Subventions d\'investissement',NULL,NULL,1),(118,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','131','117','Subventions d\'équipement',NULL,NULL,1),(119,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','138','117','Autres subventions d\'investissement',NULL,NULL,1),(120,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','139','117','Subventions d\'investissement inscrites au compte de résultat',NULL,NULL,1),(121,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','14','1501','Provisions réglementées',NULL,NULL,1),(122,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','142','121','Provisions réglementées relatives aux immobilisations',NULL,NULL,1),(123,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','143','121','Provisions réglementées relatives aux stocks',NULL,NULL,1),(124,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','144','121','Provisions réglementées relatives aux autres éléments de l\'actif',NULL,NULL,1),(125,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','145','121','Amortissements dérogatoires',NULL,NULL,1),(126,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','146','121','Provision spéciale de réévaluation',NULL,NULL,1),(127,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','147','121','Plus-values réinvesties',NULL,NULL,1),(128,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','148','121','Autres provisions réglementées',NULL,NULL,1),(129,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','15','1501','Provisions pour risques et charges',NULL,NULL,1),(130,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','151','129','Provisions pour risques',NULL,NULL,1),(131,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','153','129','Provisions pour pensions et obligations similaires',NULL,NULL,1),(132,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','154','129','Provisions pour restructurations',NULL,NULL,1),(133,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','155','129','Provisions pour impôts',NULL,NULL,1),(134,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','156','129','Provisions pour renouvellement des immobilisations (entreprises concessionnaires)',NULL,NULL,1),(135,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','157','129','Provisions pour charges à répartir sur plusieurs exercices',NULL,NULL,1),(136,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','158','129','Autres provisions pour charges',NULL,NULL,1),(137,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','16','1501','Emprunts et dettes assimilees',NULL,NULL,1),(138,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','161','137','Emprunts obligataires convertibles',NULL,NULL,1),(139,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','163','137','Autres emprunts obligataires',NULL,NULL,1),(140,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','164','137','Emprunts auprès des établissements de crédit',NULL,NULL,1),(141,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','165','137','Dépôts et cautionnements reçus',NULL,NULL,1),(142,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','166','137','Participation des salariés aux résultats',NULL,NULL,1),(143,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','167','137','Emprunts et dettes assortis de conditions particulières',NULL,NULL,1),(144,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','168','137','Autres emprunts et dettes assimilées',NULL,NULL,1),(145,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','169','137','Primes de remboursement des obligations',NULL,NULL,1),(146,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','17','1501','Dettes rattachées à des participations',NULL,NULL,1),(147,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','171','146','Dettes rattachées à des participations (groupe)',NULL,NULL,1),(148,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','174','146','Dettes rattachées à des participations (hors groupe)',NULL,NULL,1),(149,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','178','146','Dettes rattachées à des sociétés en participation',NULL,NULL,1),(150,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','18','1501','Comptes de liaison des établissements et sociétés en participation',NULL,NULL,1),(151,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','181','150','Comptes de liaison des établissements',NULL,NULL,1),(152,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','186','150','Biens et prestations de services échangés entre établissements (charges)',NULL,NULL,1),(153,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','187','150','Biens et prestations de services échangés entre établissements (produits)',NULL,NULL,1),(154,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','188','150','Comptes de liaison des sociétés en participation',NULL,NULL,1),(155,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','20','1502','Immobilisations incorporelles',NULL,NULL,1),(156,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','201','155','Frais d\'établissement',NULL,NULL,1),(157,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','203','155','Frais de recherche et de développement',NULL,NULL,1),(158,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','205','155','Concessions et droits similaires, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires',NULL,NULL,1),(159,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','206','155','Droit au bail',NULL,NULL,1),(160,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','207','155','Fonds commercial',NULL,NULL,1),(161,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','208','155','Autres immobilisations incorporelles',NULL,NULL,1),(162,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','21','1502','Immobilisations corporelles',NULL,NULL,1),(163,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','211','162','Terrains',NULL,NULL,1),(164,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','212','162','Agencements et aménagements de terrains',NULL,NULL,1),(165,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','213','162','Constructions',NULL,NULL,1),(166,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','214','162','Constructions sur sol d\'autrui',NULL,NULL,1),(167,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','215','162','Installations techniques, matériels et outillage industriels',NULL,NULL,1),(168,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','218','162','Autres immobilisations corporelles',NULL,NULL,1),(169,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','22','1502','Immobilisations mises en concession',NULL,NULL,1),(170,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','23','1502','Immobilisations en cours',NULL,NULL,1),(171,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','231','170','Immobilisations corporelles en cours',NULL,NULL,1),(172,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','232','170','Immobilisations incorporelles en cours',NULL,NULL,1),(173,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','237','170','Avances et acomptes versés sur immobilisations incorporelles',NULL,NULL,1),(174,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','238','170','Avances et acomptes versés sur commandes d\'immobilisations corporelles',NULL,NULL,1),(175,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','25','1502','Parts dans des entreprises liées et créances sur des entreprises liées',NULL,NULL,1),(176,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','26','1502','Participations et créances rattachées à des participations',NULL,NULL,1),(177,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','261','176','Titres de participation',NULL,NULL,1),(178,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','266','176','Autres formes de participation',NULL,NULL,1),(179,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','267','176','Créances rattachées à des participations',NULL,NULL,1),(180,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','268','176','Créances rattachées à des sociétés en participation',NULL,NULL,1),(181,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','269','176','Versements restant à effectuer sur titres de participation non libérés',NULL,NULL,1),(182,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','27','1502','Autres immobilisations financieres',NULL,NULL,1),(183,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','271','183','Titres immobilisés autres que les titres immobilisés de l\'activité de portefeuille (droit de propriété)',NULL,NULL,1),(184,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','272','183','Titres immobilisés (droit de créance)',NULL,NULL,1),(185,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','273','183','Titres immobilisés de l\'activité de portefeuille',NULL,NULL,1),(186,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','274','183','Prêts',NULL,NULL,1),(187,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','275','183','Dépôts et cautionnements versés',NULL,NULL,1),(188,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','276','183','Autres créances immobilisées',NULL,NULL,1),(189,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','277','183','(Actions propres ou parts propres)',NULL,NULL,1),(190,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','279','183','Versements restant à effectuer sur titres immobilisés non libérés',NULL,NULL,1),(191,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','28','1502','Amortissements des immobilisations',NULL,NULL,1),(192,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','280','191','Amortissements des immobilisations incorporelles',NULL,NULL,1),(193,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','281','191','Amortissements des immobilisations corporelles',NULL,NULL,1),(194,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','282','191','Amortissements des immobilisations mises en concession',NULL,NULL,1),(195,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','29','1502','Dépréciations des immobilisations',NULL,NULL,1),(196,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','290','195','Dépréciations des immobilisations incorporelles',NULL,NULL,1),(197,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','291','195','Dépréciations des immobilisations corporelles',NULL,NULL,1),(198,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','292','195','Dépréciations des immobilisations mises en concession',NULL,NULL,1),(199,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','293','195','Dépréciations des immobilisations en cours',NULL,NULL,1),(200,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','296','195','Provisions pour dépréciation des participations et créances rattachées à des participations',NULL,NULL,1),(201,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','297','195','Provisions pour dépréciation des autres immobilisations financières',NULL,NULL,1),(202,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','31','1503','Matières premières (et fournitures)',NULL,NULL,1),(203,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','311','202','Matières (ou groupe) A',NULL,NULL,1),(204,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','312','202','Matières (ou groupe) B',NULL,NULL,1),(205,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','317','202','Fournitures A, B, C,',NULL,NULL,1),(206,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','32','1503','Autres approvisionnements',NULL,NULL,1),(207,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','321','206','Matières consommables',NULL,NULL,1),(208,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','322','206','Fournitures consommables',NULL,NULL,1),(209,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','326','206','Emballages',NULL,NULL,1),(210,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','33','1503','En-cours de production de biens',NULL,NULL,1),(211,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','331','210','Produits en cours',NULL,NULL,1),(212,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','335','210','Travaux en cours',NULL,NULL,1),(213,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','34','1503','En-cours de production de services',NULL,NULL,1),(214,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','341','213','Etudes en cours',NULL,NULL,1),(215,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','345','213','Prestations de services en cours',NULL,NULL,1),(216,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','35','1503','Stocks de produits',NULL,NULL,1),(217,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','351','216','Produits intermédiaires',NULL,NULL,1),(218,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','355','216','Produits finis',NULL,NULL,1),(219,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','358','216','Produits résiduels (ou matières de récupération)',NULL,NULL,1),(220,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','37','1503','Stocks de marchandises',NULL,NULL,1),(221,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','371','220','Marchandises (ou groupe) A',NULL,NULL,1),(222,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','372','220','Marchandises (ou groupe) B',NULL,NULL,1),(223,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','39','1503','Provisions pour dépréciation des stocks et en-cours',NULL,NULL,1),(224,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','391','223','Provisions pour dépréciation des matières premières',NULL,NULL,1),(225,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','392','223','Provisions pour dépréciation des autres approvisionnements',NULL,NULL,1),(226,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','393','223','Provisions pour dépréciation des en-cours de production de biens',NULL,NULL,1),(227,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','394','223','Provisions pour dépréciation des en-cours de production de services',NULL,NULL,1),(228,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','395','223','Provisions pour dépréciation des stocks de produits',NULL,NULL,1),(229,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','397','223','Provisions pour dépréciation des stocks de marchandises',NULL,NULL,1),(230,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','40','1504','Fournisseurs et Comptes rattachés',NULL,NULL,1),(231,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','400','230','Fournisseurs et Comptes rattachés',NULL,NULL,1),(232,1,NULL,NOW(),'PCG99-BASE','TIERS','SUPPLIER','401','230','Fournisseurs',NULL,NULL,1),(233,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','403','230','Fournisseurs - Effets à payer',NULL,NULL,1),(234,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','404','230','Fournisseurs d\'immobilisations',NULL,NULL,1),(235,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','405','230','Fournisseurs d\'immobilisations - Effets à payer',NULL,NULL,1),(236,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','408','230','Fournisseurs - Factures non parvenues',NULL,NULL,1),(237,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','409','230','Fournisseurs débiteurs',NULL,NULL,1),(238,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','41','1504','Clients et comptes rattachés',NULL,NULL,1),(239,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','410','238','Clients et Comptes rattachés',NULL,NULL,1),(240,1,NULL,NOW(),'PCG99-BASE','TIERS','CUSTOMER','411','238','Clients',NULL,NULL,1),(241,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','413','238','Clients - Effets à recevoir',NULL,NULL,1),(242,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','416','238','Clients douteux ou litigieux',NULL,NULL,1),(243,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','418','238','Clients - Produits non encore facturés',NULL,NULL,1),(244,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','419','238','Clients créditeurs',NULL,NULL,1),(245,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','42','1504','Personnel et comptes rattachés',NULL,NULL,1),(246,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','421','245','Personnel - Rémunérations dues',NULL,NULL,1),(247,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','422','245','Comités d\'entreprises, d\'établissement, ...',NULL,NULL,1),(248,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','424','245','Participation des salariés aux résultats',NULL,NULL,1),(249,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','425','245','Personnel - Avances et acomptes',NULL,NULL,1),(250,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','426','245','Personnel - Dépôts',NULL,NULL,1),(251,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','427','245','Personnel - Oppositions',NULL,NULL,1),(252,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','428','245','Personnel - Charges à payer et produits à recevoir',NULL,NULL,1),(253,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','43','1504','Sécurité sociale et autres organismes sociaux',NULL,NULL,1),(254,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','431','253','Sécurité sociale',NULL,NULL,1),(255,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','437','253','Autres organismes sociaux',NULL,NULL,1),(256,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','438','253','Organismes sociaux - Charges à payer et produits à recevoir',NULL,NULL,1),(257,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','44','1504','État et autres collectivités publiques',NULL,NULL,1),(258,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','441','257','État - Subventions à recevoir',NULL,NULL,1),(259,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','442','257','Etat - Impôts et taxes recouvrables sur des tiers',NULL,NULL,1),(260,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','443','257','Opérations particulières avec l\'Etat, les collectivités publiques, les organismes internationaux',NULL,NULL,1),(261,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','444','257','Etat - Impôts sur les bénéfices',NULL,NULL,1),(262,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','445','257','Etat - Taxes sur le chiffre d\'affaires',NULL,NULL,1),(263,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','446','257','Obligations cautionnées',NULL,NULL,1),(264,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','447','257','Autres impôts, taxes et versements assimilés',NULL,NULL,1),(265,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','448','257','Etat - Charges à payer et produits à recevoir',NULL,NULL,1),(266,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','449','257','Quotas d\'émission à restituer à l\'Etat',NULL,NULL,1),(267,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','45','1504','Groupe et associes',NULL,NULL,1),(268,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','451','267','Groupe',NULL,NULL,1),(269,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','455','267','Associés - Comptes courants',NULL,NULL,1),(270,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','456','267','Associés - Opérations sur le capital',NULL,NULL,1),(271,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','457','267','Associés - Dividendes à payer',NULL,NULL,1),(272,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','458','267','Associés - Opérations faites en commun et en G.I.E.',NULL,NULL,1),(273,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','46','1504','Débiteurs divers et créditeurs divers',NULL,NULL,1),(274,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','462','273','Créances sur cessions d\'immobilisations',NULL,NULL,1),(275,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','464','273','Dettes sur acquisitions de valeurs mobilières de placement',NULL,NULL,1),(276,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','465','273','Créances sur cessions de valeurs mobilières de placement',NULL,NULL,1),(277,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','467','273','Autres comptes débiteurs ou créditeurs',NULL,NULL,1),(278,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','468','273','Divers - Charges à payer et produits à recevoir',NULL,NULL,1),(279,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','47','1504','Comptes transitoires ou d\'attente',NULL,NULL,1),(280,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','471','279','Comptes d\'attente',NULL,NULL,1),(281,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','476','279','Différence de conversion - Actif',NULL,NULL,1),(282,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','477','279','Différences de conversion - Passif',NULL,NULL,1),(283,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','478','279','Autres comptes transitoires',NULL,NULL,1),(284,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','48','1504','Comptes de régularisation',NULL,NULL,1),(285,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','481','284','Charges à répartir sur plusieurs exercices',NULL,NULL,1),(286,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','486','284','Charges constatées d\'avance',NULL,NULL,1),(287,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','487','284','Produits constatés d\'avance',NULL,NULL,1),(288,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','488','284','Comptes de répartition périodique des charges et des produits',NULL,NULL,1),(289,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','489','284','Quotas d\'émission alloués par l\'Etat',NULL,NULL,1),(290,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','49','1504','Provisions pour dépréciation des comptes de tiers',NULL,NULL,1),(291,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','491','290','Provisions pour dépréciation des comptes de clients',NULL,NULL,1),(292,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','495','290','Provisions pour dépréciation des comptes du groupe et des associés',NULL,NULL,1),(293,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','496','290','Provisions pour dépréciation des comptes de débiteurs divers',NULL,NULL,1),(294,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','50','1505','Valeurs mobilières de placement',NULL,NULL,1),(295,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','501','294','Parts dans des entreprises liées',NULL,NULL,1),(296,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','502','294','Actions propres',NULL,NULL,1),(297,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','503','294','Actions',NULL,NULL,1),(298,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','504','294','Autres titres conférant un droit de propriété',NULL,NULL,1),(299,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','505','294','Obligations et bons émis par la société et rachetés par elle',NULL,NULL,1),(300,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','506','294','Obligations',NULL,NULL,1),(301,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','507','294','Bons du Trésor et bons de caisse à court terme',NULL,NULL,1),(302,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','508','294','Autres valeurs mobilières de placement et autres créances assimilées',NULL,NULL,1),(303,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','509','294','Versements restant à effectuer sur valeurs mobilières de placement non libérées',NULL,NULL,1),(304,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','51','1505','Banques, établissements financiers et assimilés',NULL,NULL,1),(305,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','511','304','Valeurs à l\'encaissement',NULL,NULL,1),(306,1,NULL,NOW(),'PCG99-BASE','FINAN','BANK','512','304','Banques',NULL,NULL,1),(307,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','514','304','Chèques postaux',NULL,NULL,1),(308,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','515','304','\"Caisses\" du Trésor et des établissements publics',NULL,NULL,1),(309,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','516','304','Sociétés de bourse',NULL,NULL,1),(310,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','517','304','Autres organismes financiers',NULL,NULL,1),(311,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','518','304','Intérêts courus',NULL,NULL,1),(312,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','519','304','Concours bancaires courants',NULL,NULL,1),(313,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','52','1505','Instruments de trésorerie',NULL,NULL,1),(314,1,NULL,NOW(),'PCG99-BASE','FINAN','CASH','53','1505','Caisse',NULL,NULL,1),(315,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','531','314','Caisse siège social',NULL,NULL,1),(316,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','532','314','Caisse succursale (ou usine) A',NULL,NULL,1),(317,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','533','314','Caisse succursale (ou usine) B',NULL,NULL,1),(318,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','54','1505','Régies d\'avance et accréditifs',NULL,NULL,1),(319,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','58','1505','Virements internes',NULL,NULL,1),(320,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','59','1505','Provisions pour dépréciation des comptes financiers',NULL,NULL,1),(321,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','590','320','Provisions pour dépréciation des valeurs mobilières de placement',NULL,NULL,1),(322,1,NULL,NOW(),'PCG99-BASE','CHARGE','PRODUCT','60','1506','Achats',NULL,NULL,1),(323,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','601','322','Achats stockés - Matières premières (et fournitures)',NULL,NULL,1),(324,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','602','322','Achats stockés - Autres approvisionnements',NULL,NULL,1),(325,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','603','322','Variations des stocks (approvisionnements et marchandises)',NULL,NULL,1),(326,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','604','322','Achats stockés - Matières premières (et fournitures)',NULL,NULL,1),(327,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','605','322','Achats de matériel, équipements et travaux',NULL,NULL,1),(328,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','606','322','Achats non stockés de matière et fournitures',NULL,NULL,1),(329,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','607','322','Achats de marchandises',NULL,NULL,1),(330,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','608','322','(Compte réservé, le cas échéant, à la récapitulation des frais accessoires incorporés aux achats)',NULL,NULL,1),(331,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','609','322','Rabais, remises et ristournes obtenus sur achats',NULL,NULL,1),(332,1,NULL,NOW(),'PCG99-BASE','CHARGE','SERVICE','61','1506','Services extérieurs',NULL,NULL,1),(333,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','611','332','Sous-traitance générale',NULL,NULL,1),(334,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','612','332','Redevances de crédit-bail',NULL,NULL,1),(335,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','613','332','Locations',NULL,NULL,1),(336,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','614','332','Charges locatives et de copropriété',NULL,NULL,1),(337,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','615','332','Entretien et réparations',NULL,NULL,1),(338,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','616','332','Primes d\'assurances',NULL,NULL,1),(339,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','617','332','Etudes et recherches',NULL,NULL,1),(340,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','618','332','Divers',NULL,NULL,1),(341,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','619','332','Rabais, remises et ristournes obtenus sur services extérieurs',NULL,NULL,1),(342,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','62','1506','Autres services extérieurs',NULL,NULL,1),(343,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','621','342','Personnel extérieur à l\'entreprise',NULL,NULL,1),(344,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','622','342','Rémunérations d\'intermédiaires et honoraires',NULL,NULL,1),(345,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','623','342','Publicité, publications, relations publiques',NULL,NULL,1),(346,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','624','342','Transports de biens et transports collectifs du personnel',NULL,NULL,1),(347,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','625','342','Déplacements, missions et réceptions',NULL,NULL,1),(348,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','626','342','Frais postaux et de télécommunications',NULL,NULL,1),(349,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','627','342','Services bancaires et assimilés',NULL,NULL,1),(350,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','628','342','Divers',NULL,NULL,1),(351,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','629','342','Rabais, remises et ristournes obtenus sur autres services extérieurs',NULL,NULL,1),(352,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','63','1506','Impôts, taxes et versements assimilés',NULL,NULL,1),(353,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','631','352','Impôts, taxes et versements assimilés sur rémunérations (administrations des impôts)',NULL,NULL,1),(354,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','633','352','Impôts, taxes et versements assimilés sur rémunérations (autres organismes)',NULL,NULL,1),(355,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','635','352','Autres impôts, taxes et versements assimilés (administrations des impôts)',NULL,NULL,1),(356,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','637','352','Autres impôts, taxes et versements assimilés (autres organismes)',NULL,NULL,1),(357,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','64','1506','Charges de personnel',NULL,NULL,1),(358,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','641','357','Rémunérations du personnel',NULL,NULL,1),(359,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','644','357','Rémunération du travail de l\'exploitant',NULL,NULL,1),(360,1,NULL,NOW(),'PCG99-BASE','CHARGE','SOCIAL','645','357','Charges de sécurité sociale et de prévoyance',NULL,NULL,1),(361,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','646','357','Cotisations sociales personnelles de l\'exploitant',NULL,NULL,1),(362,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','647','357','Autres charges sociales',NULL,NULL,1),(363,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','648','357','Autres charges de personnel',NULL,NULL,1),(364,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','65','1506','Autres charges de gestion courante',NULL,NULL,1),(365,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','651','364','Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires',NULL,NULL,1),(366,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','653','364','Jetons de présence',NULL,NULL,1),(367,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','654','364','Pertes sur créances irrécouvrables',NULL,NULL,1),(368,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','655','364','Quote-part de résultat sur opérations faites en commun',NULL,NULL,1),(369,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','658','364','Charges diverses de gestion courante',NULL,NULL,1),(370,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','66','1506','Charges financières',NULL,NULL,1),(371,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','661','370','Charges d\'intérêts',NULL,NULL,1),(372,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','664','370','Pertes sur créances liées à des participations',NULL,NULL,1),(373,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','665','370','Escomptes accordés',NULL,NULL,1),(374,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','666','370','Pertes de change',NULL,NULL,1),(375,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','667','370','Charges nettes sur cessions de valeurs mobilières de placement',NULL,NULL,1),(376,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','668','370','Autres charges financières',NULL,NULL,1),(377,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','67','1506','Charges exceptionnelles',NULL,NULL,1),(378,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','671','377','Charges exceptionnelles sur opérations de gestion',NULL,NULL,1),(379,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','672','377','(Compte à la disposition des entités pour enregistrer, en cours d\'exercice, les charges sur exercices antérieurs)',NULL,NULL,1),(380,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','675','377','Valeurs comptables des éléments d\'actif cédés',NULL,NULL,1),(381,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','678','377','Autres charges exceptionnelles',NULL,NULL,1),(382,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','68','1506','Dotations aux amortissements et aux provisions',NULL,NULL,1),(383,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','681','382','Dotations aux amortissements et aux provisions - Charges d\'exploitation',NULL,NULL,1),(384,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','686','382','Dotations aux amortissements et aux provisions - Charges financières',NULL,NULL,1),(385,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','687','382','Dotations aux amortissements et aux provisions - Charges exceptionnelles',NULL,NULL,1),(386,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','69','1506','Participation des salariés - impôts sur les bénéfices et assimiles',NULL,NULL,1),(387,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','691','386','Participation des salariés aux résultats',NULL,NULL,1),(388,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','695','386','Impôts sur les bénéfices',NULL,NULL,1),(389,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','696','386','Suppléments d\'impôt sur les sociétés liés aux distributions',NULL,NULL,1),(390,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','697','386','Imposition forfaitaire annuelle des sociétés',NULL,NULL,1),(391,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','698','386','Intégration fiscale',NULL,NULL,1),(392,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','699','386','Produits - Reports en arrière des déficits',NULL,NULL,1),(393,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','70','1507','Ventes de produits fabriqués, prestations de services, marchandises',NULL,NULL,1),(394,1,NULL,NOW(),'PCG99-BASE','PROD','PRODUCT','701','393','Ventes de produits finis',NULL,NULL,1),(395,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','702','393','Ventes de produits intermédiaires',NULL,NULL,1),(396,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','703','393','Ventes de produits résiduels',NULL,NULL,1),(397,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','704','393','Travaux',NULL,NULL,1),(398,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','705','393','Etudes',NULL,NULL,1),(399,1,NULL,NOW(),'PCG99-BASE','PROD','SERVICE','706','393','Prestations de services',NULL,NULL,1),(400,1,NULL,NOW(),'PCG99-BASE','PROD','PRODUCT','707','393','Ventes de marchandises',NULL,NULL,1),(401,1,NULL,NOW(),'PCG99-BASE','PROD','PRODUCT','708','393','Produits des activités annexes',NULL,NULL,1),(402,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','709','393','Rabais, remises et ristournes accordés par l\'entreprise',NULL,NULL,1),(403,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','71','1507','Production stockée (ou déstockage)',NULL,NULL,1),(404,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','713','403','Variation des stocks (en-cours de production, produits)',NULL,NULL,1),(405,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','72','1507','Production immobilisée',NULL,NULL,1),(406,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','721','405','Immobilisations incorporelles',NULL,NULL,1),(407,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','722','405','Immobilisations corporelles',NULL,NULL,1),(408,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','74','1507','Subventions d\'exploitation',NULL,NULL,1),(409,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','75','1507','Autres produits de gestion courante',NULL,NULL,1),(410,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','751','409','Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires',NULL,NULL,1),(411,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','752','409','Revenus des immeubles non affectés à des activités professionnelles',NULL,NULL,1),(412,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','753','409','Jetons de présence et rémunérations d\'administrateurs, gérants,...',NULL,NULL,1),(413,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','754','409','Ristournes perçues des coopératives (provenant des excédents)',NULL,NULL,1),(414,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','755','409','Quotes-parts de résultat sur opérations faites en commun',NULL,NULL,1),(415,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','758','409','Produits divers de gestion courante',NULL,NULL,1),(416,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','76','1507','Produits financiers',NULL,NULL,1),(417,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','761','416','Produits de participations',NULL,NULL,1),(418,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','762','416','Produits des autres immobilisations financières',NULL,NULL,1),(419,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','763','416','Revenus des autres créances',NULL,NULL,1),(420,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','764','416','Revenus des valeurs mobilières de placement',NULL,NULL,1),(421,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','765','416','Escomptes obtenus',NULL,NULL,1),(422,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','766','416','Gains de change',NULL,NULL,1),(423,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','767','416','Produits nets sur cessions de valeurs mobilières de placement',NULL,NULL,1),(424,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','768','416','Autres produits financiers',NULL,NULL,1),(425,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','77','1507','Produits exceptionnels',NULL,NULL,1),(426,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','771','425','Produits exceptionnels sur opérations de gestion',NULL,NULL,1),(427,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','772','425','(Compte à la disposition des entités pour enregistrer, en cours d\'exercice, les produits sur exercices antérieurs)',NULL,NULL,1),(428,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','775','425','Produits des cessions d\'éléments d\'actif',NULL,NULL,1),(429,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','777','425','Quote-part des subventions d\'investissement virée au résultat de l\'exercice',NULL,NULL,1),(430,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','778','425','Autres produits exceptionnels',NULL,NULL,1),(431,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','78','1507','Reprises sur amortissements et provisions',NULL,NULL,1),(432,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','781','431','Reprises sur amortissements et provisions (à inscrire dans les produits d\'exploitation)',NULL,NULL,1),(433,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','786','431','Reprises sur provisions pour risques (à inscrire dans les produits financiers)',NULL,NULL,1),(434,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','787','431','Reprises sur provisions (à inscrire dans les produits exceptionnels)',NULL,NULL,1),(435,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','79','1507','Transferts de charges',NULL,NULL,1),(436,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','791','435','Transferts de charges d\'exploitation ',NULL,NULL,1),(437,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','796','435','Transferts de charges financières',NULL,NULL,1),(438,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','797','435','Transferts de charges exceptionnelles',NULL,NULL,1),(439,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','10','1351','Capital',NULL,NULL,1),(440,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','100','439','Capital souscrit ou capital personnel',NULL,NULL,1),(441,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1000','440','Capital non amorti',NULL,NULL,1),(442,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1001','440','Capital amorti',NULL,NULL,1),(443,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','101','439','Capital non appelé',NULL,NULL,1),(444,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','109','439','Compte de l\'exploitant',NULL,NULL,1),(445,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1090','444','Opérations courantes',NULL,NULL,1),(446,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1091','444','Impôts personnels',NULL,NULL,1),(447,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1092','444','Rémunérations et autres avantages',NULL,NULL,1),(448,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','11','1351','Primes d\'émission',NULL,NULL,1),(449,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','12','1351','Plus-values de réévaluation',NULL,NULL,1),(450,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','120','449','Plus-values de réévaluation sur immobilisations incorporelles',NULL,NULL,1),(451,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1200','450','Plus-values de réévaluation',NULL,NULL,1),(452,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1201','450','Reprises de réductions de valeur',NULL,NULL,1),(453,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','121','449','Plus-values de réévaluation sur immobilisations corporelles',NULL,NULL,1),(454,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1210','453','Plus-values de réévaluation',NULL,NULL,1),(455,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1211','453','Reprises de réductions de valeur',NULL,NULL,1),(456,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','122','449','Plus-values de réévaluation sur immobilisations financières',NULL,NULL,1),(457,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1220','456','Plus-values de réévaluation',NULL,NULL,1),(458,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1221','456','Reprises de réductions de valeur',NULL,NULL,1),(459,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','123','449','Plus-values de réévaluation sur stocks',NULL,NULL,1),(460,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','124','449','Reprises de réductions de valeur sur placements de trésorerie',NULL,NULL,1),(461,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','13','1351','Réserve',NULL,NULL,1),(462,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','130','461','Réserve légale',NULL,NULL,1),(463,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','131','461','Réserves indisponibles',NULL,NULL,1),(464,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1310','463','Réserve pour actions propres',NULL,NULL,1),(465,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1311','463','Autres réserves indisponibles',NULL,NULL,1),(466,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','132','461','Réserves immunisées',NULL,NULL,1),(467,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','133','461','Réserves disponibles',NULL,NULL,1),(468,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1330','467','Réserve pour régularisation de dividendes',NULL,NULL,1),(469,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1331','467','Réserve pour renouvellement des immobilisations',NULL,NULL,1),(470,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1332','467','Réserve pour installations en faveur du personnel 1333 Réserves libres',NULL,NULL,1),(471,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','14','1351','Bénéfice reporté (ou perte reportée)',NULL,NULL,1),(472,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','15','1351','Subsides en capital',NULL,NULL,1),(473,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','150','472','Montants obtenus',NULL,NULL,1),(474,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','151','472','Montants transférés aux résultats',NULL,NULL,1),(475,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','16','1351','Provisions pour risques et charges',NULL,NULL,1),(476,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','160','475','Provisions pour pensions et obligations similaires',NULL,NULL,1),(477,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','161','475','Provisions pour charges fiscales',NULL,NULL,1),(478,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','162','475','Provisions pour grosses réparations et gros entretiens',NULL,NULL,1),(479,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','163','475','à 169 Provisions pour autres risques et charges',NULL,NULL,1),(480,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','164','475','Provisions pour sûretés personnelles ou réelles constituées à l\'appui de dettes et d\'engagements de tiers',NULL,NULL,1),(481,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','165','475','Provisions pour engagements relatifs à l\'acquisition ou à la cession d\'immobilisations',NULL,NULL,1),(482,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','166','475','Provisions pour exécution de commandes passées ou reçues',NULL,NULL,1),(483,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','167','475','Provisions pour positions et marchés à terme en devises ou positions et marchés à terme en marchandises',NULL,NULL,1),(484,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','168','475','Provisions pour garanties techniques attachées aux ventes et prestations déjà effectuées par l\'entreprise',NULL,NULL,1),(485,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','169','475','Provisions pour autres risques et charges',NULL,NULL,1),(486,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1690','485','Pour litiges en cours',NULL,NULL,1),(487,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1691','485','Pour amendes, doubles droits et pénalités',NULL,NULL,1),(488,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1692','485','Pour propre assureur',NULL,NULL,1),(489,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1693','485','Pour risques inhérents aux opérations de crédits à moyen ou long terme',NULL,NULL,1),(490,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1695','485','Provision pour charge de liquidation',NULL,NULL,1),(491,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1696','485','Provision pour départ de personnel',NULL,NULL,1),(492,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1699','485','Pour risques divers',NULL,NULL,1),(493,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','17','1351','Dettes à plus d\'un an',NULL,NULL,1),(494,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','170','493','Emprunts subordonnés',NULL,NULL,1),(495,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1700','494','Convertibles',NULL,NULL,1),(496,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1701','494','Non convertibles',NULL,NULL,1),(497,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','171','493','Emprunts obligataires non subordonnés',NULL,NULL,1),(498,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1710','498','Convertibles',NULL,NULL,1),(499,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1711','498','Non convertibles',NULL,NULL,1),(500,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','172','493','Dettes de location-financement et assimilés',NULL,NULL,1),(501,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1720','500','Dettes de location-financement de biens immobiliers',NULL,NULL,1),(502,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1721','500','Dettes de location-financement de biens mobiliers',NULL,NULL,1),(503,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1722','500','Dettes sur droits réels sur immeubles',NULL,NULL,1),(504,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','173','493','Etablissements de crédit',NULL,NULL,1),(505,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1730','504','Dettes en compte',NULL,NULL,1),(506,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','17300','505','Banque A',NULL,NULL,1),(507,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','17301','505','Banque B',NULL,NULL,1),(508,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','17302','505','Banque C',NULL,NULL,1),(509,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','17303','505','Banque D',NULL,NULL,1),(510,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1731','504','Promesses',NULL,NULL,1),(511,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','17310','510','Banque A',NULL,NULL,1),(512,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','17311','510','Banque B',NULL,NULL,1),(513,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','17312','510','Banque C',NULL,NULL,1),(514,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','17313','510','Banque D',NULL,NULL,1),(515,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1732','504','Crédits d\'acceptation',NULL,NULL,1),(516,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','17320','515','Banque A',NULL,NULL,1),(517,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','17321','515','Banque B',NULL,NULL,1),(518,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','17322','515','Banque C',NULL,NULL,1),(519,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','17323','515','Banque D',NULL,NULL,1),(520,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','174','493','Autres emprunts',NULL,NULL,1),(521,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','175','493','Dettes commerciales',NULL,NULL,1),(522,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1750','521','Fournisseurs : dettes en compte',NULL,NULL,1),(523,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','17500','522','Entreprises apparentées',NULL,NULL,1),(524,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','175000','523','Entreprises liées',NULL,NULL,1),(525,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','175001','523','Entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(526,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','17501','522','Fournisseurs ordinaires',NULL,NULL,1),(527,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','175010','526','Fournisseurs belges',NULL,NULL,1),(528,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','175011','526','Fournisseurs C.E.E.',NULL,NULL,1),(529,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','175012','526','Fournisseurs importation',NULL,NULL,1),(530,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1751','521','Effets à payer',NULL,NULL,1),(531,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','17510','530','Entreprises apparentées',NULL,NULL,1),(532,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','175100','531','Entreprises liées',NULL,NULL,1),(533,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','175101','531','Entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(534,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','17511','530','Fournisseurs ordinaires',NULL,NULL,1),(535,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','175110','534','Fournisseurs belges',NULL,NULL,1),(536,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','175111','534','Fournisseurs C.E.E.',NULL,NULL,1),(537,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','175112','534','Fournisseurs importation',NULL,NULL,1),(538,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','176','493','Acomptes reçus sur commandes',NULL,NULL,1),(539,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','178','493','Cautionnements reçus en numéraires',NULL,NULL,1),(540,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','179','493','Dettes diverses',NULL,NULL,1),(541,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1790','540','Entreprises liées',NULL,NULL,1),(542,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1791','540','Autres entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(543,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1792','540','Administrateurs, gérants et associés',NULL,NULL,1),(544,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1794','540','Rentes viagères capitalisées',NULL,NULL,1),(545,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1798','540','Dettes envers les coparticipants des associations momentanées et en participation',NULL,NULL,1),(546,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1799','540','Autres dettes diverses',NULL,NULL,1),(547,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','18','1351','Comptes de liaison des établissements et succursales',NULL,NULL,1),(548,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','20','1352','Frais d\'établissement',NULL,NULL,1),(549,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','200','548','Frais de constitution et d\'augmentation de capital',NULL,NULL,1),(550,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2000','549','Frais de constitution et d\'augmentation de capital',NULL,NULL,1),(551,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2009','549','Amortissements sur frais de constitution et d\'augmentation de capital',NULL,NULL,1),(552,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','201','548','Frais d\'émission d\'emprunts et primes de remboursement',NULL,NULL,1),(553,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2010','552','Agios sur emprunts et frais d\'émission d\'emprunts',NULL,NULL,1),(554,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2019','552','Amortissements sur agios sur emprunts et frais d\'émission d\'emprunts',NULL,NULL,1),(555,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','202','548','Autres frais d\'établissement',NULL,NULL,1),(556,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2020','555','Autres frais d\'établissement',NULL,NULL,1),(557,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2029','555','Amortissements sur autres frais d\'établissement',NULL,NULL,1),(558,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','203','548','Intérêts intercalaires',NULL,NULL,1),(559,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2030','558','Intérêts intercalaires',NULL,NULL,1),(560,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2039','558','Amortissements sur intérêts intercalaires',NULL,NULL,1),(561,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','204','548','Frais de restructuration',NULL,NULL,1),(562,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2040','561','Coût des frais de restructuration',NULL,NULL,1),(563,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2049','561','Amortissements sur frais de restructuration',NULL,NULL,1),(564,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','21','1352','Immobilisations incorporelles',NULL,NULL,1),(565,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','210','564','Frais de recherche et de développement',NULL,NULL,1),(566,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2100','565','Frais de recherche et de mise au point',NULL,NULL,1),(567,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2108','565','Plus-values actées sur frais de recherche et de mise au point',NULL,NULL,1),(568,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2109','565','Amortissements sur frais de recherche et de mise au point',NULL,NULL,1),(569,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','211','564','Concessions, brevets, licences, savoir-faire, marque et droits similaires',NULL,NULL,1),(570,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2110','569','Concessions, brevets, licences, marques, etc',NULL,NULL,1),(571,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2118','569','Plus-values actées sur concessions, etc',NULL,NULL,1),(572,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2119','569','Amortissements sur concessions, etc',NULL,NULL,1),(573,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','212','564','Goodwill',NULL,NULL,1),(574,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2120','573','Coût d\'acquisition',NULL,NULL,1),(575,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2128','573','Plus-values actées',NULL,NULL,1),(576,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2129','573','Amortissements sur goodwill',NULL,NULL,1),(577,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','213','564','Acomptes versés',NULL,NULL,1),(578,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22','1352','Terrains et constructions',NULL,NULL,1),(579,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','220','578','Terrains',NULL,NULL,1),(580,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2200','579','Terrains',NULL,NULL,1),(581,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2201','579','Frais d\'acquisition sur terrains',NULL,NULL,1),(582,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2208','579','Plus-values actées sur terrains',NULL,NULL,1),(583,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2209','579','Amortissements et réductions de valeur',NULL,NULL,1),(584,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22090','583','Amortissements sur frais d\'acquisition',NULL,NULL,1),(585,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22091','583','Réductions de valeur sur terrains',NULL,NULL,1),(586,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','221','578','Constructions',NULL,NULL,1),(587,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2210','586','Bâtiments industriels',NULL,NULL,1),(588,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2211','586','Bâtiments administratifs et commerciaux',NULL,NULL,1),(589,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2212','586','Autres bâtiments d\'exploitation',NULL,NULL,1),(590,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2213','586','Voies de transport et ouvrages d\'art',NULL,NULL,1),(591,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2215','586','Constructions sur sol d\'autrui',NULL,NULL,1),(592,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2216','586','Frais d\'acquisition sur constructions',NULL,NULL,1),(593,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2218','586','Plus-values actées',NULL,NULL,1),(594,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22180','593','Sur bâtiments industriels',NULL,NULL,1),(595,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22181','593','Sur bâtiments administratifs et commerciaux',NULL,NULL,1),(596,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22182','593','Sur autres bâtiments d\'exploitation',NULL,NULL,1),(597,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22184','593','Sur voies de transport et ouvrages d\'art',NULL,NULL,1),(598,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2219','586','Amortissements sur constructions',NULL,NULL,1),(599,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22190','598','Sur bâtiments industriels',NULL,NULL,1),(600,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22191','598','Sur bâtiments administratifs et commerciaux',NULL,NULL,1),(601,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22192','598','Sur autres bâtiments d\'exploitation',NULL,NULL,1),(602,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22194','598','Sur voies de transport et ouvrages d\'art',NULL,NULL,1),(603,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22195','598','Sur constructions sur sol d\'autrui',NULL,NULL,1),(604,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22196','598','Sur frais d\'acquisition sur constructions',NULL,NULL,1),(605,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','222','578','Terrains bâtis',NULL,NULL,1),(606,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2220','605','Valeur d\'acquisition',NULL,NULL,1),(607,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22200','606','Bâtiments industriels',NULL,NULL,1),(608,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22201','606','Bâtiments administratifs et commerciaux',NULL,NULL,1),(609,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22202','606','Autres bâtiments d\'exploitation',NULL,NULL,1),(610,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22203','606','Voies de transport et ouvrages d\'art',NULL,NULL,1),(611,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22204','606','Frais d\'acquisition des terrains à bâtir',NULL,NULL,1),(612,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2228','605','Plus-values actées',NULL,NULL,1),(613,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22280','612','Sur bâtiments industriels',NULL,NULL,1),(614,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22281','612','Sur bâtiments administratifs et commerciaux',NULL,NULL,1),(615,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22282','612','Sur autres bâtiments d\'exploitation',NULL,NULL,1),(616,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22283','612','Sur voies de transport et ouvrages d\'art',NULL,NULL,1),(617,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2229','605','Amortissements sur terrains bâtis',NULL,NULL,1),(618,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22290','617','Sur bâtiments industriels',NULL,NULL,1),(619,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22291','617','Sur bâtiments administratifs et commerciaux',NULL,NULL,1),(620,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22292','617','Sur autres bâtiments d\'exploitation',NULL,NULL,1),(621,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22293','617','Sur voies de transport et ouvrages d\'art',NULL,NULL,1),(622,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','22294','617','Sur frais d\'acquisition des terrains bâtis',NULL,NULL,1),(623,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','223','578','Autres droits réels sur des immeubles',NULL,NULL,1),(624,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2230','623','Valeur d\'acquisition',NULL,NULL,1),(625,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2238','623','Plus-values actées',NULL,NULL,1),(626,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2239','623','Amortissements',NULL,NULL,1),(627,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','23','1352','Installations, machines et outillages',NULL,NULL,1),(628,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','230','627','Installations',NULL,NULL,1),(629,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2300','628','Installations bâtiments industriels',NULL,NULL,1),(630,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2301','628','Installations bâtiments administratifs et commerciaux',NULL,NULL,1),(631,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2302','628','Installations bâtiments d\'exploitation',NULL,NULL,1),(632,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2303','628','Installations voies de transport et ouvrages d\'art',NULL,NULL,1),(633,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2300','628','Installation d\'eau',NULL,NULL,1),(634,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2301','628','Installation d\'électricité',NULL,NULL,1),(635,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2302','628','Installation de vapeur',NULL,NULL,1),(636,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2303','628','Installation de gaz',NULL,NULL,1),(637,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2304','628','Installation de chauffage',NULL,NULL,1),(638,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2305','628','Installation de conditionnement d\'air',NULL,NULL,1),(639,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2306','628','Installation de chargement',NULL,NULL,1),(640,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','231','627','Machines',NULL,NULL,1),(641,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2310','640','Division A',NULL,NULL,1),(642,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2311','640','Division B',NULL,NULL,1),(643,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2312','640','Division C',NULL,NULL,1),(644,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','237','627','Outillage',NULL,NULL,1),(645,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2370','644','Division A',NULL,NULL,1),(646,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2371','644','Division B',NULL,NULL,1),(647,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2372','644','Division C',NULL,NULL,1),(648,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','238','627','Plus-values actées',NULL,NULL,1),(649,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2380','648','Sur installations',NULL,NULL,1),(650,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2381','648','Sur machines',NULL,NULL,1),(651,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2382','648','Sur outillage',NULL,NULL,1),(652,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','239','627','Amortissements',NULL,NULL,1),(653,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2390','652','Sur installations',NULL,NULL,1),(654,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2391','652','Sur machines',NULL,NULL,1),(655,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2392','652','Sur outillage',NULL,NULL,1),(656,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24','1352','Mobilier et matériel roulant',NULL,NULL,1),(657,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','240','656','Mobilier',NULL,NULL,1),(658,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2400','656','Mobilier',NULL,NULL,1),(659,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24000','658','Mobilier des bâtiments industriels',NULL,NULL,1),(660,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24001','658','Mobilier des bâtiments administratifs et commerciaux',NULL,NULL,1),(661,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24002','658','Mobilier des autres bâtiments d\'exploitation',NULL,NULL,1),(662,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24003','658','Mobilier oeuvres sociales',NULL,NULL,1),(663,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2401','657','Matériel de bureau et de service social',NULL,NULL,1),(664,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24010','663','Des bâtiments industriels',NULL,NULL,1),(665,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24011','663','Des bâtiments administratifs et commerciaux',NULL,NULL,1),(666,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24012','663','Des autres bâtiments d\'exploitation',NULL,NULL,1),(667,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24013','663','Des oeuvres sociales',NULL,NULL,1),(668,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2408','657','Plus-values actées',NULL,NULL,1),(669,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24080','668','Plus-values actées sur mobilier',NULL,NULL,1),(670,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24081','668','Plus-values actées sur matériel de bureau et service social',NULL,NULL,1),(671,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2409','657','Amortissements',NULL,NULL,1),(672,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24090','671','Amortissements sur mobilier',NULL,NULL,1),(673,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24091','671','Amortissements sur matériel de bureau et service social',NULL,NULL,1),(674,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','241','656','Matériel roulant',NULL,NULL,1),(675,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2410','674','Matériel automobile',NULL,NULL,1),(676,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24100','675','Voitures',NULL,NULL,1),(677,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24105','675','Camions',NULL,NULL,1),(678,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2411','674','Matériel ferroviaire',NULL,NULL,1),(679,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2412','674','Matériel fluvial',NULL,NULL,1),(680,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2413','674','Matériel naval',NULL,NULL,1),(681,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2414','674','Matériel aérien',NULL,NULL,1),(682,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2418','674','Plus-values sur matériel roulant',NULL,NULL,1),(683,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24180','682','Plus-values sur matériel automobile',NULL,NULL,1),(684,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24181','682','Idem sur matériel ferroviaire',NULL,NULL,1),(685,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24182','682','Idem sur matériel fluvial',NULL,NULL,1),(686,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24183','682','Idem sur matériel naval',NULL,NULL,1),(687,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24184','682','Idem sur matériel aérien',NULL,NULL,1),(688,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2419','674','Amortissements sur matériel roulant',NULL,NULL,1),(689,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24190','688','Amortissements sur matériel automobile',NULL,NULL,1),(690,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24191','688','Idem sur matériel ferroviaire',NULL,NULL,1),(691,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24192','688','Idem sur matériel fluvial',NULL,NULL,1),(692,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24193','688','Idem sur matériel naval',NULL,NULL,1),(693,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','24194','688','Idem sur matériel aérien',NULL,NULL,1),(694,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','25','1352','Immobilisation détenues en location-financement et droits similaires',NULL,NULL,1),(695,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','250','694','Terrains et constructions',NULL,NULL,1),(696,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2500','695','Terrains',NULL,NULL,1),(697,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2501','695','Constructions',NULL,NULL,1),(698,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2508','695','Plus-values sur emphytéose, leasing et droits similaires : terrains et constructions',NULL,NULL,1),(699,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2509','695','Amortissements et réductions de valeur sur terrains et constructions en leasing',NULL,NULL,1),(700,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','251','694','Installations, machines et outillage',NULL,NULL,1),(701,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2510','700','Installations',NULL,NULL,1),(702,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2511','700','Machines',NULL,NULL,1),(703,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2512','700','Outillage',NULL,NULL,1),(704,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2518','700','Plus-values actées sur installations machines et outillage pris en leasing',NULL,NULL,1),(705,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2519','700','Amortissements sur installations machines et outillage pris en leasing',NULL,NULL,1),(706,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','252','694','Mobilier et matériel roulant',NULL,NULL,1),(707,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2520','706','Mobilier',NULL,NULL,1),(708,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2521','706','Matériel roulant',NULL,NULL,1),(709,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2528','706','Plus-values actées sur mobilier et matériel roulant en leasing',NULL,NULL,1),(710,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2529','706','Amortissements sur mobilier et matériel roulant en leasing',NULL,NULL,1),(711,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','26','1352','Autres immobilisations corporelles',NULL,NULL,1),(712,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','260','711','Frais d\'aménagements de locaux pris en location',NULL,NULL,1),(713,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','261','711','Maison d\'habitation',NULL,NULL,1),(714,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','262','711','Réserve immobilière',NULL,NULL,1),(715,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','263','711','Matériel d\'emballage',NULL,NULL,1),(716,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','264','711','Emballages récupérables',NULL,NULL,1),(717,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','268','711','Plus-values actées sur autres immobilisations corporelles',NULL,NULL,1),(718,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','269','711','Amortissements sur autres immobilisations corporelles',NULL,NULL,1),(719,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2690','718','Amortissements sur frais d\'aménagement des locaux pris en location',NULL,NULL,1),(720,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2691','718','Amortissements sur maison d\'habitation',NULL,NULL,1),(721,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2692','718','Amortissements sur réserve immobilière',NULL,NULL,1),(722,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2693','718','Amortissements sur matériel d\'emballage',NULL,NULL,1),(723,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2694','718','Amortissements sur emballages récupérables',NULL,NULL,1),(724,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','27','1352','Immobilisations corporelles en cours et acomptes versés',NULL,NULL,1),(725,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','270','724','Immobilisations en cours',NULL,NULL,1),(726,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2700','725','Constructions',NULL,NULL,1),(727,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2701','725','Installations machines et outillage',NULL,NULL,1),(728,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2702','725','Mobilier et matériel roulant',NULL,NULL,1),(729,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2703','725','Autres immobilisations corporelles',NULL,NULL,1),(730,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','271','724','Avances et acomptes versés sur immobilisations en cours',NULL,NULL,1),(731,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','28','1352','Immobilisations financières',NULL,NULL,1),(732,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','280','731','Participations dans des entreprises liées',NULL,NULL,1),(733,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2800','732','Valeur d\'acquisition (peut être subdivisé par participation)',NULL,NULL,1),(734,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2801','732','Montants non appelés (idem)',NULL,NULL,1),(735,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2808','732','Plus-values actées (idem)',NULL,NULL,1),(736,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2809','732','Réductions de valeurs actées (idem)',NULL,NULL,1),(737,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','281','731','Créances sur des entreprises liées',NULL,NULL,1),(738,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2810','737','Créances en compte',NULL,NULL,1),(739,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2811','737','Effets à recevoir',NULL,NULL,1),(740,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2812','737','Titres à revenu fixes',NULL,NULL,1),(741,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2817','737','Créances douteuses',NULL,NULL,1),(742,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2819','737','Réductions de valeurs actées',NULL,NULL,1),(743,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','282','731','Participations dans des entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(744,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2820','743','Valeur d\'acquisition (peut être subdivisé par participation)',NULL,NULL,1),(745,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2821','743','Montants non appelés (idem)',NULL,NULL,1),(746,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2828','743','Plus-values actées (idem)',NULL,NULL,1),(747,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2829','743','Réductions de valeurs actées (idem)',NULL,NULL,1),(748,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','283','731','Créances sur des entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(749,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2830','748','Créances en compte',NULL,NULL,1),(750,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2831','748','Effets à recevoir',NULL,NULL,1),(751,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2832','748','Titres à revenu fixe',NULL,NULL,1),(752,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2837','748','Créances douteuses',NULL,NULL,1),(753,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2839','748','Réductions de valeurs actées',NULL,NULL,1),(754,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','284','731','Autres actions et parts',NULL,NULL,1),(755,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2840','754','Valeur d\'acquisition',NULL,NULL,1),(756,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2841','754','Montants non appelés',NULL,NULL,1),(757,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2848','754','Plus-values actées',NULL,NULL,1),(758,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2849','754','Réductions de valeur actées',NULL,NULL,1),(759,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','285','731','Autres créances',NULL,NULL,1),(760,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2850','759','Créances en compte',NULL,NULL,1),(761,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2851','759','Effets à recevoir',NULL,NULL,1),(762,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2852','759','Titres à revenu fixe',NULL,NULL,1),(763,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2857','759','Créances douteuses',NULL,NULL,1),(764,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2859','759','Réductions de valeur actées',NULL,NULL,1),(765,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','288','731','Cautionnements versés en numéraires',NULL,NULL,1),(766,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2880','765','Téléphone, téléfax, télex',NULL,NULL,1),(767,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2881','765','Gaz',NULL,NULL,1),(768,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2882','765','Eau',NULL,NULL,1),(769,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2883','765','Electricité',NULL,NULL,1),(770,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2887','765','Autres cautionnements versés en numéraires',NULL,NULL,1),(771,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29','1352','Créances à plus d\'un an',NULL,NULL,1),(772,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','290','771','Créances commerciales',NULL,NULL,1),(773,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2900','772','Clients',NULL,NULL,1),(774,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29000','773','Créances en compte sur entreprises liées',NULL,NULL,1),(775,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29001','773','Sur entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(776,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29002','773','Sur clients Belgique',NULL,NULL,1),(777,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29003','773','Sur clients C.E.E.',NULL,NULL,1),(778,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29004','773','Sur clients exportation hors C.E.E.',NULL,NULL,1),(779,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29005','773','Créances sur les coparticipants (associations momentanées)',NULL,NULL,1),(780,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2901','772','Effets à recevoir',NULL,NULL,1),(781,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29010','780','Sur entreprises liées',NULL,NULL,1),(782,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29011','780','Sur entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(783,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29012','780','Sur clients Belgique',NULL,NULL,1),(784,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29013','780','Sur clients C.E.E.',NULL,NULL,1),(785,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29014','780','Sur clients exportation hors C.E.E.',NULL,NULL,1),(786,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2905','772','Retenues sur garanties',NULL,NULL,1),(787,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2906','772','Acomptes versés',NULL,NULL,1),(788,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2907','772','Créances douteuses (à ventiler comme clients 2900)',NULL,NULL,1),(789,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2909','772','Réductions de valeur actées (à ventiler comme clients 2900)',NULL,NULL,1),(790,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','291','771','Autres créances',NULL,NULL,1),(791,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2910','790','Créances en compte',NULL,NULL,1),(792,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29100','791','Sur entreprises liées',NULL,NULL,1),(793,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29101','791','Sur entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(794,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29102','791','Sur autres débiteurs',NULL,NULL,1),(795,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2911','790','Effets à recevoir',NULL,NULL,1),(796,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29110','795','Sur entreprises liées',NULL,NULL,1),(797,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29111','795','Sur entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(798,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','29112','795','Sur autres débiteurs',NULL,NULL,1),(799,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2912','790','Créances résultant de la cession d\'immobilisations données en leasing',NULL,NULL,1),(800,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2917','790','Créances douteuses',NULL,NULL,1),(801,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2919','790','Réductions de valeur actées',NULL,NULL,1),(802,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','30','1353','Approvisionnements - matières premières',NULL,NULL,1),(803,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','300','802','Valeur d\'acquisition',NULL,NULL,1),(804,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','309','802','Réductions de valeur actées',NULL,NULL,1),(805,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','31','1353','Approvsionnements et fournitures',NULL,NULL,1),(806,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','310','805','Valeur d\'acquisition',NULL,NULL,1),(807,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3100','806','Matières d\'approvisionnement',NULL,NULL,1),(808,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3101','806','Energie, charbon, coke, mazout, essence, propane',NULL,NULL,1),(809,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3102','806','Produits d\'entretien',NULL,NULL,1),(810,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3103','806','Fournitures diverses et petit outillage',NULL,NULL,1),(811,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3104','806','Imprimés et fournitures de bureau',NULL,NULL,1),(812,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3105','806','Fournitures de services sociaux',NULL,NULL,1),(813,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3106','806','Emballages commerciaux',NULL,NULL,1),(814,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','31060','813','Emballages perdus',NULL,NULL,1),(815,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','31061','813','Emballages récupérables',NULL,NULL,1),(816,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','319','805','Réductions de valeur actées',NULL,NULL,1),(817,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','32','1353','En cours de fabrication',NULL,NULL,1),(818,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','320','817','Valeur d\'acquisition',NULL,NULL,1),(819,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3200','818','Produits semi-ouvrés',NULL,NULL,1),(820,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3201','818','Produits en cours de fabrication',NULL,NULL,1),(821,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3202','818','Travaux en cours',NULL,NULL,1),(822,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3205','818','Déchets',NULL,NULL,1),(823,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3206','818','Rebuts',NULL,NULL,1),(824,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3209','818','Travaux en association momentanée',NULL,NULL,1),(825,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','329','817','Réductions de valeur actées',NULL,NULL,1),(826,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','33','1353','Produits finis',NULL,NULL,1),(827,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','330','826','Valeur d\'acquisition',NULL,NULL,1),(828,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3300','827','Produits finis',NULL,NULL,1),(829,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','339','826','Réductions de valeur actées',NULL,NULL,1),(830,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','34','1353','Marchandises',NULL,NULL,1),(831,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','340','830','Valeur d\'acquisition',NULL,NULL,1),(832,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3400','831','Groupe A',NULL,NULL,1),(833,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3401','831','Groupe B',NULL,NULL,1),(834,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3402','831','Groupe C',NULL,NULL,1),(835,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','349','830','Réductions de valeur actées',NULL,NULL,1),(836,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','35','1353','Immeubles destinés à la vente',NULL,NULL,1),(837,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','350','836','Valeur d\'acquisition',NULL,NULL,1),(838,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3500','837','Immeuble A',NULL,NULL,1),(839,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3501','837','Immeuble B',NULL,NULL,1),(840,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3502','837','Immeuble C',NULL,NULL,1),(841,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','351','836','Immeubles construits en vue de leur revente',NULL,NULL,1),(842,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3510','841','Immeuble A',NULL,NULL,1),(843,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3511','841','Immeuble B',NULL,NULL,1),(844,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3512','841','Immeuble C',NULL,NULL,1),(845,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','359','836','Réductions de valeurs actées',NULL,NULL,1),(846,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','36','1353','Acomptes versés sur achats pour stocks',NULL,NULL,1),(847,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','360','846','Acomptes versés (à ventiler éventuellement par catégorie)',NULL,NULL,1),(848,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','369','846','Réductions de valeur actées',NULL,NULL,1),(849,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','37','1353','Commandes en cours d\'exécution',NULL,NULL,1),(850,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','370','849','Valeur d\'acquisition',NULL,NULL,1),(851,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','371','849','Bénéfice pris en compte',NULL,NULL,1),(852,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','379','849','Réductions de valeur actées',NULL,NULL,1),(853,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','40','1354','Créances commerciales',NULL,NULL,1),(854,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','400','853','Clients',NULL,NULL,1),(855,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4007','854','Rabais, remises et ristournes à accorder et autres notes de crédit à établir',NULL,NULL,1),(856,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4008','854','Créances résultant de livraisons de biens (associations momentanées)',NULL,NULL,1),(857,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','401','853','Effets à recevoir',NULL,NULL,1),(858,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4010','857','Effets à recevoir',NULL,NULL,1),(859,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4013','857','Effets à l\'encaissement',NULL,NULL,1),(860,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4015','857','Effets à l\'escompte',NULL,NULL,1),(861,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','402','853','Clients, créances courantes, entreprises apparentées, administrateurs et gérants',NULL,NULL,1),(862,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4020','861','Entreprises liées',NULL,NULL,1),(863,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4021','861','Autres entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(864,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4022','861','Administrateurs et gérants d\'entreprise',NULL,NULL,1),(865,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','403','853','Effets à recevoir sur entreprises apparentées et administrateurs et gérants',NULL,NULL,1),(866,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4030','865','Entreprises liées',NULL,NULL,1),(867,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4031','865','Autres entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(868,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4032','865','Administrateurs et gérants de l\'entreprise',NULL,NULL,1),(869,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','404','853','Produits à recevoir (factures à établir)',NULL,NULL,1),(870,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','405','853','Clients : retenues sur garanties',NULL,NULL,1),(871,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','406','853','Acomptes versés',NULL,NULL,1),(872,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','407','853','Créances douteuses',NULL,NULL,1),(873,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','408','853','Compensation clients',NULL,NULL,1),(874,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','409','853','Réductions de valeur actées',NULL,NULL,1),(875,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','41','1354','Autres créances',NULL,NULL,1),(876,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','410','875','Capital appelé, non versé',NULL,NULL,1),(877,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4100','876','Appels de fonds',NULL,NULL,1),(878,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4101','876','Actionnaires défaillants',NULL,NULL,1),(879,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','411','875','T.V.A. à récupérer',NULL,NULL,1),(880,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4110','879','T.V.A. due',NULL,NULL,1),(881,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4111','879','T.V.A. déductible',NULL,NULL,1),(882,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4112','879','Compte courant administration T.V.A.',NULL,NULL,1),(883,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4118','879','Taxe d\'égalisation due',NULL,NULL,1),(884,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','412','875','Impôts et versements fiscaux à récupérer',NULL,NULL,1),(885,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4120','884','Impôts belges sur le résultat',NULL,NULL,1),(886,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4125','884','Autres impôts belges',NULL,NULL,1),(887,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4128','884','Impôts étrangers',NULL,NULL,1),(888,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','414','875','Produits à recevoir',NULL,NULL,1),(889,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','416','875','Créances diverses',NULL,NULL,1),(890,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4160','889','Associés (compte d\'apport en société)',NULL,NULL,1),(891,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4161','889','Avances et prêts au personnel',NULL,NULL,1),(892,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4162','889','Compte courant des associés en S.P.R.L.',NULL,NULL,1),(893,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4163','889','Compte courant des administrateurs et gérants',NULL,NULL,1),(894,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4164','889','Créances sur sociétés apparentées',NULL,NULL,1),(895,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4166','889','Emballages et matériel à rendre',NULL,NULL,1),(896,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4167','889','Etat et établissements publics',NULL,NULL,1),(897,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','41670','896','Subsides à recevoir',NULL,NULL,1),(898,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','41671','896','Autres créances',NULL,NULL,1),(899,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4168','889','Rabais, ristournes et remises à obtenir et autres avoirs non encore reçus',NULL,NULL,1),(900,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','417','875','Créances douteuses',NULL,NULL,1),(901,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','418','875','Cautionnements versés en numéraires',NULL,NULL,1),(902,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','419','875','Réductions de valeur actées',NULL,NULL,1),(903,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','42','1354','Dettes à plus d\'un an échéant dans l\'année',NULL,NULL,1),(904,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','420','903','Emprunts subordonnés',NULL,NULL,1),(905,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4200','904','Convertibles',NULL,NULL,1),(906,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4201','904','Non convertibles',NULL,NULL,1),(907,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','421','903','Emprunts obligataires non subordonnés',NULL,NULL,1),(908,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4210','907','Convertibles',NULL,NULL,1),(909,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4211','907','Non convertibles',NULL,NULL,1),(910,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','422','903','Dettes de location-financement et assimilées',NULL,NULL,1),(911,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4220','910','Financement de biens immobiliers',NULL,NULL,1),(912,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4221','910','Financement de biens mobiliers',NULL,NULL,1),(913,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','423','903','Etablissements de crédit',NULL,NULL,1),(914,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4230','913','Dettes en compte',NULL,NULL,1),(915,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4231','913','Promesses',NULL,NULL,1),(916,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4232','913','Crédits d\'acceptation',NULL,NULL,1),(917,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','424','903','Autres emprunts',NULL,NULL,1),(918,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','425','903','Dettes commerciales',NULL,NULL,1),(919,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4250','918','Fournisseurs',NULL,NULL,1),(920,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4251','918','Effets à payer',NULL,NULL,1),(921,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','426','903','Cautionnements reçus en numéraires',NULL,NULL,1),(922,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','429','903','Dettes diverses',NULL,NULL,1),(923,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4290','922','Entreprises liées',NULL,NULL,1),(924,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4291','922','Entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(925,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4292','922','Administrateurs, gérants, associés',NULL,NULL,1),(926,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4299','922','Autres dettes',NULL,NULL,1),(927,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','43','1354','Dettes financières',NULL,NULL,1),(928,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','430','927','Etablissements de crédit. Emprunts en compte à terme fixe',NULL,NULL,1),(929,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','431','927','Etablissements de crédit. Promesses',NULL,NULL,1),(930,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','432','927','Etablissements de crédit. Crédits d\'acceptation',NULL,NULL,1),(931,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','433','927','Etablissements de crédit. Dettes en compte courant',NULL,NULL,1),(932,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','439','927','Autres emprunts',NULL,NULL,1),(933,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','44','1354','Dettes commerciales',NULL,NULL,1),(934,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','440','933','Fournisseurs',NULL,NULL,1),(935,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4400','934','Entreprises apparentées',NULL,NULL,1),(936,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','44000','935','Entreprises liées',NULL,NULL,1),(937,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','44001','935','Entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(938,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4401','934','Fournisseurs ordinaires',NULL,NULL,1),(939,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','44010','938','Fournisseurs belges',NULL,NULL,1),(940,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','44011','938','Fournisseurs CEE',NULL,NULL,1),(941,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','44012','938','Fournisseurs importation',NULL,NULL,1),(942,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4402','934','Dettes envers les coparticipants (associations momentanées)',NULL,NULL,1),(943,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4403','934','Fournisseurs - retenues de garanties',NULL,NULL,1),(944,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','441','933','Effets à payer',NULL,NULL,1),(945,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4410','944','Entreprises apparentées',NULL,NULL,1),(946,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','44100','945','Entreprises liées',NULL,NULL,1),(947,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','44101','945','Entreprises avec lesquelles il existe un lien de participation',NULL,NULL,1),(948,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4411','944','Fournisseurs ordinaires',NULL,NULL,1),(949,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','44110','948','Fournisseurs belges',NULL,NULL,1),(950,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','44111','948','Fournisseurs CEE',NULL,NULL,1),(951,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','44112','948','Fournisseurs importation',NULL,NULL,1),(952,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','444','933','Factures à recevoir',NULL,NULL,1),(953,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','446','933','Acomptes reçus',NULL,NULL,1),(954,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','448','933','Compensations fournisseurs',NULL,NULL,1),(955,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','45','1354','Dettes fiscales, salariales et sociales',NULL,NULL,1),(956,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','450','955','Dettes fiscales estimées',NULL,NULL,1),(957,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4501','956','Impôts sur le résultat',NULL,NULL,1),(958,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4505','956','Autres impôts en Belgique',NULL,NULL,1),(959,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4508','956','Impôts à l\'étranger',NULL,NULL,1),(960,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','451','955','T.V.A. à payer',NULL,NULL,1),(961,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4510','960','T.V.A. due',NULL,NULL,1),(962,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4511','960','T.V.A. déductible',NULL,NULL,1),(963,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4512','960','Compte courant administration T.V.A.',NULL,NULL,1),(964,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4518','960','Taxe d\'égalisation due',NULL,NULL,1),(965,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','452','955','Impôts et taxes à payer',NULL,NULL,1),(966,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4520','965','Autres impôts sur le résultat',NULL,NULL,1),(967,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4525','965','Autres impôts et taxes en Belgique',NULL,NULL,1),(968,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','45250','967','Précompte immobilier',NULL,NULL,1),(969,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','45251','967','Impôts communaux à payer',NULL,NULL,1),(970,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','45252','967','Impôts provinciaux à payer',NULL,NULL,1),(971,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','45253','967','Autres impôts et taxes à payer',NULL,NULL,1),(972,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4528','965','Impôts et taxes à l\'étranger',NULL,NULL,1),(973,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','453','955','Précomptes retenus',NULL,NULL,1),(974,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4530','973','Précompte professionnel retenu sur rémunérations',NULL,NULL,1),(975,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4531','973','Précompte professionnel retenu sur tantièmes',NULL,NULL,1),(976,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4532','973','Précompte mobilier retenu sur dividendes attribués',NULL,NULL,1),(977,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4533','973','Précompte mobilier retenu sur intérêts payés',NULL,NULL,1),(978,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4538','973','Autres précomptes retenus',NULL,NULL,1),(979,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','454','955','Office National de la Sécurité Sociale',NULL,NULL,1),(980,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4540','979','Arriérés',NULL,NULL,1),(981,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4541','979','1er trimestre',NULL,NULL,1),(982,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4542','979','2ème trimestre',NULL,NULL,1),(983,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4543','979','3ème trimestre',NULL,NULL,1),(984,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4544','979','4ème trimestre',NULL,NULL,1),(985,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','455','955','Rémunérations',NULL,NULL,1),(986,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4550','985','Administrateurs, gérants et commissaires (non réviseurs)',NULL,NULL,1),(987,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4551','985','Direction',NULL,NULL,1),(988,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4552','985','Employés',NULL,NULL,1),(989,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4553','985','Ouvriers',NULL,NULL,1),(990,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','456','955','Pécules de vacances',NULL,NULL,1),(991,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4560','990','Direction',NULL,NULL,1),(992,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4561','990','Employés',NULL,NULL,1),(993,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4562','990','Ouvriers',NULL,NULL,1),(994,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','459','955','Autres dettes sociales',NULL,NULL,1),(995,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4590','994','Provision pour gratifications de fin d\'année',NULL,NULL,1),(996,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4591','994','Départs de personnel',NULL,NULL,1),(997,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4592','994','Oppositions sur rémunérations',NULL,NULL,1),(998,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4593','994','Assurances relatives au personnel',NULL,NULL,1),(999,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','45930','998','Assurance loi',NULL,NULL,1),(1000,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','45931','998','Assurance salaire garanti',NULL,NULL,1),(1001,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','45932','998','Assurance groupe',NULL,NULL,1),(1002,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','45933','998','Assurances individuelles',NULL,NULL,1),(1003,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4594','994','Caisse d\'assurances sociales pour travailleurs indépendants',NULL,NULL,1),(1004,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4597','994','Dettes et provisions sociales diverses',NULL,NULL,1),(1005,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','46','1354','Acomptes reçus sur commande',NULL,NULL,1),(1006,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','47','1354','Dettes découlant de l\'affectation des résultats',NULL,NULL,1),(1007,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','470','1006','Dividendes et tantièmes d\'exercices antérieurs',NULL,NULL,1),(1008,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','471','1006','Dividendes de l\'exercice',NULL,NULL,1),(1009,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','472','1006','Tantièmes de l\'exercice',NULL,NULL,1),(1010,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','473','1006','Autres allocataires',NULL,NULL,1),(1011,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','48','4','Dettes diverses',NULL,NULL,1),(1012,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','480','1011','Obligations et coupons échus',NULL,NULL,1),(1013,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','481','1011','Actionnaires - capital à rembourser',NULL,NULL,1),(1014,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','482','1011','Participation du personnel à payer',NULL,NULL,1),(1015,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','483','1011','Acomptes reçus d\'autres tiers à moins d\'un an',NULL,NULL,1),(1016,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','486','1011','Emballages et matériel consignés',NULL,NULL,1),(1017,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','488','1011','Cautionnements reçus en numéraires',NULL,NULL,1),(1018,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','489','1011','Autres dettes diverses',NULL,NULL,1),(1019,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','49','1354','Comptes de régularisation et compte d\'attente',NULL,NULL,1),(1020,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','490','1019','Charges à reporter (à subdiviser par catégorie de charges)',NULL,NULL,1),(1021,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','491','1019','Produits acquis',NULL,NULL,1),(1022,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4910','1021','Produits d\'exploitation',NULL,NULL,1),(1023,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','49100','1022','Ristournes et rabais à obtenir',NULL,NULL,1),(1024,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','49101','1022','Commissions à obtenir',NULL,NULL,1),(1025,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','49102','1022','Autres produits d\'exploitation (redevances par exemple)',NULL,NULL,1),(1026,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4911','1021','Produits financiers',NULL,NULL,1),(1027,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','49110','1026','Intérêts courus et non échus sur prêts et débits',NULL,NULL,1),(1028,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','49111','1026','Autres produits financiers',NULL,NULL,1),(1029,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','492','1019','Charges à imputer (à subdiviser par catégorie de charges)',NULL,NULL,1),(1030,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','493','1019','Produits à reporter',NULL,NULL,1),(1031,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4930','1030','Produits d\'exploitation à reporter',NULL,NULL,1),(1032,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4931','1030','Produits financiers à reporter',NULL,NULL,1),(1033,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','499','1019','Comptes d\'attente',NULL,NULL,1),(1034,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4990','1033','Compte d\'attente',NULL,NULL,1),(1035,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4991','1033','Compte de répartition périodique des charges',NULL,NULL,1),(1036,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4999','1033','Transferts d\'exercice',NULL,NULL,1),(1037,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','50','1355','Actions propres',NULL,NULL,1),(1038,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','51','1355','Actions et parts',NULL,NULL,1),(1039,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','510','1038','Valeur d\'acquisition',NULL,NULL,1),(1040,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','511','1038','Montants non appelés',NULL,NULL,1),(1041,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','519','1038','Réductions de valeur actées',NULL,NULL,1),(1042,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','52','1355','Titres à revenus fixes',NULL,NULL,1),(1043,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','520','1042','Valeur d\'acquisition',NULL,NULL,1),(1044,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','529','1042','Réductions de valeur actées',NULL,NULL,1),(1045,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','53','1355','Dépots à terme',NULL,NULL,1),(1046,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','530','1045','De plus d\'un an',NULL,NULL,1),(1047,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','531','1045','De plus d\'un mois et à un an au plus',NULL,NULL,1),(1048,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','532','1045','d\'un mois au plus',NULL,NULL,1),(1049,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','539','1045','Réductions de valeur actées',NULL,NULL,1),(1050,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','54','1355','Valeurs échues à l\'encaissement',NULL,NULL,1),(1051,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','540','1050','Chèques à encaisser',NULL,NULL,1),(1052,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','541','1050','Coupons à encaisser',NULL,NULL,1),(1053,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','55','1355','Etablissements de crédit - Comptes ouverts auprès des divers établissements.',NULL,NULL,1),(1054,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','550','1053','Comptes courants',NULL,NULL,1),(1055,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','551','1053','Chèques émis',NULL,NULL,1),(1056,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','559','1053','Réductions de valeur actées',NULL,NULL,1),(1057,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','56','1355','Office des chèques postaux',NULL,NULL,1),(1058,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','560','1057','Compte courant',NULL,NULL,1),(1059,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','561','1057','Chèques émis',NULL,NULL,1),(1060,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','57','1355','Caisses',NULL,NULL,1),(1061,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','570','1060','à 577 Caisses - espèces ( 0 - centrale ; 7 - succursales et agences)',NULL,NULL,1),(1062,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','578','1060','Caisses - timbres ( 0 - fiscaux ; 1 - postaux)',NULL,NULL,1),(1063,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','58','1355','Virements internes',NULL,NULL,1),(1064,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','60','1356','Approvisionnements et marchandises',NULL,NULL,1),(1065,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','600','1064','Achats de matières premières',NULL,NULL,1),(1066,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','601','1064','Achats de fournitures',NULL,NULL,1),(1067,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','602','1064','Achats de services, travaux et études',NULL,NULL,1),(1068,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','603','1064','Sous-traitances générales',NULL,NULL,1),(1069,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','604','1064','Achats de marchandises',NULL,NULL,1),(1070,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','605','1064','Achats d\'immeubles destinés à la revente',NULL,NULL,1),(1071,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','608','1064','Remises , ristournes et rabais obtenus sur achats',NULL,NULL,1),(1072,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','609','1064','Variations de stocks',NULL,NULL,1),(1073,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6090','1072','De matières premières',NULL,NULL,1),(1074,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6091','1072','De fournitures',NULL,NULL,1),(1075,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6094','1072','De marchandises',NULL,NULL,1),(1076,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6095','1072','d\'immeubles destinés à la vente',NULL,NULL,1),(1077,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61','1356','Services et biens divers',NULL,NULL,1),(1078,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','610','1077','Loyers et charges locatives',NULL,NULL,1),(1079,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6100','1078','Loyers divers',NULL,NULL,1),(1080,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6101','1078','Charges locatives (assurances, frais de confort,etc)',NULL,NULL,1),(1081,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','611','1077','Entretien et réparation (fournitures et prestations)',NULL,NULL,1),(1082,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','612','1077','Fournitures faites à l\'entreprise',NULL,NULL,1),(1083,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6120','1082','Eau, gaz, électricité, vapeur',NULL,NULL,1),(1084,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61200','1083','Eau',NULL,NULL,1),(1085,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61201','1083','Gaz',NULL,NULL,1),(1086,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61202','1083','Electricité',NULL,NULL,1),(1087,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61203','1083','Vapeur',NULL,NULL,1),(1088,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6121','1082','Téléphone, télégrammes, télex, téléfax, frais postaux',NULL,NULL,1),(1089,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61210','1088','Téléphone',NULL,NULL,1),(1090,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61211','1088','Télégrammes',NULL,NULL,1),(1091,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61212','1088','Télex et téléfax',NULL,NULL,1),(1092,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61213','1088','Frais postaux',NULL,NULL,1),(1093,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6122','1082','Livres, bibliothèque',NULL,NULL,1),(1094,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6123','1082','Imprimés et fournitures de bureau (si non comptabilisé au 601)',NULL,NULL,1),(1095,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','613','1077','Rétributions de tiers',NULL,NULL,1),(1096,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6130','1095','Redevances et royalties',NULL,NULL,1),(1097,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61300','1096','Redevances pour brevets, licences, marques et accessoires',NULL,NULL,1),(1098,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61301','1096','Autres redevances (procédés de fabrication)',NULL,NULL,1),(1099,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6131','1095','Assurances non relatives au personnel',NULL,NULL,1),(1100,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61310','1099','Assurance incendie',NULL,NULL,1),(1101,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61311','1099','Assurance vol',NULL,NULL,1),(1102,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61312','1099','Assurance autos',NULL,NULL,1),(1103,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61313','1099','Assurance crédit',NULL,NULL,1),(1104,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61314','1099','Assurances frais généraux',NULL,NULL,1),(1105,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6132','1095','Divers',NULL,NULL,1),(1106,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61320','1105','Commissions aux tiers',NULL,NULL,1),(1107,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61321','1105','Honoraires d\'avocats, d\'experts, etc',NULL,NULL,1),(1108,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61322','1105','Cotisations aux groupements professionnels',NULL,NULL,1),(1109,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61323','1105','Dons, libéralités, etc',NULL,NULL,1),(1110,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61324','1105','Frais de contentieux',NULL,NULL,1),(1111,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61325','1105','Publications légales',NULL,NULL,1),(1112,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6133','1095','Transports et déplacements',NULL,NULL,1),(1113,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61330','1112','Transports de personnel',NULL,NULL,1),(1114,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','61331','1112','Voyages, déplacements et représentations',NULL,NULL,1),(1115,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6134','1095','Personnel intérimaire',NULL,NULL,1),(1116,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','614','1077','Annonces, publicité, propagande et documentation',NULL,NULL,1),(1117,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6140','1116','Annonces et insertions',NULL,NULL,1),(1118,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6141','1116','Catalogues et imprimés',NULL,NULL,1),(1119,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6142','1116','Echantillons',NULL,NULL,1),(1120,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6143','1116','Foires et expositions',NULL,NULL,1),(1121,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6144','1116','Primes',NULL,NULL,1),(1122,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6145','1116','Cadeaux à la clientèle',NULL,NULL,1),(1123,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6146','1116','Missions et réceptions',NULL,NULL,1),(1124,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6147','1116','Documentation',NULL,NULL,1),(1125,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','615','1077','Sous-traitants',NULL,NULL,1),(1126,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6150','1125','Sous-traitants pour activités propres',NULL,NULL,1),(1127,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6151','1125','Sous-traitants d\'associations momentanées (coparticipants)',NULL,NULL,1),(1128,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6152','1125','Quote-part bénéficiaire des coparticipants',NULL,NULL,1),(1129,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','617','1077','Personnel intérimaire et personnes mises à la disposition de l\'entreprise',NULL,NULL,1),(1130,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','618','1077','Rémunérations, primes pour assurances extralégales, pensions de retraite et de survie des administrateurs, gérants et associés actifs qui ne sont pas attribuées en vertu d\'un contrat de travail',NULL,NULL,1),(1131,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','62','1356','Rémunérations, charges sociales et pensions',NULL,NULL,1),(1132,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','620','1131','Rémunérations et avantages sociaux directs',NULL,NULL,1),(1133,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6200','1132','Administrateurs ou gérants',NULL,NULL,1),(1134,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6201','1132','Personnel de direction',NULL,NULL,1),(1135,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6202','1132','Employés',NULL,NULL,1),(1136,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6203','1132','Ouvriers',NULL,NULL,1),(1137,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6204','1132','Autres membres du personnel',NULL,NULL,1),(1138,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','621','1131','Cotisations patronales d\'assurances sociales',NULL,NULL,1),(1139,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6210','1138','Sur salaires',NULL,NULL,1),(1140,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6211','1138','Sur appointements et commissions',NULL,NULL,1),(1141,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','622','1131','Primes patronales pour assurances extralégales',NULL,NULL,1),(1142,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','623','1131','Autres frais de personnel',NULL,NULL,1),(1143,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6230','1142','Assurances du personnel',NULL,NULL,1),(1144,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','62300','1143','Assurances loi, responsabilité civile, chemin du travail',NULL,NULL,1),(1145,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','62301','1143','Assurance salaire garanti',NULL,NULL,1),(1146,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','62302','1143','Assurances individuelles',NULL,NULL,1),(1147,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6231','1142','Charges sociales diverses',NULL,NULL,1),(1148,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','62310','1147','Jours fériés payés',NULL,NULL,1),(1149,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','62311','1147','Salaire hebdomadaire garanti',NULL,NULL,1),(1150,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','62312','1147','Allocations familiales complémentaires',NULL,NULL,1),(1151,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6232','1142','Charges sociales des administrateurs, gérants et commissaires',NULL,NULL,1),(1152,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','62320','1151','Allocations familiales complémentaires pour non salariés',NULL,NULL,1),(1153,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','62321','1151','Lois sociales pour indépendants',NULL,NULL,1),(1154,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','62322','1151','Divers',NULL,NULL,1),(1155,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','624','1131','Pensions de retraite et de survie',NULL,NULL,1),(1156,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6240','1155','Administrateurs et gérants',NULL,NULL,1),(1157,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6241','1155','Personnel',NULL,NULL,1),(1158,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','625','1131','Provision pour pécule de vacances',NULL,NULL,1),(1159,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6250','1158','Dotations',NULL,NULL,1),(1160,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6251','1158','Utilisations et reprises',NULL,NULL,1),(1161,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','63','1356','Amortissements, réductions de valeur et provisions pour risques et charges',NULL,NULL,1),(1162,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','630','1161','Dotations aux amortissements et aux réductions de valeur sur immobilisations',NULL,NULL,1),(1163,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6300','1162','Dotations aux amortissements sur frais d\'établissement',NULL,NULL,1),(1164,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6301','1162','Dotations aux amortissements sur immobilisations incorporelles',NULL,NULL,1),(1165,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6302','1162','Dotations aux amortissements sur immobilisations corporelles',NULL,NULL,1),(1166,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6308','1162','Dotations aux réductions de valeur sur immobilisations incorporelles',NULL,NULL,1),(1167,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6309','1162','Dotations aux réductions de valeur sur immobilisations corporelles',NULL,NULL,1),(1168,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','631','1161','Réductions de valeur sur stocks',NULL,NULL,1),(1169,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6310','1168','Dotations',NULL,NULL,1),(1170,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6311','1168','Reprises',NULL,NULL,1),(1171,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','632','1161','Réductions de valeur sur commandes en cours d\'exécution',NULL,NULL,1),(1172,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6320','1171','Dotations',NULL,NULL,1),(1173,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6321','1171','Reprises',NULL,NULL,1),(1174,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','633','1161','Réductions de valeur sur créances commerciales à plus d\'un an',NULL,NULL,1),(1175,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6330','1174','Dotations',NULL,NULL,1),(1176,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6331','1174','Reprises',NULL,NULL,1),(1177,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','634','1161','Réductions de valeur sur créances commerciales à un an au plus',NULL,NULL,1),(1178,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6340','1177','Dotations',NULL,NULL,1),(1179,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6341','1177','Reprises',NULL,NULL,1),(1180,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','635','1161','Provisions pour pensions et obligations similaires',NULL,NULL,1),(1181,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6350','1180','Dotations',NULL,NULL,1),(1182,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6351','1180','Utilisations et reprises',NULL,NULL,1),(1183,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','636','11613','Provisions pour grosses réparations et gros entretiens',NULL,NULL,1),(1184,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6360','1183','Dotations',NULL,NULL,1),(1185,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6361','1183','Utilisations et reprises',NULL,NULL,1),(1186,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','637','1161','Provisions pour autres risques et charges',NULL,NULL,1),(1187,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6370','1186','Dotations',NULL,NULL,1),(1188,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6371','1186','Utilisations et reprises',NULL,NULL,1),(1189,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','64','1356','Autres charges d\'exploitation',NULL,NULL,1),(1190,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','640','1189','Charges fiscales d\'exploitation',NULL,NULL,1),(1191,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6400','1190','Taxes et impôts directs',NULL,NULL,1),(1192,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','64000','1191','Taxes sur autos et camions',NULL,NULL,1),(1193,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6401','1190','Taxes et impôts indirects',NULL,NULL,1),(1194,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','64010','1193','Timbres fiscaux pris en charge par la firme',NULL,NULL,1),(1195,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','64011','1193','Droits d\'enregistrement',NULL,NULL,1),(1196,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','64012','1193','T.V.A. non déductible',NULL,NULL,1),(1197,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6402','1190','Impôts provinciaux et communaux',NULL,NULL,1),(1198,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','64020','1197','Taxe sur la force motrice',NULL,NULL,1),(1199,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','64021','1197','Taxe sur le personnel occupé',NULL,NULL,1),(1200,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6403','1190','Taxes diverses',NULL,NULL,1),(1201,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','641','1189','Moins-values sur réalisations courantes d\'immobilisations corporelles',NULL,NULL,1),(1202,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','642','1189','Moins-values sur réalisations de créances commerciales',NULL,NULL,1),(1203,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','643','1189','à 648 Charges d\'exploitations diverses',NULL,NULL,1),(1204,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','649','1189','Charges d\'exploitation portées à l\'actif au titre de restructuration',NULL,NULL,1),(1205,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','65','1356','Charges financières',NULL,NULL,1),(1206,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','650','1205','Charges des dettes',NULL,NULL,1),(1207,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6500','1206','Intérêts, commissions et frais afférents aux dettes',NULL,NULL,1),(1208,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6501','1206','Amortissements des agios et frais d\'émission d\'emprunts',NULL,NULL,1),(1209,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6502','1206','Autres charges de dettes',NULL,NULL,1),(1210,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6503','1206','Intérêts intercalaires portés à l\'actif',NULL,NULL,1),(1211,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','651','1205','Réductions de valeur sur actifs circulants',NULL,NULL,1),(1212,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6510','1211','Dotations',NULL,NULL,1),(1213,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6511','1211','Reprises',NULL,NULL,1),(1214,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','652','1205','Moins-values sur réalisation d\'actifs circulants',NULL,NULL,1),(1215,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','653','1205','Charges d\'escompte de créances',NULL,NULL,1),(1216,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','654','1205','Différences de change',NULL,NULL,1),(1217,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','655','1205','Ecarts de conversion des devises',NULL,NULL,1),(1218,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','656','1205','Frais de banques, de chèques postaux',NULL,NULL,1),(1219,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','657','1205','Commissions sur ouvertures de crédit, cautions et avals',NULL,NULL,1),(1220,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','658','1205','Frais de vente des titres',NULL,NULL,1),(1221,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','66','1356','Charges exceptionnelles',NULL,NULL,1),(1222,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','660','1221','Amortissements et réductions de valeur exceptionnels',NULL,NULL,1),(1223,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6600','1222','Sur frais d\'établissement',NULL,NULL,1),(1224,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6601','1222','Sur immobilisations incorporelles',NULL,NULL,1),(1225,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6602','1222','Sur immobilisations corporelles',NULL,NULL,1),(1226,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','661','1221','Réductions de valeur sur immobilisations financières',NULL,NULL,1),(1227,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','662','1221','Provisions pour risques et charges exceptionnels',NULL,NULL,1),(1228,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','663','1221','Moins-values sur réalisation d\'actifs immobilisés',NULL,NULL,1),(1229,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6630','1228','Sur immobilisations incorporelles',NULL,NULL,1),(1230,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6631','1228','Sur immobilisations corporelles',NULL,NULL,1),(1231,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6632','1228','Sur immobilisations détenues en location-financement et droits similaires',NULL,NULL,1),(1232,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6633','1228','Sur immobilisations financières',NULL,NULL,1),(1233,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6634','1228','Sur immeubles acquis ou construits en vue de la revente',NULL,NULL,1),(1234,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','664','1221','à 668 Autres charges exceptionnelles',NULL,NULL,1),(1235,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','664','1221','Pénalités et amendes diverses',NULL,NULL,1),(1236,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','665','1221','Différence de charge',NULL,NULL,1),(1237,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','669','1221','Charges exceptionnelles transférées à l\'actif en frais de restructuration',NULL,NULL,1),(1238,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','67','1356','Impôts sur le résultat',NULL,NULL,1),(1239,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','670','1238','Impôts belges sur le résultat de l\'exercice',NULL,NULL,1),(1240,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6700','1239','Impôts et précomptes dus ou versés',NULL,NULL,1),(1241,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6701','1239','Excédent de versements d\'impôts et précomptes porté à l\'actif',NULL,NULL,1),(1242,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6702','1239','Charges fiscales estimées',NULL,NULL,1),(1243,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','671','1238','Impôts belges sur le résultat d\'exercices antérieurs',NULL,NULL,1),(1244,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6710','1243','Suppléments d\'impôts dus ou versés',NULL,NULL,1),(1245,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6711','1243','Suppléments d\'impôts estimés',NULL,NULL,1),(1246,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6712','1243','Provisions fiscales constituées',NULL,NULL,1),(1247,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','672','1238','Impôts étrangers sur le résultat de l\'exercice',NULL,NULL,1),(1248,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','673','1238','Impôts étrangers sur le résultat d\'exercices antérieurs',NULL,NULL,1),(1249,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','68','1356','Transferts aux réserves immunisées',NULL,NULL,1),(1250,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','69','1356','Affectation des résultats',NULL,NULL,1),(1251,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','690','1250','Perte reportée de l\'exercice précédent',NULL,NULL,1),(1252,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','691','1250','Dotation à la réserve légale',NULL,NULL,1),(1253,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','692','1250','Dotation aux autres réserves',NULL,NULL,1),(1254,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','693','1250','Bénéfice à reporter',NULL,NULL,1),(1255,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','694','1250','Rémunération du capital',NULL,NULL,1),(1256,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','695','1250','Administrateurs ou gérants',NULL,NULL,1),(1257,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','696','1250','Autres allocataires',NULL,NULL,1),(1258,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','70','1357','Chiffre d\'affaires',NULL,NULL,1),(1260,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','700','1258','Ventes de marchandises',NULL,NULL,1),(1261,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7000','1260','Ventes en Belgique',NULL,NULL,1),(1262,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7001','1260','Ventes dans les pays membres de la C.E.E.',NULL,NULL,1),(1263,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7002','1260','Ventes à l\'exportation',NULL,NULL,1),(1264,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','701','1258','Ventes de produits finis',NULL,NULL,1),(1265,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7010','1264','Ventes en Belgique',NULL,NULL,1),(1266,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7011','1264','Ventes dans les pays membres de la C.E.E.',NULL,NULL,1),(1267,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7012','1264','Ventes à l\'exportation',NULL,NULL,1),(1268,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','702','1258','Ventes de déchets et rebuts',NULL,NULL,1),(1269,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7020','1268','Ventes en Belgique',NULL,NULL,1),(1270,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7021','1268','Ventes dans les pays membres de la C.E.E.',NULL,NULL,1),(1271,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7022','1268','Ventes à l\'exportation',NULL,NULL,1),(1272,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','703','1258','Ventes d\'emballages récupérables',NULL,NULL,1),(1273,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','704','1258','Facturations des travaux en cours (associations momentanées)',NULL,NULL,1),(1274,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','705','1258','Prestations de services',NULL,NULL,1),(1275,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7050','1274','Prestations de services en Belgique',NULL,NULL,1),(1276,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7051','1274','Prestations de services dans les pays membres de la C.E.E.',NULL,NULL,1),(1277,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7052','1274','Prestations de services en vue de l\'exportation',NULL,NULL,1),(1278,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','706','1258','Pénalités et dédits obtenus par l\'entreprise',NULL,NULL,1),(1279,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','708','1258','Remises, ristournes et rabais accordés',NULL,NULL,1),(1280,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7080','1279','Sur ventes de marchandises',NULL,NULL,1),(1281,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7081','1279','Sur ventes de produits finis',NULL,NULL,1),(1282,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7082','1279','Sur ventes de déchets et rebuts',NULL,NULL,1),(1283,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7083','1279','Sur prestations de services',NULL,NULL,1),(1284,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7084','1279','Mali sur travaux facturés aux associations momentanées',NULL,NULL,1),(1285,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','71','1357','Variation des stocks et des commandes en cours d\'exécution',NULL,NULL,1),(1286,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','712','1285','Des en cours de fabrication',NULL,NULL,1),(1287,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','713','1285','Des produits finis',NULL,NULL,1),(1288,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','715','1285','Des immeubles construits destinés à la vente',NULL,NULL,1),(1289,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','717','1285','Des commandes en cours d\'exécution',NULL,NULL,1),(1290,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7170','1289','Commandes en cours - Coût de revient',NULL,NULL,1),(1291,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','71700','1290','Coût des commandes en cours d\'exécution',NULL,NULL,1),(1292,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','71701','1290','Coût des travaux en cours des associations momentanées',NULL,NULL,1),(1293,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7171','1289','Bénéfices portés en compte sur commandes en cours',NULL,NULL,1),(1294,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','71710','1293','Sur commandes en cours d\'exécution',NULL,NULL,1),(1295,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','71711','1293','Sur travaux en cours des associations momentanées',NULL,NULL,1),(1296,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','72','1357','Production immobilisée',NULL,NULL,1),(1297,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','720','1296','En frais d\'établissement',NULL,NULL,1),(1298,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','721','1296','En immobilisations incorporelles',NULL,NULL,1),(1299,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','722','1296','En immobilisations corporelles',NULL,NULL,1),(1300,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','723','1296','En immobilisations en cours',NULL,NULL,1),(1301,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','74','1357','Autres produits d\'exploitation',NULL,NULL,1),(1302,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','740','1301','Subsides d\'exploitation et montants compensatoires',NULL,NULL,1),(1303,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','741','1301','Plus-values sur réalisations courantes d\'immobilisations corporelles',NULL,NULL,1),(1304,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','742','1301','Plus-values sur réalisations de créances commerciales',NULL,NULL,1),(1305,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','743','1301','à 749 Produits d\'exploitation divers',NULL,NULL,1),(1306,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','743','1301','Produits de services exploités dans l\'intérêt du personnel',NULL,NULL,1),(1307,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','744','1301','Commissions et courtages',NULL,NULL,1),(1308,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','745','1301','Redevances pour brevets et licences',NULL,NULL,1),(1309,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','746','1301','Prestations de services (transports, études, etc)',NULL,NULL,1),(1310,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','747','1301','Revenus des immeubles affectés aux activités non professionnelles',NULL,NULL,1),(1311,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','748','1301','Locations diverses à caractère professionnel',NULL,NULL,1),(1312,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','749','1301','Produits divers',NULL,NULL,1),(1313,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7490','1312','Bonis sur reprises d\'emballages consignés',NULL,NULL,1),(1314,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7491','1312','Bonis sur travaux en associations momentanées',NULL,NULL,1),(1315,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','75','1357','Produits financiers',NULL,NULL,1),(1316,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','750','1315','Produits des immobilisations financières',NULL,NULL,1),(1317,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7500','1316','Revenus des actions',NULL,NULL,1),(1318,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7501','1316','Revenus des obligations',NULL,NULL,1),(1319,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7502','1316','Revenus des créances à plus d\'un an',NULL,NULL,1),(1320,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','751','1315','Produits des actifs circulants',NULL,NULL,1),(1321,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','752','1315','Plus-values sur réalisations d\'actifs circulants',NULL,NULL,1),(1322,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','753','1315','Subsides en capital et en intérêts',NULL,NULL,1),(1323,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','754','1315','Différences de change',NULL,NULL,1),(1324,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','755','1315','Ecarts de conversion des devises',NULL,NULL,1),(1325,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','756','1315','à 759 Produits financiers divers',NULL,NULL,1),(1326,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','756','1315','Produits des autres créances',NULL,NULL,1),(1327,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','757','1315','Escomptes obtenus',NULL,NULL,1),(1328,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','76','1357','Produits exceptionnels',NULL,NULL,1),(1329,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','760','1328','Reprises d\'amortissements et de réductions de valeur',NULL,NULL,1),(1330,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7600','1329','Sur immobilisations incorporelles',NULL,NULL,1),(1331,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7601','1329','Sur immobilisations corporelles',NULL,NULL,1),(1332,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','761','1328','Reprises de réductions de valeur sur immobilisations financières',NULL,NULL,1),(1333,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','762','1328','Reprises de provisions pour risques et charges exceptionnelles',NULL,NULL,1),(1334,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','763','1328','Plus-values sur réalisation d\'actifs immobilisés',NULL,NULL,1),(1335,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7630','1334','Sur immobilisations incorporelles',NULL,NULL,1),(1336,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7631','1334','Sur immobilisations corporelles',NULL,NULL,1),(1337,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7632','1334','Sur immobilisations financières',NULL,NULL,1),(1338,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','764','1328','Autres produits exceptionnels',NULL,NULL,1),(1339,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','77','1357','Régularisations d\'impôts et reprises de provisions fiscales',NULL,NULL,1),(1340,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','771','1339','Impôts belges sur le résultat',NULL,NULL,1),(1341,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7710','1340','Régularisations d\'impôts dus ou versés',NULL,NULL,1),(1342,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7711','1340','Régularisations d\'impôts estimés',NULL,NULL,1),(1343,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7712','1340','Reprises de provisions fiscales',NULL,NULL,1),(1344,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','773','1339','Impôts étrangers sur le résultat',NULL,NULL,1),(1345,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','79','1357','Affectation aux résultats',NULL,NULL,1),(1346,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','790','1345','Bénéfice reporté de l\'exercice précédent',NULL,NULL,1),(1347,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','791','1345','Prélèvement sur le capital et les primes d\'émission',NULL,NULL,1),(1348,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','792','1345','Prélèvement sur les réserves',NULL,NULL,1),(1349,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','793','1345','Perte à reporter',NULL,NULL,1),(1350,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','794','1345','Intervention d\'associés (ou du propriétaire) dans la perte',NULL,NULL,1),(1351,1,NULL,NOW(),'PCMN-BASE','CAPIT','XXXXXX','1','','Fonds propres, provisions pour risques et charges et dettes à plus d\'un an',NULL,NULL,1),(1352,1,NULL,NOW(),'PCMN-BASE','IMMO','XXXXXX','2','','Frais d\'établissement. Actifs immobilisés et créances à plus d\'un an',NULL,NULL,1),(1353,1,NULL,NOW(),'PCMN-BASE','STOCK','XXXXXX','3','','Stock et commandes en cours d\'exécution',NULL,NULL,1),(1354,1,NULL,NOW(),'PCMN-BASE','TIERS','XXXXXX','4','','Créances et dettes à un an au plus',NULL,NULL,1),(1355,1,NULL,NOW(),'PCMN-BASE','FINAN','XXXXXX','5','','Placement de trésorerie et de valeurs disponibles',NULL,NULL,1),(1356,1,NULL,NOW(),'PCMN-BASE','CHARGE','XXXXXX','6','','Charges',NULL,NULL,1),(1357,1,NULL,NOW(),'PCMN-BASE','PROD','XXXXXX','7','','Produits',NULL,NULL,1),(1401,1,NULL,NOW(),'PCG99-ABREGE','CAPIT','XXXXXX','1','','Fonds propres, provisions pour risques et charges et dettes à plus d\'un an',NULL,NULL,1),(1402,1,NULL,NOW(),'PCG99-ABREGE','IMMO','XXXXXX','2','','Frais d\'établissement. Actifs immobilisés et créances à plus d\'un an',NULL,NULL,1),(1403,1,NULL,NOW(),'PCG99-ABREGE','STOCK','XXXXXX','3','','Stock et commandes en cours d\'exécution',NULL,NULL,1),(1404,1,NULL,NOW(),'PCG99-ABREGE','TIERS','XXXXXX','4','','Créances et dettes à un an au plus',NULL,NULL,1),(1405,1,NULL,NOW(),'PCG99-ABREGE','FINAN','XXXXXX','5','','Placement de trésorerie et de valeurs disponibles',NULL,NULL,1),(1406,1,NULL,NOW(),'PCG99-ABREGE','CHARGE','XXXXXX','6','','Charges',NULL,NULL,1),(1407,1,NULL,NOW(),'PCG99-ABREGE','PROD','XXXXXX','7','','Produits',NULL,NULL,1),(1501,1,NULL,NOW(),'PCG99-BASE','CAPIT','XXXXXX','1','','Fonds propres, provisions pour risques et charges et dettes à plus d\'un an',NULL,NULL,1),(1502,1,NULL,NOW(),'PCG99-BASE','IMMO','XXXXXX','2','','Frais d\'établissement. Actifs immobilisés et créances à plus d\'un an',NULL,NULL,1),(1503,1,NULL,NOW(),'PCG99-BASE','STOCK','XXXXXX','3','','Stock et commandes en cours d\'exécution',NULL,NULL,1),(1504,1,NULL,NOW(),'PCG99-BASE','TIERS','XXXXXX','4','','Créances et dettes à un an au plus',NULL,NULL,1),(1505,1,NULL,NOW(),'PCG99-BASE','FINAN','XXXXXX','5','','Placement de trésorerie et de valeurs disponibles',NULL,NULL,1),(1506,1,NULL,NOW(),'PCG99-BASE','CHARGE','XXXXXX','6','','Charges',NULL,NULL,1),(1507,1,NULL,NOW(),'PCG99-BASE','PROD','XXXXXX','7','','Produits',NULL,NULL,1),(4001,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1','','Financiación básica',NULL,NULL,1),(4002,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','ACTIVO','XXXXXX','2','','Activo no corriente',NULL,NULL,1),(4003,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','EXISTENCIAS','XXXXXX','3','','Existencias',NULL,NULL,1),(4004,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4','','Acreedores y deudores por operaciones comerciales',NULL,NULL,1),(4005,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5','','Cuentas financieras',NULL,NULL,1),(4006,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6','','Compras y gastos',NULL,NULL,1),(4007,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7','','Ventas e ingresos',NULL,NULL,1),(4008,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','10','4001','CAPITAL',NULL,NULL,1),(4009,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','100','4008','Capital social',NULL,NULL,1),(4010,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','101','4008','Fondo social',NULL,NULL,1),(4011,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','CAPITAL','102','4008','Capital',NULL,NULL,1),(4012,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','103','4008','Socios por desembolsos no exigidos',NULL,NULL,1),(4013,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1030','4012','Socios por desembolsos no exigidos capital social',NULL,NULL,1),(4014,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1034','4012','Socios por desembolsos no exigidos capital pendiente de inscripción',NULL,NULL,1),(4015,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','104','4008','Socios por aportaciones no dineradas pendientes',NULL,NULL,1),(4016,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1040','4015','Socios por aportaciones no dineradas pendientes capital social',NULL,NULL,1),(4017,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1044','4015','Socios por aportaciones no dineradas pendientes capital pendiente de inscripción',NULL,NULL,1),(4018,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','108','4008','Acciones o participaciones propias en situaciones especiales',NULL,NULL,1),(4019,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','109','4008','Acciones o participaciones propias para reducción de capital',NULL,NULL,1),(4020,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','11','4001','Reservas y otros instrumentos de patrimonio',NULL,NULL,1),(4021,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','110','4020','Prima de emisión o asunción',NULL,NULL,1),(4022,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','111','4020','Otros instrumentos de patrimonio neto',NULL,NULL,1),(4023,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1110','4022','Patrimonio neto por emisión de instrumentos financieros compuestos',NULL,NULL,1),(4024,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1111','4022','Resto de instrumentos de patrimoio neto',NULL,NULL,1),(4025,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','112','4020','Reserva legal',NULL,NULL,1),(4026,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','113','4020','Reservas voluntarias',NULL,NULL,1),(4027,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','114','4020','Reservas especiales',NULL,NULL,1),(4028,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1140','4027','Reservas para acciones o participaciones de la sociedad dominante',NULL,NULL,1),(4029,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1141','4027','Reservas estatutarias',NULL,NULL,1),(4030,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1142','4027','Reservas por capital amortizado',NULL,NULL,1),(4031,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1143','4027','Reservas por fondo de comercio',NULL,NULL,1),(4032,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1144','4028','Reservas por acciones propias aceptadas en garantía',NULL,NULL,1),(4033,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','115','4020','Reservas por pérdidas y ganancias actuariales y otros ajustes',NULL,NULL,1),(4034,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','118','4020','Aportaciones de socios o propietarios',NULL,NULL,1),(4035,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','119','4020','Diferencias por ajuste del capital a euros',NULL,NULL,1),(4036,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','12','4001','Resultados pendientes de aplicación',NULL,NULL,1),(4037,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','120','4036','Remanente',NULL,NULL,1),(4038,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','121','4036','Resultados negativos de ejercicios anteriores',NULL,NULL,1),(4039,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','129','4036','Resultado del ejercicio',NULL,NULL,1),(4040,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','13','4001','Subvenciones, donaciones y ajustes por cambio de valor',NULL,NULL,1),(4041,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','130','4040','Subvenciones oficiales de capital',NULL,NULL,1),(4042,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','131','4040','Donaciones y legados de capital',NULL,NULL,1),(4043,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','132','4040','Otras subvenciones, donaciones y legados',NULL,NULL,1),(4044,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','133','4040','Ajustes por valoración en activos financieros disponibles para la venta',NULL,NULL,1),(4045,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','134','4040','Operaciones de cobertura',NULL,NULL,1),(4046,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1340','4045','Cobertura de flujos de efectivo',NULL,NULL,1),(4047,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1341','4045','Cobertura de una inversión neta en un negocio extranjero',NULL,NULL,1),(4048,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','135','4040','Diferencias de conversión',NULL,NULL,1),(4049,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','136','4040','Ajustes por valoración en activos no corrientes y grupos enajenables de elementos mantenidos para la venta',NULL,NULL,1),(4050,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','137','4040','Ingresos fiscales a distribuir en varios ejercicios',NULL,NULL,1),(4051,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1370','4050','Ingresos fiscales por diferencias permanentes a distribuir en varios ejercicios',NULL,NULL,1),(4052,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1371','4050','Ingresos fiscales por deducciones y bonificaciones a distribuir en varios ejercicios',NULL,NULL,1),(4053,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','14','4001','Provisiones',NULL,NULL,1),(4054,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','141','4053','Provisión para impuestos',NULL,NULL,1),(4055,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','142','4053','Provisión para otras responsabilidades',NULL,NULL,1),(4056,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','143','4053','Provisión por desmantelamiento, retiro o rehabilitación del inmovilizado',NULL,NULL,1),(4057,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','145','4053','Provisión para actuaciones medioambientales',NULL,NULL,1),(4058,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','15','4001','Deudas a largo plazo con características especiales',NULL,NULL,1),(4059,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','150','4058','Acciones o participaciones a largo plazo consideradas como pasivos financieros',NULL,NULL,1),(4060,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','153','4058','Desembolsos no exigidos por acciones o participaciones consideradas como pasivos financieros',NULL,NULL,1),(4061,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1533','4060','Desembolsos no exigidos empresas del grupo',NULL,NULL,1),(4062,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1534','4060','Desembolsos no exigidos empresas asociadas',NULL,NULL,1),(4063,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1535','4060','Desembolsos no exigidos otras partes vinculadas',NULL,NULL,1),(4064,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1536','4060','Otros desembolsos no exigidos',NULL,NULL,1),(4065,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','154','4058','Aportaciones no dinerarias pendientes por acciones o participaciones consideradas como pasivos financieros',NULL,NULL,1),(4066,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1543','4065','Aportaciones no dinerarias pendientes empresas del grupo',NULL,NULL,1),(4067,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1544','4065','Aportaciones no dinerarias pendientes empresas asociadas',NULL,NULL,1),(4068,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1545','4065','Aportaciones no dinerarias pendientes otras partes vinculadas',NULL,NULL,1),(4069,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1546','4065','Otras aportaciones no dinerarias pendientes',NULL,NULL,1),(4070,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','16','4001','Deudas a largo plazo con partes vinculadas',NULL,NULL,1),(4071,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','160','4070','Deudas a largo plazo con entidades de crédito vinculadas',NULL,NULL,1),(4072,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1603','4071','Deudas a largo plazo con entidades de crédito empresas del grupo',NULL,NULL,1),(4073,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1604','4071','Deudas a largo plazo con entidades de crédito empresas asociadas',NULL,NULL,1),(4074,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1605','4071','Deudas a largo plazo con otras entidades de crédito vinculadas',NULL,NULL,1),(4075,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','161','4070','Proveedores de inmovilizado a largo plazo partes vinculadas',NULL,NULL,1),(4076,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1613','4075','Proveedores de inmovilizado a largo plazo empresas del grupo',NULL,NULL,1),(4077,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1614','4075','Proveedores de inmovilizado a largo plazo empresas asociadas',NULL,NULL,1),(4078,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1615','4075','Proveedores de inmovilizado a largo plazo otras partes vinculadas',NULL,NULL,1),(4079,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','162','4070','Acreedores por arrendamiento financiero a largo plazo partes vinculadas',NULL,NULL,1),(4080,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1623','4079','Acreedores por arrendamiento financiero a largo plazo empresas del grupo',NULL,NULL,1),(4081,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1624','4080','Acreedores por arrendamiento financiero a largo plazo empresas asociadas',NULL,NULL,1),(4082,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1625','4080','Acreedores por arrendamiento financiero a largo plazo otras partes vinculadas',NULL,NULL,1),(4083,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','163','4070','Otras deudas a largo plazo con partes vinculadas',NULL,NULL,1),(4084,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1633','4083','Otras deudas a largo plazo empresas del grupo',NULL,NULL,1),(4085,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1634','4083','Otras deudas a largo plazo empresas asociadas',NULL,NULL,1),(4086,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','1635','4083','Otras deudas a largo plazo otras partes vinculadas',NULL,NULL,1),(4087,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','17','4001','Deudas a largo plazo por préstamos recibidos empresitos y otros conceptos',NULL,NULL,1),(4088,1,NULL,'2014-12-21 12:51:05','PCG08-PYME','FINANCIACION','XXXXXX','170','4087','Deudas a largo plazo con entidades de crédito',NULL,NULL,1),(4089,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','171','4087','Deudas a largo plazo',NULL,NULL,1),(4090,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','172','4087','Deudas a largo plazo transformables en suvbenciones donaciones y legados',NULL,NULL,1),(4091,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','173','4087','Proveedores de inmovilizado a largo plazo',NULL,NULL,1),(4092,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','174','4087','Acreedores por arrendamiento financiero a largo plazo',NULL,NULL,1),(4093,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','175','4087','Efectos a pagar a largo plazo',NULL,NULL,1),(4094,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','176','4087','Pasivos por derivados financieros a largo plazo',NULL,NULL,1),(4095,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','177','4087','Obligaciones y bonos',NULL,NULL,1),(4096,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','179','4087','Deudas representadas en otros valores negociables',NULL,NULL,1),(4097,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','18','4001','Pasivos por fianzas garantias y otros conceptos a largo plazo',NULL,NULL,1),(4098,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','180','4097','Fianzas recibidas a largo plazo',NULL,NULL,1),(4099,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','181','4097','Anticipos recibidos por ventas o prestaciones de servicios a largo plazo',NULL,NULL,1),(4100,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','185','4097','Depositos recibidos a largo plazo',NULL,NULL,1),(4101,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','19','4001','Situaciones transitorias de financiación',NULL,NULL,1),(4102,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','190','4101','Acciones o participaciones emitidas',NULL,NULL,1),(4103,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','192','4101','Suscriptores de acciones',NULL,NULL,1),(4104,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','194','4101','Capital emitido pendiente de inscripción',NULL,NULL,1),(4105,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','195','4101','Acciones o participaciones emitidas consideradas como pasivos financieros',NULL,NULL,1),(4106,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','197','4101','Suscriptores de acciones consideradas como pasivos financieros',NULL,NULL,1),(4107,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','FINANCIACION','XXXXXX','199','4101','Acciones o participaciones emitidas consideradas como pasivos financieros pendientes de inscripción',NULL,NULL,1),(4108,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','20','4002','Inmovilizaciones intangibles',NULL,NULL,1),(4109,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','200','4108','Investigación',NULL,NULL,1),(4110,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','201','4108','Desarrollo',NULL,NULL,1),(4111,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','202','4108','Concesiones administrativas',NULL,NULL,1),(4112,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','203','4108','Propiedad industrial',NULL,NULL,1),(4113,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','205','4108','Derechos de transpaso',NULL,NULL,1),(4114,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','206','4108','Aplicaciones informáticas',NULL,NULL,1),(4115,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','209','4108','Anticipos para inmovilizaciones intangibles',NULL,NULL,1),(4116,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','21','4002','Inmovilizaciones materiales',NULL,NULL,1),(4117,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','210','4116','Terrenos y bienes naturales',NULL,NULL,1),(4118,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','211','4116','Construcciones',NULL,NULL,1),(4119,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','212','4116','Instalaciones técnicas',NULL,NULL,1),(4120,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','213','4116','Maquinaria',NULL,NULL,1),(4121,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','214','4116','Utillaje',NULL,NULL,1),(4122,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','215','4116','Otras instalaciones',NULL,NULL,1),(4123,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','216','4116','Mobiliario',NULL,NULL,1),(4124,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','217','4116','Equipos para procesos de información',NULL,NULL,1),(4125,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','218','4116','Elementos de transporte',NULL,NULL,1),(4126,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','219','4116','Otro inmovilizado material',NULL,NULL,1),(4127,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','22','4002','Inversiones inmobiliarias',NULL,NULL,1),(4128,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','220','4127','Inversiones en terreons y bienes naturales',NULL,NULL,1),(4129,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','221','4127','Inversiones en construcciones',NULL,NULL,1),(4130,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','23','4002','Inmovilizaciones materiales en curso',NULL,NULL,1),(4131,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','230','4130','Adaptación de terrenos y bienes naturales',NULL,NULL,1),(4132,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','231','4130','Construcciones en curso',NULL,NULL,1),(4133,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','232','4130','Instalaciones técnicas en montaje',NULL,NULL,1),(4134,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','233','4130','Maquinaria en montaje',NULL,NULL,1),(4135,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','237','4130','Equipos para procesos de información en montaje',NULL,NULL,1),(4136,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','239','4130','Anticipos para inmovilizaciones materiales',NULL,NULL,1),(4137,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','24','4002','Inversiones financieras a largo plazo en partes vinculadas',NULL,NULL,1),(4138,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','240','4137','Participaciones a largo plazo en partes vinculadas',NULL,NULL,1),(4139,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2403','4138','Participaciones a largo plazo en empresas del grupo',NULL,NULL,1),(4140,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2404','4138','Participaciones a largo plazo en empresas asociadas',NULL,NULL,1),(4141,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2405','4138','Participaciones a largo plazo en otras partes vinculadas',NULL,NULL,1),(4142,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','241','4137','Valores representativos de deuda a largo plazo de partes vinculadas',NULL,NULL,1),(4143,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2413','4142','Valores representativos de deuda a largo plazo de empresas del grupo',NULL,NULL,1),(4144,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2414','4142','Valores representativos de deuda a largo plazo de empresas asociadas',NULL,NULL,1),(4145,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2415','4142','Valores representativos de deuda a largo plazo de otras partes vinculadas',NULL,NULL,1),(4146,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','242','4137','Créditos a largo plazo a partes vinculadas',NULL,NULL,1),(4147,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2423','4146','Créditos a largo plazo a empresas del grupo',NULL,NULL,1),(4148,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2424','4146','Créditos a largo plazo a empresas asociadas',NULL,NULL,1),(4149,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2425','4146','Créditos a largo plazo a otras partes vinculadas',NULL,NULL,1),(4150,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','249','4137','Desembolsos pendientes sobre participaciones a largo plazo en partes vinculadas',NULL,NULL,1),(4151,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2493','4150','Desembolsos pendientes sobre participaciones a largo plazo en empresas del grupo',NULL,NULL,1),(4152,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2494','4150','Desembolsos pendientes sobre participaciones a largo plazo en empresas asociadas',NULL,NULL,1),(4153,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2495','4150','Desembolsos pendientes sobre participaciones a largo plazo en otras partes vinculadas',NULL,NULL,1),(4154,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','25','4002','Otras inversiones financieras a largo plazo',NULL,NULL,1),(4155,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','250','4154','Inversiones financieras a largo plazo en instrumentos de patrimonio',NULL,NULL,1),(4156,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','251','4154','Valores representativos de deuda a largo plazo',NULL,NULL,1),(4157,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','252','4154','Créditos a largo plazo',NULL,NULL,1),(4158,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','253','4154','Créditos a largo plazo por enajenación de inmovilizado',NULL,NULL,1),(4159,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','254','4154','Créditos a largo plazo al personal',NULL,NULL,1),(4160,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','255','4154','Activos por derivados financieros a largo plazo',NULL,NULL,1),(4161,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','258','4154','Imposiciones a largo plazo',NULL,NULL,1),(4162,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','259','4154','Desembolsos pendientes sobre participaciones en el patrimonio neto a largo plazo',NULL,NULL,1),(4163,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','26','4002','Fianzas y depósitos constituidos a largo plazo',NULL,NULL,1),(4164,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','260','4163','Fianzas constituidas a largo plazo',NULL,NULL,1),(4165,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','261','4163','Depósitos constituidos a largo plazo',NULL,NULL,1),(4166,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','28','4002','Amortización acumulada del inmovilizado',NULL,NULL,1),(4167,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','280','4166','Amortización acumulado del inmovilizado intangible',NULL,NULL,1),(4168,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2800','4167','Amortización acumulada de investigación',NULL,NULL,1),(4169,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2801','4167','Amortización acumulada de desarrollo',NULL,NULL,1),(4170,1,NULL,'2014-12-21 12:51:06','PCG08-PYME','ACTIVO','XXXXXX','2802','4167','Amortización acumulada de concesiones administrativas',NULL,NULL,1),(4171,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2803','4167','Amortización acumulada de propiedad industrial',NULL,NULL,1),(4172,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2805','4167','Amortización acumulada de derechos de transpaso',NULL,NULL,1),(4173,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2806','4167','Amortización acumulada de aplicaciones informáticas',NULL,NULL,1),(4174,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','281','4166','Amortización acumulado del inmovilizado material',NULL,NULL,1),(4175,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2811','4174','Amortización acumulada de construcciones',NULL,NULL,1),(4176,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2812','4174','Amortización acumulada de instalaciones técnicas',NULL,NULL,1),(4177,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2813','4174','Amortización acumulada de maquinaria',NULL,NULL,1),(4178,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2814','4174','Amortización acumulada de utillaje',NULL,NULL,1),(4179,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2815','4174','Amortización acumulada de otras instalaciones',NULL,NULL,1),(4180,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2816','4174','Amortización acumulada de mobiliario',NULL,NULL,1),(4181,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2817','4174','Amortización acumulada de equipos para proceso de información',NULL,NULL,1),(4182,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2818','4174','Amortización acumulada de elementos de transporte',NULL,NULL,1),(4183,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2819','4175','Amortización acumulada de otro inmovilizado material',NULL,NULL,1),(4184,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','282','4166','Amortización acumulada de las inversiones inmobiliarias',NULL,NULL,1),(4185,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','29','4002','Deterioro de valor de activos no corrientes',NULL,NULL,1),(4186,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','290','4185','Deterioro de valor del inmovilizado intangible',NULL,NULL,1),(4187,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2900','4186','Deterioro de valor de investigación',NULL,NULL,1),(4188,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2901','4186','Deterioro de valor de desarrollo',NULL,NULL,1),(4189,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2902','4186','Deterioro de valor de concesiones administrativas',NULL,NULL,1),(4190,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2903','4186','Deterioro de valor de propiedad industrial',NULL,NULL,1),(4191,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2905','4186','Deterioro de valor de derechos de transpaso',NULL,NULL,1),(4192,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2906','4186','Deterioro de valor de aplicaciones informáticas',NULL,NULL,1),(4193,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','291','4185','Deterioro de valor del inmovilizado material',NULL,NULL,1),(4194,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2910','4193','Deterioro de valor de terrenos y bienes naturales',NULL,NULL,1),(4195,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2911','4193','Deterioro de valor de construcciones',NULL,NULL,1),(4196,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2912','4193','Deterioro de valor de instalaciones técnicas',NULL,NULL,1),(4197,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2913','4193','Deterioro de valor de maquinaria',NULL,NULL,1),(4198,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2914','4193','Deterioro de valor de utillajes',NULL,NULL,1),(4199,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2915','4194','Deterioro de valor de otras instalaciones',NULL,NULL,1),(4200,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2916','4194','Deterioro de valor de mobiliario',NULL,NULL,1),(4201,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2917','4194','Deterioro de valor de equipos para proceso de información',NULL,NULL,1),(4202,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2918','4194','Deterioro de valor de elementos de transporte',NULL,NULL,1),(4203,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2919','4194','Deterioro de valor de otro inmovilizado material',NULL,NULL,1),(4204,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','292','4185','Deterioro de valor de las inversiones inmobiliarias',NULL,NULL,1),(4205,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2920','4204','Deterioro de valor de terrenos y bienes naturales',NULL,NULL,1),(4206,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2921','4204','Deterioro de valor de construcciones',NULL,NULL,1),(4207,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','293','4185','Deterioro de valor de participaciones a largo plazo en partes vinculadas',NULL,NULL,1),(4208,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2933','4207','Deterioro de valor de participaciones a largo plazo en empresas del grupo',NULL,NULL,1),(4209,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2934','4207','Deterioro de valor de sobre participaciones a largo plazo en empresas asociadas',NULL,NULL,1),(4210,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2935','4207','Deterioro de valor de sobre participaciones a largo plazo en otras partes vinculadas',NULL,NULL,1),(4211,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','294','4185','Deterioro de valor de valores representativos de deuda a largo plazo en partes vinculadas',NULL,NULL,1),(4212,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2943','4211','Deterioro de valor de valores representativos de deuda a largo plazo en empresas del grupo',NULL,NULL,1),(4213,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2944','4211','Deterioro de valor de valores representativos de deuda a largo plazo en empresas asociadas',NULL,NULL,1),(4214,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2945','4211','Deterioro de valor de valores representativos de deuda a largo plazo en otras partes vinculadas',NULL,NULL,1),(4215,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','295','4185','Deterioro de valor de créditos a largo plazo a partes vinculadas',NULL,NULL,1),(4216,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2953','4215','Deterioro de valor de créditos a largo plazo a empresas del grupo',NULL,NULL,1),(4217,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2954','4215','Deterioro de valor de créditos a largo plazo a empresas asociadas',NULL,NULL,1),(4218,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','2955','4215','Deterioro de valor de créditos a largo plazo a otras partes vinculadas',NULL,NULL,1),(4219,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','296','4185','Deterioro de valor de participaciones en el patrimonio netoa largo plazo',NULL,NULL,1),(4220,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','297','4185','Deterioro de valor de valores representativos de deuda a largo plazo',NULL,NULL,1),(4221,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACTIVO','XXXXXX','298','4185','Deterioro de valor de créditos a largo plazo',NULL,NULL,1),(4222,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','30','4003','Comerciales',NULL,NULL,1),(4223,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','300','4222','Mercaderías A',NULL,NULL,1),(4224,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','301','4222','Mercaderías B',NULL,NULL,1),(4225,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','31','4003','Materias primas',NULL,NULL,1),(4226,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','310','4225','Materias primas A',NULL,NULL,1),(4227,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','311','4225','Materias primas B',NULL,NULL,1),(4228,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','32','4003','Otros aprovisionamientos',NULL,NULL,1),(4229,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','320','4228','Elementos y conjuntos incorporables',NULL,NULL,1),(4230,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','321','4228','Combustibles',NULL,NULL,1),(4231,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','322','4228','Repuestos',NULL,NULL,1),(4232,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','325','4228','Materiales diversos',NULL,NULL,1),(4233,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','326','4228','Embalajes',NULL,NULL,1),(4234,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','327','4228','Envases',NULL,NULL,1),(4235,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','328','4229','Material de oficina',NULL,NULL,1),(4236,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','33','4003','Productos en curso',NULL,NULL,1),(4237,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','330','4236','Productos en curos A',NULL,NULL,1),(4238,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','331','4236','Productos en curso B',NULL,NULL,1),(4239,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','34','4003','Productos semiterminados',NULL,NULL,1),(4240,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','340','4239','Productos semiterminados A',NULL,NULL,1),(4241,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','341','4239','Productos semiterminados B',NULL,NULL,1),(4242,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','35','4003','Productos terminados',NULL,NULL,1),(4243,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','350','4242','Productos terminados A',NULL,NULL,1),(4244,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','351','4242','Productos terminados B',NULL,NULL,1),(4245,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','36','4003','Subproductos, residuos y materiales recuperados',NULL,NULL,1),(4246,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','360','4245','Subproductos A',NULL,NULL,1),(4247,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','361','4245','Subproductos B',NULL,NULL,1),(4248,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','365','4245','Residuos A',NULL,NULL,1),(4249,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','366','4245','Residuos B',NULL,NULL,1),(4250,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','368','4245','Materiales recuperados A',NULL,NULL,1),(4251,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','369','4245','Materiales recuperados B',NULL,NULL,1),(4252,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','39','4003','Deterioro de valor de las existencias',NULL,NULL,1),(4253,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','390','4252','Deterioro de valor de las mercaderías',NULL,NULL,1),(4254,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','391','4252','Deterioro de valor de las materias primas',NULL,NULL,1),(4255,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','392','4252','Deterioro de valor de otros aprovisionamientos',NULL,NULL,1),(4256,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','393','4252','Deterioro de valor de los productos en curso',NULL,NULL,1),(4257,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','394','4252','Deterioro de valor de los productos semiterminados',NULL,NULL,1),(4258,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','395','4252','Deterioro de valor de los productos terminados',NULL,NULL,1),(4259,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','EXISTENCIAS','XXXXXX','396','4252','Deterioro de valor de los subproductos, residuos y materiales recuperados',NULL,NULL,1),(4260,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACREEDORES_DEUDORES','PROVEEDORES','40','4004','Proveedores',NULL,NULL,1),(4261,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACREEDORES_DEUDORES','PROVEEDORES','400','4260','Proveedores',NULL,NULL,1),(4262,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4000','4261','Proveedores euros',NULL,NULL,1),(4263,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4004','4261','Proveedores moneda extranjera',NULL,NULL,1),(4264,1,NULL,'2014-12-21 12:51:07','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4009','4261','Proveedores facturas pendientes de recibir o formalizar',NULL,NULL,1),(4265,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','401','4260','Proveedores efectos comerciales a pagar',NULL,NULL,1),(4266,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','403','4260','Proveedores empresas del grupo',NULL,NULL,1),(4267,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4030','4266','Proveedores empresas del grupo euros',NULL,NULL,1),(4268,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4031','4266','Efectos comerciales a pagar empresas del grupo',NULL,NULL,1),(4269,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4034','4266','Proveedores empresas del grupo moneda extranjera',NULL,NULL,1),(4270,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4036','4266','Envases y embalajes a devolver a proveedores empresas del grupo',NULL,NULL,1),(4271,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4039','4266','Proveedores empresas del grupo facturas pendientes de recibir o de formalizar',NULL,NULL,1),(4272,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','404','4260','Proveedores empresas asociadas',NULL,NULL,1),(4273,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','405','4260','Proveedores otras partes vinculadas',NULL,NULL,1),(4274,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','406','4260','Envases y embalajes a devolver a proveedores',NULL,NULL,1),(4275,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','407','4260','Anticipos a proveedores',NULL,NULL,1),(4276,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','41','4004','Acreedores varios',NULL,NULL,1),(4277,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','410','4276','Acreedores por prestaciones de servicios',NULL,NULL,1),(4278,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4100','4277','Acreedores por prestaciones de servicios euros',NULL,NULL,1),(4279,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4104','4277','Acreedores por prestaciones de servicios moneda extranjera',NULL,NULL,1),(4280,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4109','4277','Acreedores por prestaciones de servicios facturas pendientes de recibir o formalizar',NULL,NULL,1),(4281,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','411','4276','Acreedores efectos comerciales a pagar',NULL,NULL,1),(4282,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','419','4276','Acreedores por operaciones en común',NULL,NULL,1),(4283,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','CLIENTES','43','4004','Clientes',NULL,NULL,1),(4284,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','CLIENTES','430','4283','Clientes',NULL,NULL,1),(4285,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4300','4284','Clientes euros',NULL,NULL,1),(4286,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4304','4284','Clientes moneda extranjera',NULL,NULL,1),(4287,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4309','4284','Clientes facturas pendientes de formalizar',NULL,NULL,1),(4288,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','431','4283','Clientes efectos comerciales a cobrar',NULL,NULL,1),(4289,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4310','4288','Efectos comerciales en cartera',NULL,NULL,1),(4290,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4311','4288','Efectos comerciales descontados',NULL,NULL,1),(4291,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4312','4288','Efectos comerciales en gestión de cobro',NULL,NULL,1),(4292,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4315','4288','Efectos comerciales impagados',NULL,NULL,1),(4293,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','432','4283','Clientes operaciones de factoring',NULL,NULL,1),(4294,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','433','4283','Clientes empresas del grupo',NULL,NULL,1),(4295,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4330','4294','Clientes empresas del grupo euros',NULL,NULL,1),(4296,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4331','4294','Efectos comerciales a cobrar empresas del grupo',NULL,NULL,1),(4297,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4332','4294','Clientes empresas del grupo operaciones de factoring',NULL,NULL,1),(4298,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4334','4294','Clientes empresas del grupo moneda extranjera',NULL,NULL,1),(4299,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4336','4294','Clientes empresas del grupo dudoso cobro',NULL,NULL,1),(4300,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4337','4294','Envases y embalajes a devolver a clientes empresas del grupo',NULL,NULL,1),(4301,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4339','4294','Clientes empresas del grupo facturas pendientes de formalizar',NULL,NULL,1),(4302,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','434','4283','Clientes empresas asociadas',NULL,NULL,1),(4303,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','435','4283','Clientes otras partes vinculadas',NULL,NULL,1),(4304,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','436','4283','Clientes de dudoso cobro',NULL,NULL,1),(4305,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','437','4283','Envases y embalajes a devolver por clientes',NULL,NULL,1),(4306,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','438','4283','Anticipos de clientes',NULL,NULL,1),(4307,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','44','4004','Deudores varios',NULL,NULL,1),(4308,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','440','4307','Deudores',NULL,NULL,1),(4309,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4400','4308','Deudores euros',NULL,NULL,1),(4310,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4404','4308','Deudores moneda extranjera',NULL,NULL,1),(4311,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4409','4308','Deudores facturas pendientes de formalizar',NULL,NULL,1),(4312,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','441','4307','Deudores efectos comerciales a cobrar',NULL,NULL,1),(4313,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4410','4312','Deudores efectos comerciales en cartera',NULL,NULL,1),(4314,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4411','4312','Deudores efectos comerciales descontados',NULL,NULL,1),(4315,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4412','4312','Deudores efectos comerciales en gestión de cobro',NULL,NULL,1),(4316,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4415','4312','Deudores efectos comerciales impagados',NULL,NULL,1),(4317,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','446','4307','Deudores de dusoso cobro',NULL,NULL,1),(4318,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','449','4307','Deudores por operaciones en común',NULL,NULL,1),(4319,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','46','4004','Personal',NULL,NULL,1),(4320,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','460','4319','Anticipos de renumeraciones',NULL,NULL,1),(4321,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','465','4319','Renumeraciones pendientes de pago',NULL,NULL,1),(4322,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','47','4004','Administraciones Públicas',NULL,NULL,1),(4323,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','470','4322','Hacienda Pública deudora por diversos conceptos',NULL,NULL,1),(4324,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4700','4323','Hacienda Pública deudora por IVA',NULL,NULL,1),(4325,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4708','4323','Hacienda Pública deudora por subvenciones concedidas',NULL,NULL,1),(4326,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4709','4323','Hacienda Pública deudora por devolución de impuestos',NULL,NULL,1),(4327,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','471','4322','Organismos de la Seguridad Social deudores',NULL,NULL,1),(4328,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','472','4322','Hacienda Pública IVA soportado',NULL,NULL,1),(4329,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','473','4322','Hacienda Pública retenciones y pagos a cuenta',NULL,NULL,1),(4330,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','474','4322','Activos por impuesto diferido',NULL,NULL,1),(4331,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4740','4330','Activos por diferencias temporarias deducibles',NULL,NULL,1),(4332,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4742','4330','Derechos por deducciones y bonificaciones pendientes de aplicar',NULL,NULL,1),(4333,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4745','4330','Crédito por pérdidasa compensar del ejercicio',NULL,NULL,1),(4334,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','475','4322','Hacienda Pública acreedora por conceptos fiscales',NULL,NULL,1),(4335,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4750','4334','Hacienda Pública acreedora por IVA',NULL,NULL,1),(4336,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4751','4334','Hacienda Pública acreedora por retenciones practicadas',NULL,NULL,1),(4337,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4752','4334','Hacienda Pública acreedora por impuesto sobre sociedades',NULL,NULL,1),(4338,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4758','4334','Hacienda Pública acreedora por subvenciones a integrar',NULL,NULL,1),(4339,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','476','4322','Organismos de la Seguridad Social acreedores',NULL,NULL,1),(4340,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','477','4322','Hacienda Pública IVA repercutido',NULL,NULL,1),(4341,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','479','4322','Pasivos por diferencias temporarias imponibles',NULL,NULL,1),(4342,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','48','4004','Ajustes por periodificación',NULL,NULL,1),(4343,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','480','4342','Gastos anticipados',NULL,NULL,1),(4344,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','485','4342','Ingresos anticipados',NULL,NULL,1),(4345,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','49','4004','Deterioro de valor de créditos comerciales y provisiones a corto plazo',NULL,NULL,1),(4346,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','490','4345','Deterioro de valor de créditos por operaciones comerciales',NULL,NULL,1),(4347,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','493','4345','Deterioro de valor de créditos por operaciones comerciales con partes vinculadas',NULL,NULL,1),(4348,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4933','4347','Deterioro de valor de créditos por operaciones comerciales con empresas del grupo',NULL,NULL,1),(4349,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4934','4347','Deterioro de valor de créditos por operaciones comerciales con empresas asociadas',NULL,NULL,1),(4350,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4935','4347','Deterioro de valor de créditos por operaciones comerciales con otras partes vinculadas',NULL,NULL,1),(4351,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','499','4345','Provisiones por operaciones comerciales',NULL,NULL,1),(4352,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4994','4351','Provisión para contratos anerosos',NULL,NULL,1),(4353,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4999','4351','Provisión para otras operaciones comerciales',NULL,NULL,1),(4354,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','50','4005','Emprésitos deudas con características especiales y otras emisiones análogas a corto plazo',NULL,NULL,1),(4355,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','500','4354','Obligaciones y bonos a corto plazo',NULL,NULL,1),(4356,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','502','4354','Acciones o participaciones a corto plazo consideradas como pasivos financieros',NULL,NULL,1),(4357,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','505','4354','Deudas representadas en otros valores negociables a corto plazo',NULL,NULL,1),(4358,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','506','4354','Intereses a corto plazo de emprésitos y otras emisiones analógicas',NULL,NULL,1),(4359,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','507','4354','Dividendos de acciones o participaciones consideradas como pasivos financieros',NULL,NULL,1),(4360,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','509','4354','Valores negociables amortizados',NULL,NULL,1),(4361,1,NULL,'2014-12-21 12:51:08','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5090','4360','Obligaciones y bonos amortizados',NULL,NULL,1),(4362,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5095','4360','Otros valores negociables amortizados',NULL,NULL,1),(4363,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','51','4005','Deudas a corto plazo con partes vinculadas',NULL,NULL,1),(4364,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','510','4363','Deudas a corto plazo con entidades de crédito vinculadas',NULL,NULL,1),(4365,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5103','4364','Deudas a corto plazo con entidades de crédito empresas del grupo',NULL,NULL,1),(4366,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5104','4364','Deudas a corto plazo con entidades de crédito empresas asociadas',NULL,NULL,1),(4367,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5105','4364','Deudas a corto plazo con otras entidades de crédito vinculadas',NULL,NULL,1),(4368,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','511','4363','Proveedores de inmovilizado a corto plazo partes vinculadas',NULL,NULL,1),(4369,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5113','4368','Proveedores de inmovilizado a corto plazo empresas del grupo',NULL,NULL,1),(4370,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5114','4368','Proveedores de inmovilizado a corto plazo empresas asociadas',NULL,NULL,1),(4371,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5115','4368','Proveedores de inmovilizado a corto plazo otras partes vinculadas',NULL,NULL,1),(4372,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','512','4363','Acreedores por arrendamiento financiero a corto plazo partes vinculadas',NULL,NULL,1),(4373,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5123','4372','Acreedores por arrendamiento financiero a corto plazo empresas del grupo',NULL,NULL,1),(4374,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5124','4372','Acreedores por arrendamiento financiero a corto plazo empresas asociadas',NULL,NULL,1),(4375,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5125','4372','Acreedores por arrendamiento financiero a corto plazo otras partes vinculadas',NULL,NULL,1),(4376,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','513','4363','Otras deudas a corto plazo con partes vinculadas',NULL,NULL,1),(4377,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5133','4376','Otras deudas a corto plazo con empresas del grupo',NULL,NULL,1),(4378,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5134','4376','Otras deudas a corto plazo con empresas asociadas',NULL,NULL,1),(4379,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5135','4376','Otras deudas a corto plazo con partes vinculadas',NULL,NULL,1),(4380,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','514','4363','Intereses a corto plazo con partes vinculadas',NULL,NULL,1),(4381,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5143','4380','Intereses a corto plazo empresas del grupo',NULL,NULL,1),(4382,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5144','4380','Intereses a corto plazo empresas asociadas',NULL,NULL,1),(4383,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5145','4380','Intereses deudas a corto plazo partes vinculadas',NULL,NULL,1),(4384,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','52','4005','Deudas a corto plazo por préstamos recibidos y otros conceptos',NULL,NULL,1),(4385,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','520','4384','Deudas a corto plazo con entidades de crédito',NULL,NULL,1),(4386,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5200','4385','Préstamos a corto plazo de entidades de crédito',NULL,NULL,1),(4387,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5201','4385','Deudas a corto plazo por crédito dispuesto',NULL,NULL,1),(4388,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5208','4385','Deudas por efectos descontados',NULL,NULL,1),(4389,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5209','4385','Deudas por operaciones de factoring',NULL,NULL,1),(4390,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','521','4384','Deudas a corto plazo',NULL,NULL,1),(4391,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','522','4384','Deudas a corto plazo transformables en subvenciones donaciones y legados',NULL,NULL,1),(4392,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','523','4384','Proveedores de inmovilizado a corto plazo',NULL,NULL,1),(4393,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','526','4384','Dividendo activo a pagar',NULL,NULL,1),(4394,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','527','4384','Intereses a corto plazo de deudas con entidades de crédito',NULL,NULL,1),(4395,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','528','4384','Intereses a corto plazo de deudas',NULL,NULL,1),(4396,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','529','4384','Provisiones a corto plazo',NULL,NULL,1),(4397,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5291','4396','Provisión a corto plazo para impuestos',NULL,NULL,1),(4398,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5292','4396','Provisión a corto plazo para otras responsabilidades',NULL,NULL,1),(4399,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5293','4396','Provisión a corto plazo por desmantelamiento retiro o rehabilitación del inmovilizado',NULL,NULL,1),(4400,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5295','4396','Provisión a corto plazo para actuaciones medioambientales',NULL,NULL,1),(4401,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','53','4005','Inversiones financieras a corto plazo en partes vinculadas',NULL,NULL,1),(4402,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','530','4401','Participaciones a corto plazo en partes vinculadas',NULL,NULL,1),(4403,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5303','4402','Participaciones a corto plazo en empresas del grupo',NULL,NULL,1),(4404,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5304','4402','Participaciones a corto plazo en empresas asociadas',NULL,NULL,1),(4405,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5305','4402','Participaciones a corto plazo en otras partes vinculadas',NULL,NULL,1),(4406,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','531','4401','Valores representativos de deuda a corto plazo de partes vinculadas',NULL,NULL,1),(4407,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5313','4406','Valores representativos de deuda a corto plazo de empresas del grupo',NULL,NULL,1),(4408,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5314','4406','Valores representativos de deuda a corto plazo de empresas asociadas',NULL,NULL,1),(4409,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5315','4406','Valores representativos de deuda a corto plazo de otras partes vinculadas',NULL,NULL,1),(4410,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','532','4401','Créditos a corto plazo a partes vinculadas',NULL,NULL,1),(4411,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5323','4410','Créditos a corto plazo a empresas del grupo',NULL,NULL,1),(4412,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5324','4410','Créditos a corto plazo a empresas asociadas',NULL,NULL,1),(4413,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5325','4410','Créditos a corto plazo a otras partes vinculadas',NULL,NULL,1),(4414,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','533','4401','Intereses a corto plazo de valores representativos de deuda de partes vinculadas',NULL,NULL,1),(4415,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5333','4414','Intereses a corto plazo de valores representativos de deuda en empresas del grupo',NULL,NULL,1),(4416,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5334','4414','Intereses a corto plazo de valores representativos de deuda en empresas asociadas',NULL,NULL,1),(4417,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5335','4414','Intereses a corto plazo de valores representativos de deuda en otras partes vinculadas',NULL,NULL,1),(4418,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','534','4401','Intereses a corto plazo de créditos a partes vinculadas',NULL,NULL,1),(4419,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5343','4418','Intereses a corto plazo de créditos a empresas del grupo',NULL,NULL,1),(4420,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5344','4418','Intereses a corto plazo de créditos a empresas asociadas',NULL,NULL,1),(4421,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5345','4418','Intereses a corto plazo de créditos a otras partes vinculadas',NULL,NULL,1),(4422,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','535','4401','Dividendo a cobrar de inversiones financieras en partes vinculadas',NULL,NULL,1),(4423,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5353','4422','Dividendo a cobrar de empresas del grupo',NULL,NULL,1),(4424,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5354','4422','Dividendo a cobrar de empresas asociadas',NULL,NULL,1),(4425,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5355','4422','Dividendo a cobrar de otras partes vinculadas',NULL,NULL,1),(4426,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','539','4401','Desembolsos pendientes sobre participaciones a corto plazo en partes vinculadas',NULL,NULL,1),(4427,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5393','4426','Desembolsos pendientes sobre participaciones a corto plazo en empresas del grupo',NULL,NULL,1),(4428,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5394','4426','Desembolsos pendientes sobre participaciones a corto plazo en empresas asociadas',NULL,NULL,1),(4429,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5395','4426','Desembolsos pendientes sobre participaciones a corto plazo en otras partes vinculadas',NULL,NULL,1),(4430,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','54','4005','Otras inversiones financieras a corto plazo',NULL,NULL,1),(4431,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','540','4430','Inversiones financieras a corto plazo en instrumentos de patrimonio',NULL,NULL,1),(4432,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','541','4430','Valores representativos de deuda a corto plazo',NULL,NULL,1),(4433,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','542','4430','Créditos a corto plazo',NULL,NULL,1),(4434,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','543','4430','Créditos a corto plazo por enejenación de inmovilizado',NULL,NULL,1),(4435,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','544','4430','Créditos a corto plazo al personal',NULL,NULL,1),(4436,1,NULL,'2014-12-21 12:51:09','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','545','4430','Dividendo a cobrar',NULL,NULL,1),(4437,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','546','4430','Intereses a corto plazo de valores reprsentativos de deuda',NULL,NULL,1),(4438,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','547','4430','Intereses a corto plazo de créditos',NULL,NULL,1),(4439,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','548','4430','Imposiciones a corto plazo',NULL,NULL,1),(4440,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','549','4430','Desembolsos pendientes sobre participaciones en el patrimonio neto a corto plazo',NULL,NULL,1),(4441,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','55','4005','Otras cuentas no bancarias',NULL,NULL,1),(4442,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','550','4441','Titular de la explotación',NULL,NULL,1),(4443,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','551','4441','Cuenta corriente con socios y administradores',NULL,NULL,1),(4444,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','552','4441','Cuenta corriente otras personas y entidades vinculadas',NULL,NULL,1),(4445,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5523','4444','Cuenta corriente con empresas del grupo',NULL,NULL,1),(4446,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5524','4444','Cuenta corriente con empresas asociadas',NULL,NULL,1),(4447,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5525','4444','Cuenta corriente con otras partes vinculadas',NULL,NULL,1),(4448,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','554','4441','Cuenta corriente con uniones temporales de empresas y comunidades de bienes',NULL,NULL,1),(4449,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','555','4441','Partidas pendientes de aplicación',NULL,NULL,1),(4450,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','556','4441','Desembolsos exigidos sobre participaciones en el patrimonio neto',NULL,NULL,1),(4451,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5563','4450','Desembolsos exigidos sobre participaciones empresas del grupo',NULL,NULL,1),(4452,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5564','4450','Desembolsos exigidos sobre participaciones empresas asociadas',NULL,NULL,1),(4453,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5565','4450','Desembolsos exigidos sobre participaciones otras partes vinculadas',NULL,NULL,1),(4454,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5566','4450','Desembolsos exigidos sobre participaciones otras empresas',NULL,NULL,1),(4455,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','557','4441','Dividendo activo a cuenta',NULL,NULL,1),(4456,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','558','4441','Socios por desembolsos exigidos',NULL,NULL,1),(4457,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5580','4456','Socios por desembolsos exigidos sobre acciones o participaciones ordinarias',NULL,NULL,1),(4458,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5585','4456','Socios por desembolsos exigidos sobre acciones o participaciones consideradas como pasivos financieros',NULL,NULL,1),(4459,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','559','4441','Derivados financieros a corto plazo',NULL,NULL,1),(4460,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5590','4459','Activos por derivados financieros a corto plazo',NULL,NULL,1),(4461,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5595','4459','Pasivos por derivados financieros a corto plazo',NULL,NULL,1),(4462,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','56','4005','Finanzas y depósitos recibidos y constituidos a corto plazo y ajustes por periodificación',NULL,NULL,1),(4463,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','560','4462','Finanzas recibidas a corto plazo',NULL,NULL,1),(4464,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','561','4462','Depósitos recibidos a corto plazo',NULL,NULL,1),(4465,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','565','4462','Finanzas constituidas a corto plazo',NULL,NULL,1),(4466,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','566','4462','Depósitos constituidos a corto plazo',NULL,NULL,1),(4467,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','567','4462','Intereses pagados por anticipado',NULL,NULL,1),(4468,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','568','4462','Intereses cobrados a corto plazo',NULL,NULL,1),(4469,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','57','4005','Tesorería',NULL,NULL,1),(4470,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','CAJA','570','4469','Caja euros',NULL,NULL,1),(4471,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','571','4469','Caja moneda extranjera',NULL,NULL,1),(4472,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','BANCOS','572','4469','Bancos e instituciones de crédito cc vista euros',NULL,NULL,1),(4473,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','573','4469','Bancos e instituciones de crédito cc vista moneda extranjera',NULL,NULL,1),(4474,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','574','4469','Bancos e instituciones de crédito cuentas de ahorro euros',NULL,NULL,1),(4475,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','575','4469','Bancos e instituciones de crédito cuentas de ahorro moneda extranjera',NULL,NULL,1),(4476,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','576','4469','Inversiones a corto plazo de gran liquidez',NULL,NULL,1),(4477,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','59','4005','Deterioro del valor de las inversiones financieras a corto plazo',NULL,NULL,1),(4478,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','593','4477','Deterioro del valor de participaciones a corto plazo en partes vinculadas',NULL,NULL,1),(4479,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5933','4478','Deterioro del valor de participaciones a corto plazo en empresas del grupo',NULL,NULL,1),(4480,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5934','4478','Deterioro del valor de participaciones a corto plazo en empresas asociadas',NULL,NULL,1),(4481,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5935','4478','Deterioro del valor de participaciones a corto plazo en otras partes vinculadas',NULL,NULL,1),(4482,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','594','4477','Deterioro del valor de valores representativos de deuda a corto plazo en partes vinculadas',NULL,NULL,1),(4483,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5943','4482','Deterioro del valor de valores representativos de deuda a corto plazo en empresas del grupo',NULL,NULL,1),(4484,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5944','4482','Deterioro del valor de valores representativos de deuda a corto plazo en empresas asociadas',NULL,NULL,1),(4485,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5945','4482','Deterioro del valor de valores representativos de deuda a corto plazo en otras partes vinculadas',NULL,NULL,1),(4486,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','595','4477','Deterioro del valor de créditos a corto plazo en partes vinculadas',NULL,NULL,1),(4487,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5953','4486','Deterioro del valor de créditos a corto plazo en empresas del grupo',NULL,NULL,1),(4488,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5954','4486','Deterioro del valor de créditos a corto plazo en empresas asociadas',NULL,NULL,1),(4489,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5955','4486','Deterioro del valor de créditos a corto plazo en otras partes vinculadas',NULL,NULL,1),(4490,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','596','4477','Deterioro del valor de participaciones a corto plazo',NULL,NULL,1),(4491,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','597','4477','Deterioro del valor de valores representativos de deuda a corto plazo',NULL,NULL,1),(4492,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','598','4477','Deterioro de valor de créditos a corto plazo',NULL,NULL,1),(4493,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','60','4006','Compras',NULL,NULL,1),(4494,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','COMPRAS','600','4493','Compras de mercaderías',NULL,NULL,1),(4495,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','COMPRAS','601','4493','Compras de materias primas',NULL,NULL,1),(4496,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','602','4493','Compras de otros aprovisionamientos',NULL,NULL,1),(4497,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','606','4493','Descuentos sobre compras por pronto pago',NULL,NULL,1),(4498,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6060','4497','Descuentos sobre compras por pronto pago de mercaderías',NULL,NULL,1),(4499,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6061','4497','Descuentos sobre compras por pronto pago de materias primas',NULL,NULL,1),(4500,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6062','4497','Descuentos sobre compras por pronto pago de otros aprovisionamientos',NULL,NULL,1),(4501,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','COMPRAS','607','4493','Trabajos realizados por otras empresas',NULL,NULL,1),(4502,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','608','4493','Devoluciones de compras y operaciones similares',NULL,NULL,1),(4503,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6080','4502','Devoluciones de compras de mercaderías',NULL,NULL,1),(4504,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6081','4502','Devoluciones de compras de materias primas',NULL,NULL,1),(4505,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6082','4502','Devoluciones de compras de otros aprovisionamientos',NULL,NULL,1),(4506,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','609','4493','Rappels por compras',NULL,NULL,1),(4507,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6090','4506','Rappels por compras de mercaderías',NULL,NULL,1),(4508,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6091','4506','Rappels por compras de materias primas',NULL,NULL,1),(4509,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6092','4506','Rappels por compras de otros aprovisionamientos',NULL,NULL,1),(4510,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','61','4006','Variación de existencias',NULL,NULL,1),(4511,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','610','4510','Variación de existencias de mercaderías',NULL,NULL,1),(4512,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','611','4510','Variación de existencias de materias primas',NULL,NULL,1),(4513,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','612','4510','Variación de existencias de otros aprovisionamientos',NULL,NULL,1),(4514,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','62','4006','Servicios exteriores',NULL,NULL,1),(4515,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','620','4514','Gastos en investigación y desarrollo del ejercicio',NULL,NULL,1),(4516,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','621','4514','Arrendamientos y cánones',NULL,NULL,1),(4517,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','622','4514','Reparaciones y conservación',NULL,NULL,1),(4518,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','623','4514','Servicios profesionales independientes',NULL,NULL,1),(4519,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','624','4514','Transportes',NULL,NULL,1),(4520,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','625','4514','Primas de seguros',NULL,NULL,1),(4521,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','626','4514','Servicios bancarios y similares',NULL,NULL,1),(4522,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','627','4514','Publicidad, propaganda y relaciones públicas',NULL,NULL,1),(4523,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','628','4514','Suministros',NULL,NULL,1),(4524,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','629','4514','Otros servicios',NULL,NULL,1),(4525,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','63','4006','Tributos',NULL,NULL,1),(4526,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','630','4525','Impuesto sobre benecifios',NULL,NULL,1),(4527,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6300','4526','Impuesto corriente',NULL,NULL,1),(4528,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6301','4526','Impuesto diferido',NULL,NULL,1),(4529,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','631','4525','Otros tributos',NULL,NULL,1),(4530,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','633','4525','Ajustes negativos en la imposición sobre beneficios',NULL,NULL,1),(4531,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','634','4525','Ajustes negativos en la imposición indirecta',NULL,NULL,1),(4532,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6341','4531','Ajustes negativos en IVA de activo corriente',NULL,NULL,1),(4533,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6342','4531','Ajustes negativos en IVA de inversiones',NULL,NULL,1),(4534,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','636','4525','Devolución de impuestos',NULL,NULL,1),(4535,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','638','4525','Ajustes positivos en la imposición sobre beneficios',NULL,NULL,1),(4536,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','639','4525','Ajustes positivos en la imposición directa',NULL,NULL,1),(4537,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6391','4536','Ajustes positivos en IVA de activo corriente',NULL,NULL,1),(4538,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6392','4536','Ajustes positivos en IVA de inversiones',NULL,NULL,1),(4539,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','64','4006','Gastos de personal',NULL,NULL,1),(4540,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','640','4539','Sueldos y salarios',NULL,NULL,1),(4541,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','641','4539','Indemnizaciones',NULL,NULL,1),(4542,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','642','4539','Seguridad social a cargo de la empresa',NULL,NULL,1),(4543,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','649','4539','Otros gastos sociales',NULL,NULL,1),(4544,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','65','4006','Otros gastos de gestión',NULL,NULL,1),(4545,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','650','4544','Pérdidas de créditos comerciales incobrables',NULL,NULL,1),(4546,1,NULL,'2014-12-21 12:51:10','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','651','4544','Resultados de operaciones en común',NULL,NULL,1),(4547,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6510','4546','Beneficio transferido gestor',NULL,NULL,1),(4548,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6511','4546','Pérdida soportada participe o asociado no gestor',NULL,NULL,1),(4549,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','659','4544','Otras pérdidas en gestión corriente',NULL,NULL,1),(4550,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','66','4006','Gastos financieros',NULL,NULL,1),(4551,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','660','4550','Gastos financieros por actualización de provisiones',NULL,NULL,1),(4552,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','661','4550','Intereses de obligaciones y bonos',NULL,NULL,1),(4553,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6610','4452','Intereses de obligaciones y bonos a largo plazo empresas del grupo',NULL,NULL,1),(4554,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6611','4452','Intereses de obligaciones y bonos a largo plazo empresas asociadas',NULL,NULL,1),(4555,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6612','4452','Intereses de obligaciones y bonos a largo plazo otras partes vinculadas',NULL,NULL,1),(4556,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6613','4452','Intereses de obligaciones y bonos a largo plazo otras empresas',NULL,NULL,1),(4557,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6615','4452','Intereses de obligaciones y bonos a corto plazo empresas del grupo',NULL,NULL,1),(4558,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6616','4452','Intereses de obligaciones y bonos a corto plazo empresas asociadas',NULL,NULL,1),(4559,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6617','4452','Intereses de obligaciones y bonos a corto plazo otras partes vinculadas',NULL,NULL,1),(4560,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6618','4452','Intereses de obligaciones y bonos a corto plazo otras empresas',NULL,NULL,1),(4561,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','662','4550','Intereses de deudas',NULL,NULL,1),(4562,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6620','4561','Intereses de deudas empresas del grupo',NULL,NULL,1),(4563,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6621','4561','Intereses de deudas empresas asociadas',NULL,NULL,1),(4564,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6622','4561','Intereses de deudas otras partes vinculadas',NULL,NULL,1),(4565,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6623','4561','Intereses de deudas con entidades de crédito',NULL,NULL,1),(4566,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6624','4561','Intereses de deudas otras empresas',NULL,NULL,1),(4567,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','663','4550','Pérdidas por valorización de activos y pasivos financieros por su valor razonable',NULL,NULL,1),(4568,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','664','4550','Gastos por dividendos de acciones o participaciones consideradas como pasivos financieros',NULL,NULL,1),(4569,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6640','4568','Dividendos de pasivos empresas del grupo',NULL,NULL,1),(4570,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6641','4568','Dividendos de pasivos empresas asociadas',NULL,NULL,1),(4571,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6642','4568','Dividendos de pasivos otras partes vinculadas',NULL,NULL,1),(4572,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6643','4568','Dividendos de pasivos otras empresas',NULL,NULL,1),(4573,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','665','4550','Intereses por descuento de efectos y operaciones de factoring',NULL,NULL,1),(4574,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6650','4573','Intereses por descuento de efectos en entidades de crédito del grupo',NULL,NULL,1),(4575,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6651','4573','Intereses por descuento de efectos en entidades de crédito asociadas',NULL,NULL,1),(4576,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6652','4573','Intereses por descuento de efectos en entidades de crédito vinculadas',NULL,NULL,1),(4577,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6653','4573','Intereses por descuento de efectos en otras entidades de crédito',NULL,NULL,1),(4578,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6654','4573','Intereses por operaciones de factoring con entidades de crédito del grupo',NULL,NULL,1),(4579,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6655','4573','Intereses por operaciones de factoring con entidades de crédito asociadas',NULL,NULL,1),(4580,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6656','4573','Intereses por operaciones de factoring con otras entidades de crédito vinculadas',NULL,NULL,1),(4581,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6657','4573','Intereses por operaciones de factoring con otras entidades de crédito',NULL,NULL,1),(4582,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','666','4550','Pérdidas en participaciones y valores representativos de deuda',NULL,NULL,1),(4583,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6660','4582','Pérdidas en valores representativos de deuda a largo plazo empresas del grupo',NULL,NULL,1),(4584,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6661','4582','Pérdidas en valores representativos de deuda a largo plazo empresas asociadas',NULL,NULL,1),(4585,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6662','4582','Pérdidas en valores representativos de deuda a largo plazo otras partes vinculadas',NULL,NULL,1),(4586,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6663','4582','Pérdidas en participaciones y valores representativos de deuda a largo plazo otras empresas',NULL,NULL,1),(4587,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6665','4582','Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas del grupo',NULL,NULL,1),(4588,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6666','4582','Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas asociadas',NULL,NULL,1),(4589,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6667','4582','Pérdidas en valores representativos de deuda a corto plazo otras partes vinculadas',NULL,NULL,1),(4590,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6668','4582','Pérdidas en valores representativos de deuda a corto plazo otras empresas',NULL,NULL,1),(4591,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','667','4550','Pérdidas de créditos no comerciales',NULL,NULL,1),(4592,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6670','4591','Pérdidas de créditos a largo plazo empresas del grupo',NULL,NULL,1),(4593,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6671','4591','Pérdidas de créditos a largo plazo empresas asociadas',NULL,NULL,1),(4594,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6672','4591','Pérdidas de créditos a largo plazo otras partes vinculadas',NULL,NULL,1),(4595,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6673','4591','Pérdidas de créditos a largo plazo otras empresas',NULL,NULL,1),(4596,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6675','4591','Pérdidas de créditos a corto plazo empresas del grupo',NULL,NULL,1),(4597,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6676','4591','Pérdidas de créditos a corto plazo empresas asociadas',NULL,NULL,1),(4598,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6677','4591','Pérdidas de créditos a corto plazo otras partes vinculadas',NULL,NULL,1),(4599,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6678','4591','Pérdidas de créditos a corto plazo otras empresas',NULL,NULL,1),(4600,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','668','4550','Diferencias negativas de cambio',NULL,NULL,1),(4601,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','669','4550','Otros gastos financieros',NULL,NULL,1),(4602,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','67','4006','Pérdidas procedentes de activos no corrientes y gastos excepcionales',NULL,NULL,1),(4603,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','670','4602','Pérdidas procedentes del inmovilizado intangible',NULL,NULL,1),(4604,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','671','4602','Pérdidas procedentes del inmovilizado material',NULL,NULL,1),(4605,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','672','4602','Pérdidas procedentes de las inversiones inmobiliarias',NULL,NULL,1),(4607,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','673','4602','Pérdidas procedentes de participaciones a largo plazo en partes vinculadas',NULL,NULL,1),(4608,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6733','4607','Pérdidas procedentes de participaciones a largo plazo empresas del grupo',NULL,NULL,1),(4609,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6734','4607','Pérdidas procedentes de participaciones a largo plazo empresas asociadas',NULL,NULL,1),(4610,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6735','4607','Pérdidas procedentes de participaciones a largo plazo otras partes vinculadas',NULL,NULL,1),(4611,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','675','4602','Pérdidas por operaciones con obligaciones propias',NULL,NULL,1),(4612,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','678','4602','Gastos excepcionales',NULL,NULL,1),(4613,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','68','4006','Dotaciones para amortizaciones',NULL,NULL,1),(4614,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','680','4613','Amortización del inmovilizado intangible',NULL,NULL,1),(4615,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','681','4613','Amortización del inmovilizado material',NULL,NULL,1),(4616,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','682','4613','Amortización de las inversiones inmobiliarias',NULL,NULL,1),(4617,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','69','4006','Pérdidas por deterioro y otras dotaciones',NULL,NULL,1),(4618,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','690','4617','Pérdidas por deterioro del inmovilizado intangible',NULL,NULL,1),(4619,1,NULL,'2014-12-21 12:51:11','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','691','4617','Pérdidas por deterioro del inmovilizado material',NULL,NULL,1),(4620,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','692','4617','Pérdidas por deterioro de las inversiones inmobiliarias',NULL,NULL,1),(4621,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','693','4617','Pérdidas por deterioro de existencias',NULL,NULL,1),(4622,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6930','4621','Pérdidas por deterioro de productos terminados y en curso de fabricación',NULL,NULL,1),(4623,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6931','4621','Pérdidas por deterioro de mercaderías',NULL,NULL,1),(4624,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6932','4621','Pérdidas por deterioro de materias primas',NULL,NULL,1),(4625,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6933','4621','Pérdidas por deterioro de otros aprovisionamientos',NULL,NULL,1),(4626,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','694','4617','Pérdidas por deterioro de créditos por operaciones comerciales',NULL,NULL,1),(4627,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','695','4617','Dotación a la provisión por operaciones comerciales',NULL,NULL,1),(4628,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6954','4627','Dotación a la provisión por contratos onerosos',NULL,NULL,1),(4629,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6959','4628','Dotación a la provisión para otras operaciones comerciales',NULL,NULL,1),(4630,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','696','4617','Pérdidas por deterioro de participaciones y valores representativos de deuda a largo plazo',NULL,NULL,1),(4631,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6960','4630','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo',NULL,NULL,1),(4632,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6961','4630','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas',NULL,NULL,1),(4633,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6962','4630','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas',NULL,NULL,1),(4634,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6963','4630','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas',NULL,NULL,1),(4635,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6965','4630','Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas del grupo',NULL,NULL,1),(4636,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6966','4630','Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas asociadas',NULL,NULL,1),(4637,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6967','4630','Pérdidas por deterioro en valores representativos de deuda a largo plazo otras partes vinculadas',NULL,NULL,1),(4638,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6968','4630','Pérdidas por deterioro en valores representativos de deuda a largo plazo otras empresas',NULL,NULL,1),(4639,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','697','4617','Pérdidas por deterioro de créditos a largo plazo',NULL,NULL,1),(4640,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6970','4639','Pérdidas por deterioro de créditos a largo plazo empresas del grupo',NULL,NULL,1),(4641,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6971','4639','Pérdidas por deterioro de créditos a largo plazo empresas asociadas',NULL,NULL,1),(4642,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6972','4639','Pérdidas por deterioro de créditos a largo plazo otras partes vinculadas',NULL,NULL,1),(4643,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6973','4639','Pérdidas por deterioro de créditos a largo plazo otras empresas',NULL,NULL,1),(4644,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','698','4617','Pérdidas por deterioro de participaciones y valores representativos de deuda a corto plazo',NULL,NULL,1),(4645,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6980','4644','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo',NULL,NULL,1),(4646,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6981','4644','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas',NULL,NULL,1),(4647,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6985','4644','Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas del grupo',NULL,NULL,1),(4648,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6986','4644','Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas asociadas',NULL,NULL,1),(4649,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6988','4644','Pérdidas por deterioro en valores representativos de deuda a corto plazo de otras empresas',NULL,NULL,1),(4650,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','699','4617','Pérdidas por deterioro de crédito a corto plazo',NULL,NULL,1),(4651,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6990','4650','Pérdidas por deterioro de crédito a corto plazo empresas del grupo',NULL,NULL,1),(4652,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6991','4650','Pérdidas por deterioro de crédito a corto plazo empresas asociadas',NULL,NULL,1),(4653,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6992','4650','Pérdidas por deterioro de crédito a corto plazo otras partes vinculadas',NULL,NULL,1),(4654,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX','6993','4650','Pérdidas por deterioro de crédito a corto plazo otras empresas',NULL,NULL,1),(4655,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','70','4007','Ventas',NULL,NULL,1),(4656,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','VENTAS','700','4655','Ventas de mercaderías',NULL,NULL,1),(4657,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','VENTAS','701','4655','Ventas de productos terminados',NULL,NULL,1),(4658,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','702','4655','Ventas de productos semiterminados',NULL,NULL,1),(4659,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','703','4655','Ventas de subproductos y residuos',NULL,NULL,1),(4660,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','704','4655','Ventas de envases y embalajes',NULL,NULL,1),(4661,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','VENTAS','705','4655','Prestaciones de servicios',NULL,NULL,1),(4662,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','706','4655','Descuentos sobre ventas por pronto pago',NULL,NULL,1),(4663,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7060','4662','Descuentos sobre ventas por pronto pago de mercaderías',NULL,NULL,1),(4664,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7061','4662','Descuentos sobre ventas por pronto pago de productos terminados',NULL,NULL,1),(4665,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7062','4662','Descuentos sobre ventas por pronto pago de productos semiterminados',NULL,NULL,1),(4666,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7063','4662','Descuentos sobre ventas por pronto pago de subproductos y residuos',NULL,NULL,1),(4667,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','708','4655','Devoluciones de ventas y operacioes similares',NULL,NULL,1),(4668,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7080','4667','Devoluciones de ventas de mercaderías',NULL,NULL,1),(4669,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7081','4667','Devoluciones de ventas de productos terminados',NULL,NULL,1),(4670,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7082','4667','Devoluciones de ventas de productos semiterminados',NULL,NULL,1),(4671,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7083','4667','Devoluciones de ventas de subproductos y residuos',NULL,NULL,1),(4672,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7084','4667','Devoluciones de ventas de envases y embalajes',NULL,NULL,1),(4673,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','71','4007','Variación de existencias',NULL,NULL,1),(4674,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','710','4673','Variación de existencias de productos en curso',NULL,NULL,1),(4675,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','711','4673','Variación de existencias de productos semiterminados',NULL,NULL,1),(4676,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','712','4673','Variación de existencias de productos terminados',NULL,NULL,1),(4677,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','713','4673','Variación de existencias de subproductos, residuos y materiales recuperados',NULL,NULL,1),(4678,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','73','4007','Trabajos realizados para la empresa',NULL,NULL,1),(4679,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','730','4678','Trabajos realizados para el inmovilizado intangible',NULL,NULL,1),(4680,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','731','4678','Trabajos realizados para el inmovilizado tangible',NULL,NULL,1),(4681,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','732','4678','Trabajos realizados en inversiones inmobiliarias',NULL,NULL,1),(4682,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','733','4678','Trabajos realizados para el inmovilizado material en curso',NULL,NULL,1),(4683,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','74','4007','Subvenciones, donaciones y legados',NULL,NULL,1),(4684,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','740','4683','Subvenciones, donaciones y legados a la explotación',NULL,NULL,1),(4685,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','746','4683','Subvenciones, donaciones y legados de capital transferidos al resultado del ejercicio',NULL,NULL,1),(4686,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','747','4683','Otras subvenciones, donaciones y legados transferidos al resultado del ejercicio',NULL,NULL,1),(4687,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','75','4007','Otros ingresos de gestión',NULL,NULL,1),(4688,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','751','4687','Resultados de operaciones en común',NULL,NULL,1),(4689,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7510','4688','Pérdida transferida gestor',NULL,NULL,1),(4690,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7511','4688','Beneficio atribuido participe o asociado no gestor',NULL,NULL,1),(4691,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','752','4687','Ingreso por arrendamiento',NULL,NULL,1),(4692,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','753','4687','Ingresos de propiedad industrial cedida en explotación',NULL,NULL,1),(4693,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','754','4687','Ingresos por comisiones',NULL,NULL,1),(4694,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','755','4687','Ingresos por servicios al personal',NULL,NULL,1),(4695,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','759','4687','Ingresos por servicios diversos',NULL,NULL,1),(4696,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76','4007','Ingresos financieros',NULL,NULL,1),(4697,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','760','4696','Ingresos de participaciones en instrumentos de patrimonio',NULL,NULL,1),(4698,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7600','4697','Ingresos de participaciones en instrumentos de patrimonio empresas del grupo',NULL,NULL,1),(4699,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7601','4697','Ingresos de participaciones en instrumentos de patrimonio empresas asociadas',NULL,NULL,1),(4700,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7602','4697','Ingresos de participaciones en instrumentos de patrimonio otras partes asociadas',NULL,NULL,1),(4701,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7603','4697','Ingresos de participaciones en instrumentos de patrimonio otras empresas',NULL,NULL,1),(4702,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','761','4696','Ingresos de valores representativos de deuda',NULL,NULL,1),(4703,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7610','4702','Ingresos de valores representativos de deuda empresas del grupo',NULL,NULL,1),(4704,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7611','4702','Ingresos de valores representativos de deuda empresas asociadas',NULL,NULL,1),(4705,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7612','4702','Ingresos de valores representativos de deuda otras partes asociadas',NULL,NULL,1),(4706,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7613','4702','Ingresos de valores representativos de deuda otras empresas',NULL,NULL,1),(4707,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','762','4696','Ingresos de créditos',NULL,NULL,1),(4708,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7620','4707','Ingresos de créditos a largo plazo',NULL,NULL,1),(4709,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76200','4708','Ingresos de crédito a largo plazo empresas del grupo',NULL,NULL,1),(4710,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76201','4708','Ingresos de crédito a largo plazo empresas asociadas',NULL,NULL,1),(4711,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76202','4708','Ingresos de crédito a largo plazo otras partes asociadas',NULL,NULL,1),(4712,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76203','4708','Ingresos de crédito a largo plazo otras empresas',NULL,NULL,1),(4713,1,NULL,'2014-12-21 12:51:12','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7621','4707','Ingresos de créditos a corto plazo',NULL,NULL,1),(4714,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76210','4713','Ingresos de crédito a corto plazo empresas del grupo',NULL,NULL,1),(4715,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76211','4713','Ingresos de crédito a corto plazo empresas asociadas',NULL,NULL,1),(4716,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76212','4713','Ingresos de crédito a corto plazo otras partes asociadas',NULL,NULL,1),(4717,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76213','4713','Ingresos de crédito a corto plazo otras empresas',NULL,NULL,1),(4718,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','763','4696','Beneficios por valorización de activos y pasivos financieros por su valor razonable',NULL,NULL,1),(4719,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','766','4696','Beneficios en participaciones y valores representativos de deuda',NULL,NULL,1),(4720,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7660','4719','Beneficios en participaciones y valores representativos de deuda a largo plazo empresas del grupo',NULL,NULL,1),(4721,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7661','4719','Beneficios en participaciones y valores representativos de deuda a largo plazo empresas asociadas',NULL,NULL,1),(4722,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7662','4719','Beneficios en participaciones y valores representativos de deuda a largo plazo otras partes asociadas',NULL,NULL,1),(4723,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7663','4719','Beneficios en participaciones y valores representativos de deuda a largo plazo otras empresas',NULL,NULL,1),(4724,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7665','4719','Beneficios en participaciones y valores representativos de deuda a corto plazo empresas del grupo',NULL,NULL,1),(4725,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7666','4719','Beneficios en participaciones y valores representativos de deuda a corto plazo empresas asociadas',NULL,NULL,1),(4726,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7667','4719','Beneficios en participaciones y valores representativos de deuda a corto plazo otras partes asociadas',NULL,NULL,1),(4727,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7668','4719','Beneficios en participaciones y valores representativos de deuda a corto plazo otras empresas',NULL,NULL,1),(4728,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','768','4696','Diferencias positivas de cambio',NULL,NULL,1),(4729,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','769','4696','Otros ingresos financieros',NULL,NULL,1),(4730,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','77','4007','Beneficios procedentes de activos no corrientes e ingresos excepcionales',NULL,NULL,1),(4731,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','770','4730','Beneficios procedentes del inmovilizado intangible',NULL,NULL,1),(4732,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','771','4730','Beneficios procedentes del inmovilizado material',NULL,NULL,1),(4733,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','772','4730','Beneficios procedentes de las inversiones inmobiliarias',NULL,NULL,1),(4734,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','773','4730','Beneficios procedentes de participaciones a largo plazo en partes vinculadas',NULL,NULL,1),(4735,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7733','4734','Beneficios procedentes de participaciones a largo plazo empresas del grupo',NULL,NULL,1),(4736,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7734','4734','Beneficios procedentes de participaciones a largo plazo empresas asociadas',NULL,NULL,1),(4737,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7735','4734','Beneficios procedentes de participaciones a largo plazo otras partes vinculadas',NULL,NULL,1),(4738,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','775','4730','Beneficios por operaciones con obligaciones propias',NULL,NULL,1),(4739,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','778','4730','Ingresos excepcionales',NULL,NULL,1),(4741,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','79','4007','Excesos y aplicaciones de provisiones y pérdidas por deterioro',NULL,NULL,1),(4742,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','790','4741','Revisión del deterioro del inmovilizado intangible',NULL,NULL,1),(4743,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','791','4741','Revisión del deterioro del inmovilizado material',NULL,NULL,1),(4744,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','792','4741','Revisión del deterioro de las inversiones inmobiliarias',NULL,NULL,1),(4745,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','793','4741','Revisión del deterioro de las existencias',NULL,NULL,1),(4746,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7930','4745','Revisión del deterioro de productos terminados y en curso de fabricación',NULL,NULL,1),(4747,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7931','4745','Revisión del deterioro de mercaderías',NULL,NULL,1),(4748,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7932','4745','Revisión del deterioro de materias primas',NULL,NULL,1),(4749,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7933','4745','Revisión del deterioro de otros aprovisionamientos',NULL,NULL,1),(4750,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','794','4741','Revisión del deterioro de créditos por operaciones comerciales',NULL,NULL,1),(4751,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','795','4741','Exceso de provisiones',NULL,NULL,1),(4752,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7951','4751','Exceso de provisión para impuestos',NULL,NULL,1),(4753,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7952','4751','Exceso de provisión para otras responsabilidades',NULL,NULL,1),(4755,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7954','4751','Exceso de provisión para operaciones comerciales',NULL,NULL,1),(4756,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','79544','4755','Exceso de provisión por contratos onerosos',NULL,NULL,1),(4757,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','79549','4755','Exceso de provisión para otras operaciones comerciales',NULL,NULL,1),(4758,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7955','4751','Exceso de provisión para actuaciones medioambienteales',NULL,NULL,1),(4759,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','796','4741','Revisión del deterioro de participaciones y valores representativos de deuda a largo plazo',NULL,NULL,1),(4760,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7960','4759','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo',NULL,NULL,1),(4761,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7961','4759','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas',NULL,NULL,1),(4762,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7962','4759','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas',NULL,NULL,1),(4763,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7963','4759','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas',NULL,NULL,1),(4764,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7965','4759','Revisión del deterioro de valores representativos a largo plazo empresas del grupo',NULL,NULL,1),(4765,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7966','4759','Revisión del deterioro de valores representativos a largo plazo empresas asociadas',NULL,NULL,1),(4766,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7967','4759','Revisión del deterioro de valores representativos a largo otras partes vinculadas',NULL,NULL,1),(4767,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7968','4759','Revisión del deterioro de valores representativos a largo plazo otras empresas',NULL,NULL,1),(4768,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','797','4741','Revisión del deterioro de créditos a largo plazo',NULL,NULL,1),(4769,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7970','4768','Revisión del deterioro de créditos a largo plazo empresas del grupo',NULL,NULL,1),(4770,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7971','4768','Revisión del deterioro de créditos a largo plazo empresas asociadas',NULL,NULL,1),(4771,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7972','4768','Revisión del deterioro de créditos a largo plazo otras partes vinculadas',NULL,NULL,1),(4772,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7973','4768','Revisión del deterioro de créditos a largo plazo otras empresas',NULL,NULL,1),(4773,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','798','4741','Revisión del deterioro de participaciones y valores representativos de deuda a corto plazo',NULL,NULL,1),(4774,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7980','4773','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo',NULL,NULL,1),(4775,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7981','4773','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas',NULL,NULL,1),(4776,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7985','4773','Revisión del deterioro de valores representativos de deuda a corto plazo empresas del grupo',NULL,NULL,1),(4777,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7986','4773','Revisión del deterioro de valores representativos de deuda a corto plazo empresas asociadas',NULL,NULL,1),(4778,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7987','4773','Revisión del deterioro de valores representativos de deuda a corto plazo otras partes vinculadas',NULL,NULL,1),(4779,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7988','4773','Revisión del deterioro de valores representativos de deuda a corto plazo otras empresas',NULL,NULL,1),(4780,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','799','4741','Revisión del deterioro de créditos a corto plazo',NULL,NULL,1),(4781,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7990','4780','Revisión del deterioro de créditos a corto plazo empresas del grupo',NULL,NULL,1),(4782,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7991','4780','Revisión del deterioro de créditos a corto plazo empresas asociadas',NULL,NULL,1),(4783,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7992','4780','Revisión del deterioro de créditos a corto plazo otras partes vinculadas',NULL,NULL,1),(4784,1,NULL,'2014-12-21 12:51:13','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7993','4780','Revisión del deterioro de créditos a corto plazo otras empresas',NULL,NULL,1); /*!40000 ALTER TABLE `llx_accountingaccount` ENABLE KEYS */; UNLOCK TABLES; @@ -768,7 +768,7 @@ CREATE TABLE `llx_bank` ( LOCK TABLES `llx_bank` WRITE; /*!40000 ALTER TABLE `llx_bank` DISABLE KEYS */; -INSERT INTO `llx_bank` VALUES (1,'2010-07-08 23:56:14','2013-03-07 21:28:51','2010-07-08','2010-07-08',2000.00000000,'(Initial balance)',1,NULL,1,'SOLD','201210',NULL,1,NULL,0,NULL,NULL,NULL),(2,'2010-07-09 00:00:24','0000-00-00 00:00:00','2010-07-09','2010-07-09',500.00000000,'(Initial balance)',2,NULL,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(3,'2010-07-10 13:33:42','0000-00-00 00:00:00','2010-07-10','2010-07-10',0.00000000,'(Solde initial)',3,NULL,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(4,'2010-07-10 14:59:41','0000-00-00 00:00:00','2010-07-10','2010-07-10',0.02000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,'Client salon invidivdu',NULL),(5,'2011-07-18 20:50:24','0000-00-00 00:00:00','2011-07-08','2011-07-08',20.00000000,'(CustomerInvoicePayment)',1,1,NULL,'CB','201107',NULL,1,NULL,0,NULL,NULL,NULL),(6,'2011-07-18 20:50:47','0000-00-00 00:00:00','2011-07-08','2011-07-08',10.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(8,'2011-08-01 03:34:11','2013-03-07 21:28:51','2011-08-01','2011-08-01',5.63000000,'(CustomerInvoicePayment)',1,1,1,'CB','201210',NULL,1,NULL,0,NULL,NULL,NULL),(12,'2011-08-05 23:11:37','2013-03-07 21:33:57','2011-08-05','2011-08-05',-10.00000000,'(SocialContributionPayment)',1,1,1,'VIR','201210',NULL,1,NULL,0,NULL,NULL,NULL),(13,'2011-08-06 20:33:54','0000-00-00 00:00:00','2011-08-06','2011-08-06',5.98000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(14,'2011-08-08 02:53:40','0000-00-00 00:00:00','2011-08-08','2011-08-08',26.10000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(15,'2011-08-08 02:55:58','2013-03-07 21:39:20','2011-08-08','2011-08-08',26.96000000,'(CustomerInvoicePayment)',1,1,1,'TIP','201211',NULL,1,NULL,0,NULL,NULL,NULL),(16,'2012-12-09 15:28:44','2012-12-09 14:28:44','2012-12-09','2012-12-09',2.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(17,'2012-12-09 15:28:53','2012-12-09 14:33:07','2012-12-09','2012-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(18,'2012-12-09 17:35:55','2012-12-09 16:35:55','2012-12-09','2012-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(19,'2012-12-09 17:37:02','2012-12-09 16:37:02','2012-12-09','2012-12-09',2.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(20,'2012-12-09 18:35:07','2012-12-09 17:35:07','2012-12-09','2012-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(21,'2012-12-12 18:54:33','2013-03-07 21:28:51','2012-12-12','2012-12-12',1.00000000,'(CustomerInvoicePayment)',1,1,1,'TIP','201210',NULL,1,NULL,0,NULL,NULL,NULL),(22,'2013-03-06 16:48:16','2013-03-06 15:48:16','2013-03-06','2013-03-06',20.00000000,'(SubscriptionPayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(23,'2013-03-20 14:30:11','2013-03-20 13:30:11','2013-03-20','2013-03-20',10.00000000,'(SubscriptionPayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(24,'2014-03-02 19:57:58','2014-03-02 18:57:58','2013-07-09','2013-07-09',605.00000000,'(CustomerInvoicePayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,'111',NULL),(25,'2014-03-02 19:59:48','2014-03-02 18:59:48','2013-03-22','2013-03-22',30.00000000,'(CustomerInvoicePayment)',1,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(26,'2014-03-02 20:01:39','2014-03-02 19:01:39','2013-03-19','2013-03-19',500.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(27,'2014-03-02 20:02:06','2014-03-02 19:02:06','2013-03-21','2013-03-21',400.00000000,'(CustomerInvoicePayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,'ABC and Co',NULL),(28,'2014-03-03 19:22:32','2014-03-03 18:22:32','2013-10-03','2013-10-03',-400.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(29,'2014-03-03 19:23:16','2014-03-03 18:23:16','2013-03-10','2013-03-10',-300.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL); +INSERT INTO `llx_bank` VALUES (1,'2010-07-08 23:56:14','2013-03-07 21:28:51','2010-07-08','2010-07-08',2000.00000000,'(Initial balance)',1,NULL,1,'SOLD','201210',NULL,1,NULL,0,NULL,NULL,NULL),(2,'2010-07-09 00:00:24',NOW(),'2010-07-09','2010-07-09',500.00000000,'(Initial balance)',2,NULL,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(3,'2010-07-10 13:33:42',NOW(),'2010-07-10','2010-07-10',0.00000000,'(Solde initial)',3,NULL,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(4,'2010-07-10 14:59:41',NOW(),'2010-07-10','2010-07-10',0.02000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,'Client salon invidivdu',NULL),(5,'2011-07-18 20:50:24',NOW(),'2011-07-08','2011-07-08',20.00000000,'(CustomerInvoicePayment)',1,1,NULL,'CB','201107',NULL,1,NULL,0,NULL,NULL,NULL),(6,'2011-07-18 20:50:47',NOW(),'2011-07-08','2011-07-08',10.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(8,'2011-08-01 03:34:11','2013-03-07 21:28:51','2011-08-01','2011-08-01',5.63000000,'(CustomerInvoicePayment)',1,1,1,'CB','201210',NULL,1,NULL,0,NULL,NULL,NULL),(12,'2011-08-05 23:11:37','2013-03-07 21:33:57','2011-08-05','2011-08-05',-10.00000000,'(SocialContributionPayment)',1,1,1,'VIR','201210',NULL,1,NULL,0,NULL,NULL,NULL),(13,'2011-08-06 20:33:54',NOW(),'2011-08-06','2011-08-06',5.98000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(14,'2011-08-08 02:53:40',NOW(),'2011-08-08','2011-08-08',26.10000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(15,'2011-08-08 02:55:58','2013-03-07 21:39:20','2011-08-08','2011-08-08',26.96000000,'(CustomerInvoicePayment)',1,1,1,'TIP','201211',NULL,1,NULL,0,NULL,NULL,NULL),(16,'2012-12-09 15:28:44','2012-12-09 14:28:44','2012-12-09','2012-12-09',2.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(17,'2012-12-09 15:28:53','2012-12-09 14:33:07','2012-12-09','2012-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(18,'2012-12-09 17:35:55','2012-12-09 16:35:55','2012-12-09','2012-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(19,'2012-12-09 17:37:02','2012-12-09 16:37:02','2012-12-09','2012-12-09',2.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(20,'2012-12-09 18:35:07','2012-12-09 17:35:07','2012-12-09','2012-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(21,'2012-12-12 18:54:33','2013-03-07 21:28:51','2012-12-12','2012-12-12',1.00000000,'(CustomerInvoicePayment)',1,1,1,'TIP','201210',NULL,1,NULL,0,NULL,NULL,NULL),(22,'2013-03-06 16:48:16','2013-03-06 15:48:16','2013-03-06','2013-03-06',20.00000000,'(SubscriptionPayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(23,'2013-03-20 14:30:11','2013-03-20 13:30:11','2013-03-20','2013-03-20',10.00000000,'(SubscriptionPayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(24,'2014-03-02 19:57:58','2014-03-02 18:57:58','2013-07-09','2013-07-09',605.00000000,'(CustomerInvoicePayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,'111',NULL),(25,'2014-03-02 19:59:48','2014-03-02 18:59:48','2013-03-22','2013-03-22',30.00000000,'(CustomerInvoicePayment)',1,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(26,'2014-03-02 20:01:39','2014-03-02 19:01:39','2013-03-19','2013-03-19',500.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(27,'2014-03-02 20:02:06','2014-03-02 19:02:06','2013-03-21','2013-03-21',400.00000000,'(CustomerInvoicePayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,'ABC and Co',NULL),(28,'2014-03-03 19:22:32','2014-03-03 18:22:32','2013-10-03','2013-10-03',-400.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL),(29,'2014-03-03 19:23:16','2014-03-03 18:23:16','2013-03-10','2013-03-10',-300.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL); /*!40000 ALTER TABLE `llx_bank` ENABLE KEYS */; UNLOCK TABLES; @@ -2826,7 +2826,7 @@ CREATE TABLE `llx_commande_fournisseur_dispatch` ( LOCK TABLES `llx_commande_fournisseur_dispatch` WRITE; /*!40000 ALTER TABLE `llx_commande_fournisseur_dispatch` DISABLE KEYS */; -INSERT INTO `llx_commande_fournisseur_dispatch` VALUES (1,2,4,0,2,1,1,'2010-07-11 18:49:44',NULL,NULL,'0000-00-00 00:00:00',NULL,NULL,NULL); +INSERT INTO `llx_commande_fournisseur_dispatch` VALUES (1,2,4,0,2,1,1,'2010-07-11 18:49:44',NULL,NULL,NOW(),NULL,NULL,NULL); /*!40000 ALTER TABLE `llx_commande_fournisseur_dispatch` ENABLE KEYS */; UNLOCK TABLES; @@ -5823,7 +5823,7 @@ CREATE TABLE `llx_opensurvey_sondage` ( LOCK TABLES `llx_opensurvey_sondage` WRITE; /*!40000 ALTER TABLE `llx_opensurvey_sondage` DISABLE KEYS */; -INSERT INTO `llx_opensurvey_sondage` VALUES ('m4467s2mtk6khmxc','m4467s2mtk6khmxci2ysw682','fdffdshfghfj jhgjgh','aaa@aaa.com','fdfds',0,'fdffds','2013-03-07 00:00:00','D+',1,1,'dolibarr','0000-00-00 00:00:00',1,1,1,NULL); +INSERT INTO `llx_opensurvey_sondage` VALUES ('m4467s2mtk6khmxc','m4467s2mtk6khmxci2ysw682','fdffdshfghfj jhgjgh','aaa@aaa.com','fdfds',0,'fdffds','2013-03-07 00:00:00','D+',1,1,'dolibarr',NOW(),1,1,1,NULL); /*!40000 ALTER TABLE `llx_opensurvey_sondage` ENABLE KEYS */; UNLOCK TABLES; diff --git a/dev/skeletons/build_class_from_table.php b/dev/skeletons/build_class_from_table.php index e83b9e2debf..f4f25c84391 100755 --- a/dev/skeletons/build_class_from_table.php +++ b/dev/skeletons/build_class_from_table.php @@ -50,16 +50,16 @@ print "***** $script_file ($version) *****\n"; // -------------------- START OF BUILD_CLASS_FROM_TABLE SCRIPT -------------------- // Check parameters -if (! isset($argv[1]) || (isset($argv[2]) && ! isset($argv[6]))) +if (! isset($argv[1]) || ! isset($argv[2]) || (isset($argv[3]) && ! isset($argv[7]))) { - print "Usage: $script_file tablename [server port databasename user pass]\n"; + print "Usage: $script_file tablename modulename [server port databasename user pass]\n"; exit; } -if (isset($argv[2]) && isset($argv[3]) && isset($argv[4]) && isset($argv[5]) && isset($argv[6])) +if (isset($argv[3]) && isset($argv[4]) && isset($argv[5]) && isset($argv[6]) && isset($argv[7])) { print 'Use specific database ids'."\n"; - $db=getDoliDBInstance('mysqli',$argv[2],$argv[5],$argv[6],$argv[4],$argv[3]); + $db=getDoliDBInstance('mysqli',$argv[3],$argv[6],$argv[7],$argv[5],$argv[4]); } if ($db->type != 'mysql' && $db->type != 'mysqli') @@ -68,14 +68,18 @@ if ($db->type != 'mysql' && $db->type != 'mysqli') exit; } +$table=$argv[1]; +$module=$argv[2]; + // Show parameters -print 'Tablename='.$argv[1]."\n"; -print "Current dir is ".getcwd()."\n"; +print 'Tablename: '.$table."\n"; +print 'Modulename: '.$module."\n"; +print "Current dir: ".getcwd()."\n"; +print "Database name: ".$db->database_name."\n"; // Define array with list of properties $property=array(); -$table=$argv[1]; $foundprimary=0; $resql=$db->DDLDescTable($table); if ($resql) @@ -159,7 +163,7 @@ foreach($property as $key => $prop) // Define working variables $table=strtolower($table); -$tablenoprefix=preg_replace('/'.preg_quote(MAIN_DB_PREFIX).'/i','',$table); +$tablenoprefix=preg_replace('/'.preg_quote(MAIN_DB_PREFIX,'/').'/i','',$table); $classname=preg_replace('/_/','',ucfirst($tablenoprefix)); $classmin=preg_replace('/_/','',strtolower($classname)); @@ -179,11 +183,18 @@ if (! $sourcecontent) $outfile='out.'.$classmin.'.class.php'; $targetcontent=$sourcecontent; +// Substitute module name +$targetcontent=preg_replace('/dev\/skeletons/', $module, $targetcontent); +$targetcontent=preg_replace('/mymodule othermodule1 othermodule2/', $module, $targetcontent); +$targetcontent=preg_replace('/mymodule/', $module, $targetcontent); + // Substitute class name $targetcontent=preg_replace('/skeleton_class\.class\.php/', $classmin.'.class.php', $targetcontent); $targetcontent=preg_replace('/\$element = \'skeleton\'/', '\$element = \''.$classmin.'\'', $targetcontent); $targetcontent=preg_replace('/\$table_element = \'skeleton\'/', '\$table_element = \''.$tablenoprefix.'\'', $targetcontent); $targetcontent=preg_replace('/Skeleton_Class/', $classname, $targetcontent); +$targetcontent=preg_replace('/skeletons/', $classmin, $targetcontent); +$targetcontent=preg_replace('/skeleton/', $classmin, $targetcontent); // Substitute comments $targetcontent=preg_replace('/This file is an example to create a new class file/', 'Put here description of this class', $targetcontent); @@ -207,8 +218,8 @@ foreach($property as $key => $prop) $varprop.="\n"; } } -$targetcontent=preg_replace('/public \$prop1;/', $varprop, $targetcontent); -$targetcontent=preg_replace('/public \$prop2;/', '', $targetcontent); +$targetcontent=preg_replace('/'.preg_quote('public $prop1;','/').'/', $varprop, $targetcontent); +$targetcontent=preg_replace('/'.preg_quote('public $prop2;','/').'/', '', $targetcontent); $targetcontent=preg_replace('/\*((\s|\n|\r|\t)*)\@var mixed Sample property 1((\s|\n|\r|\t)*)/', '', $targetcontent); $targetcontent=preg_replace('/\*((\s|\n|\r|\t)*)\@var mixed Sample property 2((\s|\n|\r|\t)*)/', '', $targetcontent); @@ -227,6 +238,13 @@ foreach($property as $key => $prop) $targetcontent=preg_replace('/if \(isset\(\$this->prop1\)\) {((\n|\r|\t)*)\$this->prop1 = trim\(\$this->prop1\);((\n|\r|\t)*)}/', $varprop, $targetcontent); $targetcontent=preg_replace('/if \(isset\(\$this->prop2\)\) {((\n|\r|\t)*)\$this->prop2 = trim\(\$this->prop2\);((\n|\r|\t)*)}/', '', $targetcontent); + +$no_output_field=0; +foreach($property as $key => $prop) +{ + if ($prop['field'] == 'tms') $no_output_field++; // This is a field of type timestamp edited automatically + if ($prop['extra'] == 'auto_increment') $no_output_field++; +} // Substitute insert into parameters $varprop="\n"; $cleanparam=''; @@ -241,7 +259,7 @@ foreach($property as $key => $prop) if ($addfield) { $varprop.="\t\t\$sql.= '".$prop['field']; - if ($i < count($property)) $varprop.=","; + if ($i <= count($property)-$no_output_field) $varprop.=","; $varprop.="';"; $varprop.="\n"; } @@ -255,12 +273,7 @@ $cleanparam=''; $i=0; //Count nb field to output to manage commat at end SQL instruction -$no_output_field=0; -foreach($property as $key => $prop) -{ - if ($prop['field'] == 'tms') $no_output_field++; // This is a field of type timestamp edited automatically - if ($prop['extra'] == 'auto_increment') $no_output_field++; -} + foreach($property as $key => $prop) { @@ -281,7 +294,7 @@ foreach($property as $key => $prop) elseif ($prop['istime']) { $varprop.='\'.(! isset($this->'.$prop['field'].') || dol_strlen($this->'.$prop['field'].')==0?\'NULL\':"\'".$this->db->idate('; - $varprop.="\$this->".$prop['field'].""; + $varprop.="\$this->".$prop['field']; $varprop.=").\"'\")"; } elseif ($prop['ischar']) @@ -297,16 +310,16 @@ foreach($property as $key => $prop) elseif ($prop['isint']) { $varprop.='\'.(! isset($this->'.$prop['field'].')?\'NULL\':'; - $varprop.="\$this->".$prop['field'].""; + $varprop.="\$this->".$prop['field']; $varprop.=')'; } else { - $varprop.=' \'.(! isset($this->'.$prop['field'].')?\'NULL\':"\'".'; - $varprop.="\$this->".$prop['field'].""; - $varprop.='.\').'; - + $varprop.='\'.(! isset($this->'.$prop['field'].')?\'NULL\':"\'".'; + $varprop.="\$this->".$prop['field']; + $varprop.='."\'")'; } + if ($i < (count($property)-$no_output_field)) $varprop.=".','"; $varprop.=';'; $varprop.="\n"; @@ -436,6 +449,7 @@ if ($fp) else $error++; + //-------------------------------- // Build skeleton_script.php //-------------------------------- @@ -455,12 +469,19 @@ if (! $sourcecontent) $outfile='out.'.$classmin.'_script.php'; $targetcontent=$sourcecontent; +// Substitute module name +$targetcontent=preg_replace('/dev\/skeletons/', $module, $targetcontent); +$targetcontent=preg_replace('/mymodule othermodule1 othermodule2/', $module, $targetcontent); +$targetcontent=preg_replace('/mymodule/', $module, $targetcontent); + // Substitute class name $targetcontent=preg_replace('/skeleton_class\.class\.php/', $classmin.'.class.php', $targetcontent); $targetcontent=preg_replace('/skeleton_script\.php/', $classmin.'_script.php', $targetcontent); $targetcontent=preg_replace('/\$element = \'skeleton\'/', '\$element=\''.$classmin.'\'', $targetcontent); $targetcontent=preg_replace('/\$table_element = \'skeleton\'/', '\$table_element=\''.$classmin.'\'', $targetcontent); $targetcontent=preg_replace('/Skeleton_Class/', $classname, $targetcontent); +$targetcontent=preg_replace('/skeletons/', $classmin, $targetcontent); +$targetcontent=preg_replace('/skeleton/', $classmin, $targetcontent); // Substitute comments $targetcontent=preg_replace('/This file is an example to create a new class file/', 'Put here description of this class', $targetcontent); @@ -501,13 +522,19 @@ if (! $sourcecontent) $outfile='out.'.$classmin.'_page.php'; $targetcontent=$sourcecontent; +// Substitute module name +$targetcontent=preg_replace('/dev\/skeletons/', $module, $targetcontent); +$targetcontent=preg_replace('/mymodule othermodule1 othermodule2/', $module, $targetcontent); +$targetcontent=preg_replace('/mymodule/', $module, $targetcontent); + // Substitute class name $targetcontent=preg_replace('/skeleton_class\.class\.php/', $classmin.'.class.php', $targetcontent); $targetcontent=preg_replace('/skeleton_script\.php/', $classmin.'_script.php', $targetcontent); $targetcontent=preg_replace('/\$element = \'skeleton\'/', '\$element=\''.$classmin.'\'', $targetcontent); $targetcontent=preg_replace('/\$table_element = \'skeleton\'/', '\$table_element=\''.$classmin.'\'', $targetcontent); $targetcontent=preg_replace('/Skeleton_Class/', $classname, $targetcontent); -$targetcontent=preg_replace('/skeleton/', $classname, $targetcontent); +$targetcontent=preg_replace('/skeletons/', $classmin, $targetcontent); +$targetcontent=preg_replace('/skeleton/', $classmin, $targetcontent); // Substitute comments $targetcontent=preg_replace('/This file is an example to create a new class file/', 'Put here description of this class', $targetcontent); @@ -517,9 +544,79 @@ $targetcontent=preg_replace('/Put here some comments/','Initialy built by build_ // Substitute table name $targetcontent=preg_replace('/MAIN_DB_PREFIX."mytable/', 'MAIN_DB_PREFIX."'.$tablenoprefix, $targetcontent); +// Substitute GETPOST search_fieldx +$varprop="\n"; +$cleanparam=''; +foreach($property as $key => $prop) +{ + if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime']) + { + if ($prop['isint']) $varprop.='$search_'.$prop['field']."=GETPOST('search_".$prop['field']."','int');\n"; + else $varprop.='$search_'.$prop['field']."=GETPOST('search_".$prop['field']."','alpha');\n"; + } +} +$targetcontent=preg_replace('/'.preg_quote('$search_field1=GETPOST("search_field1");','/').'/', $varprop, $targetcontent); +$targetcontent=preg_replace('/'.preg_quote('$search_field2=GETPOST("search_field2");','/').'/', '', $targetcontent); + +// Substitute GETPOST fieldx +$varprop="\n"; +$cleanparam=''; +foreach($property as $key => $prop) +{ + if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime']) + { + if ($prop['isint']) $varprop.="\t\$object->".$prop['field']."=GETPOST('".$prop['field']."','int');\n"; + else $varprop.="\t\$object->".$prop['field']."=GETPOST('".$prop['field']."','alpha');\n"; + } +} +$targetcontent=preg_replace('/'.preg_quote('$object->prop1=GETPOST("field1");','/').'/', $varprop, $targetcontent); +$targetcontent=preg_replace('/'.preg_quote('$object->prop2=GETPOST("field2");','/').'/', '', $targetcontent); + // Substitute fetch/select parameters -$targetcontent=preg_replace('/\$sql \.= " t\.field1,";/', $varpropselect, $targetcontent); -$targetcontent=preg_replace('/\$sql \.= " t\.field2";/', '', $targetcontent); +$targetcontent=preg_replace('/\$sql\s*\.= " t\.field1,";/', $varpropselect, $targetcontent); +$targetcontent=preg_replace('/\$sql\s*\.= " t\.field2";/', '', $targetcontent); + +// Substitute where for search +$varprop="\n"; +$cleanparam=''; +foreach($property as $key => $prop) +{ + if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime']) + { + $varprop.='if ($search_'.$prop['field'].') $sql.= natural_search("'.$prop['field'].'",$search_'.$prop['field'].');'."\n"; + } +} +$targetcontent=preg_replace('/'.preg_quote('if ($search_field1) $sql.= natural_search("field1",$search_field1);','/').'/', $varprop, $targetcontent); +$targetcontent=preg_replace('/'.preg_quote('if ($search_field2) $sql.= natural_search("field2",$search_field2);','/').'/', '', $targetcontent); + +// Substitute print_liste_field_titre +$varprop="\n"; +$cleanparam=''; +foreach($property as $key => $prop) +{ + if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime']) + { + $varprop.="print_liste_field_titre(\$langs->trans('".$prop['field']."'),\$_SERVER['PHP_SELF'],'t.".$prop['field']."','',\$param,'',\$sortfield,\$sortorder);\n"; + } +} + +$targetcontent=preg_replace('/'.preg_quote("print_liste_field_titre(\$langs->trans('field1'),\$_SERVER['PHP_SELF'],'t.field1','',\$param,'',\$sortfield,\$sortorder);",'/').'/', $varprop, $targetcontent); +$targetcontent=preg_replace('/'.preg_quote("print_liste_field_titre(\$langs->trans('field2'),\$_SERVER['PHP_SELF'],'t.field1','',\$param,'',\$sortfield,\$sortorder);",'/').'/', '', $targetcontent); + +// Substitute where for .fieldx. +$varprop="\n"; +$cleanparam=''; +foreach($property as $key => $prop) +{ + if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime']) + { + $varprop.="print ''.\$obj->".$prop['field'].".'';\n"; + } +} +$targetcontent=preg_replace('/'.preg_quote("print ''.\$obj->field1.'';",'/').'/', $varprop, $targetcontent); +$targetcontent=preg_replace('/'.preg_quote("print ''.\$obj->field2.'';",'/').'/', '', $targetcontent); + + // Build file $fp=fopen($outfile,"w"); diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 7eebdee8bcd..518b4f4d018 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -193,7 +193,7 @@ class modMyModule extends DolibarrModules // Add here entries to declare new menus // // Example to declare a new Top Menu entry and its Left menu entry: - // $this->menu[$r]=array( 'fk_menu'=>0, // Put 0 if this is a top menu + // $this->menu[$r]=array( 'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode // 'type'=>'top', // This is a Top menu entry // 'titre'=>'MyModule top menu', // 'mainmenu'=>'mymodule', @@ -208,7 +208,7 @@ class modMyModule extends DolibarrModules // $r++; // // Example to declare a Left Menu entry into an existing Top menu entry: - // $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=xxx', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + // $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=xxx', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode // 'type'=>'left', // This is a Left menu entry // 'titre'=>'MyModule left menu', // 'mainmenu'=>'xxx', @@ -228,11 +228,14 @@ class modMyModule extends DolibarrModules // Example: // $this->export_code[$r]=$this->rights_class.'_'.$r; - // $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) + // $this->export_label[$r]='MyModule'; // Translation key (used only if key ExportDataset_xxx_z not found) // $this->export_enabled[$r]='1'; // Condition to show export in list (ie: '$user->id==3'). Set to 1 to always show when module is enabled. - // $this->export_permission[$r]=array(array("facture","facture","export")); + // $this->export_icon[$r]='generic:MyModule'; + // $this->export_permission[$r]=array(array("mymodule","level1","level2")); // $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalTVA",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef'); + // $this->export_TypeFields_array[$r]=array('t.date'=>'Date', 't.qte'=>'Numeric', 't.poids'=>'Numeric', 't.fad'=>'Numeric', 't.paq'=>'Numeric', 't.stockage'=>'Numeric', 't.fadparliv'=>'Numeric', 't.livau100'=>'Numeric', 't.forfait'=>'Numeric', 's.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.subprice'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.special_code'=>'Numeric','fd.product_type'=>"Numeric",'fd.fk_product'=>'List:product:label','p.ref'=>'Text','p.label'=>'Text','p.accountancy_code_sell'=>'Text'); // $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.fk_product'=>'product','p.ref'=>'product'); + // $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them // $this->export_sql_start[$r]='SELECT DISTINCT '; // $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)'; // $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; diff --git a/dev/skeletons/skeleton_class.class.php b/dev/skeletons/skeleton_class.class.php index 72ee07c259d..1903d6f4572 100644 --- a/dev/skeletons/skeleton_class.class.php +++ b/dev/skeletons/skeleton_class.class.php @@ -35,24 +35,10 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; * Class Skeleton_Class * * Put here description of your class + * @see CommonObject */ class Skeleton_Class extends CommonObject { - /** - * @var DoliDb Database handler - */ - protected $db; - - /** - * @var string Error code (or message) - * @deprecated - * @see Skeleton_Class::errors - */ - public $error; - /** - * @var string[] Error codes (or messages) - */ - public $errors = array(); /** * @var string Id to identify managed objects */ @@ -67,10 +53,6 @@ class Skeleton_Class extends CommonObject */ public $lines = array(); - /** - * @var int ID - */ - public $id; /** * @var mixed Sample property 1 */ @@ -222,10 +204,11 @@ class Skeleton_Class extends CommonObject * @param int $limit offset limit * @param int $offset offset limit * @param array $filter filter array + * @param string $filtermode filter mode (AND or OR) * * @return int <0 if KO, >0 if OK */ - public function fetchAll($sortorder, $sortfield, $limit, $offset, array $filter = array()) + public function fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter = array(), $filtermode='AND') { dol_syslog(__METHOD__, LOG_DEBUG); @@ -234,20 +217,25 @@ class Skeleton_Class extends CommonObject $sql .= ' t.field1,'; $sql .= ' t.field2'; //... - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'mytable as t'; + $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element. ' as t'; // Manage filter $sqlwhere = array(); if (count($filter) > 0) { foreach ($filter as $key => $value) { - $sqlwhere [] = ' AND ' . $key . ' LIKE \'%' . $this->db->escape($value) . '%\''; + $sqlwhere [] = $key . ' LIKE \'%' . $this->db->escape($value) . '%\''; } } if (count($sqlwhere) > 0) { - $sql .= ' WHERE ' . implode(' AND ', $sqlwhere); + $sql .= ' WHERE ' . implode(' '.$filtermode.' ', $sqlwhere); + } + + if (!empty($sortfield)) { + $sql .= ' ORDER BY ' . $sortfield . ' ' . $sortorder; + } + if (!empty($limit)) { + $sql .= ' ' . $this->db->plimit($limit + 1, $offset); } - $sql .= ' ORDER BY ' . $sortfield . ' ' . $sortorder . ' ' . $this->db->plimit($limit + 1, $offset); - $this->lines = array(); $resql = $this->db->query($sql); diff --git a/dev/skeletons/skeleton_page.php b/dev/skeletons/skeleton_page.php index 7665ce9986a..0eb3b01589c 100644 --- a/dev/skeletons/skeleton_page.php +++ b/dev/skeletons/skeleton_page.php @@ -43,8 +43,8 @@ if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@includ if (! $res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only if (! $res) die("Include of main fails"); // Change this following line to use the correct relative path from htdocs -include_once(DOL_DOCUMENT_ROOT.'/core/class/formcompany.class.php'); -dol_include_once('/module/class/skeleton_class.class.php'); +include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); +dol_include_once('/mymodule/class/skeleton_class.class.php'); // Load traductions files requiredby by page $langs->load("companies"); @@ -56,13 +56,16 @@ $action = GETPOST('action','alpha'); $backtopage = GETPOST('backtopage'); $myparam = GETPOST('myparam','alpha'); +$search_field1=GETPOST("search_field1"); +$search_field2=GETPOST("search_field2"); + // Protection if external user if ($user->societe_id > 0) { //accessforbidden(); } -if (empty($action) && empty($id) && empty($ref)) $action='create'; +if (empty($action) && empty($id) && empty($ref)) $action='list'; // Load object if id or ref is provided as parameter $object=new Skeleton_Class($db); @@ -95,7 +98,7 @@ if (empty($reshook)) { if (GETPOST('cancel')) { - $urltogo=$backtopage?$backtopage:dol_buildpath('/buildingmanagement/list.php',1); + $urltogo=$backtopage?$backtopage:dol_buildpath('/mymodule/list.php',1); header("Location: ".$urltogo); exit; } @@ -149,7 +152,7 @@ if (empty($reshook)) if (empty($object->ref)) { $error++; - setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),null,'errors'); + setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),null,'errors'); } if (! $error) @@ -180,7 +183,7 @@ if (empty($reshook)) if ($result > 0) { // Delete OK - setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); + setEventMessages("RecordDeleted", null, 'mesgs'); header("Location: ".dol_buildpath('/buildingmanagement/list.php',1)); exit; } @@ -225,9 +228,12 @@ jQuery(document).ready(function() { // Part to show a list -if ($action == 'list' || empty($id)) +if ($action == 'list' || (empty($id) && $action != 'create')) { - $sql = "SELECT"; + // Put here content of your page + print load_fiche_titre('PageTitle'); + + $sql = "SELECT"; $sql.= " t.rowid,"; $sql.= " t.field1,"; $sql.= " t.field2"; @@ -238,55 +244,73 @@ if ($action == 'list' || empty($id)) $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql.= " FROM ".MAIN_DB_PREFIX."mytable as t"; - $sql.= " WHERE field3 = 'xxx'"; + $sql.= " WHERE 1 = 1"; + if ($search_field1) $sql.= natural_search("field1",$search_field1); + if ($search_field2) $sql.= natural_search("field2",$search_field2); + // Add where from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; - $sql.= " ORDER BY field1 ASC"; - - print '
'; - - if (! empty($moreforfilter)) - { - print '
'; - print $moreforfilter; - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print '
'; - } - - print ''."\n"; - - // Fields title - print ''; - print_liste_field_titre($langs->trans('field1'),$_SERVER['PHP_SELF'],'t.field1','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('field2'),$_SERVER['PHP_SELF'],'t.field2','',$param,'',$sortfield,$sortorder); - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print ''."\n"; - - // Fields title search - print ''; - print ''; - print ''; - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print ''."\n"; + // Count total nb of records + $nbtotalofrecords = 0; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + { + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); + } + + $sql.= $db->order($sortfield, $sortorder); + $sql.= $db->plimit($conf->liste_limit+1, $offset); + dol_syslog($script_file, LOG_DEBUG); $resql=$db->query($sql); if ($resql) { $num = $db->num_rows($resql); + + $params=''; + $params.= '&search_field1='.urlencode($search_field1); + $params.= '&search_field2='.urlencode($search_field2); + + print_barre_liste($title, $page, $_SERVER["PHP_SELF"],$params,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_companies'); + + + print ''; + + if (! empty($moreforfilter)) + { + print '
'; + print $moreforfilter; + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
'; + } + + print '
'; - print ''; - print ''; - print ''; - print '
'."\n"; + + // Fields title + print ''; + print_liste_field_titre($langs->trans('field1'),$_SERVER['PHP_SELF'],'t.field1','',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('field2'),$_SERVER['PHP_SELF'],'t.field2','',$param,'',$sortfield,$sortorder); + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print ''."\n"; + + // Fields title search + print ''; + print ''; + print ''; + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print ''."\n"; + + $i = 0; while ($i < $num) { @@ -295,11 +319,8 @@ if ($action == 'list' || empty($id)) { // You can use here results print ''; - print ''; + print ''; + print ''; $parameters=array('obj' => $obj); $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -307,21 +328,22 @@ if ($action == 'list' || empty($id)) } $i++; } + + $db->free($resql); + + $parameters=array('sql' => $sql); + $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + + print "
'; - print $obj->field1; - print ''; - print $obj->field2; - print ''.$obj->field1.''.$obj->field2.'
\n"; + print "
\n"; + } else { $error++; dol_print_error($db); } - - $db->free($resql); - - $parameters=array('sql' => $sql); - $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print "\n"; - print "\n"; } @@ -329,7 +351,7 @@ if ($action == 'list' || empty($id)) // Part to create if ($action == 'create') { - print_fiche_titre($langs->trans("NewResidence")); + print load_fiche_titre($langs->trans("NewSkeleton")); print '
'; print ''; diff --git a/dev/test/testtcpdf.php b/dev/test/testtcpdf.php index 4b8b6f36d53..6b600c630d3 100755 --- a/dev/test/testtcpdf.php +++ b/dev/test/testtcpdf.php @@ -27,8 +27,8 @@ * @since 2008-03-04 */ -require_once('../../htdocs/includes/tcpdf/config/lang/eng.php'); -require_once('../../htdocs/includes/tcpdf/tcpdf.php'); +require_once('../../htdocs/includes/tecnick.com/tcpdf/config/tcpdf_config.php'); +require_once('../../htdocs/includes/tecnick.com/tcpdf/tcpdf.php'); // create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); diff --git a/dev/test/testutf.php b/dev/test/testutf.php index 5812b0c8639..f60f9d195a3 100644 --- a/dev/test/testutf.php +++ b/dev/test/testutf.php @@ -47,8 +47,8 @@ print 'Files has been created. Check its name from your explorer'."\n"; * @since 2008-09-15 */ -require_once('../../htdocs/includes/tcpdf/config/lang/eng.php'); -require_once('../../htdocs/includes/tcpdf/tcpdf.php'); +require_once('../../htdocs/includes/tecnick.com/tcpdf/config/tcpdf_config.php'); +require_once('../../htdocs/includes/tecnick.com/tcpdf/tcpdf.php'); // create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); diff --git a/htdocs/.gitignore b/htdocs/.gitignore index bd9c176df9b..b0b84be129e 100644 --- a/htdocs/.gitignore +++ b/htdocs/.gitignore @@ -1,13 +1,17 @@ -/test.php -/extensions* -/nltechno* +/allscreens* /ancot* -/teclib* /bootstrap* +/dolimed* +/ecommerce* +/extensions* /google* +/lead /multicompany* +/ndf* /numberingpack* +/nltechno* /ovh* /pos +/teclib* +/test.php /ultimatepdf* -/lead diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index accbd6111c7..a56701dada2 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -106,7 +106,7 @@ llxHeader('', $langs->trans("ListAccounts")); $pcgver = $conf->global->CHARTOFACCOUNTS; $sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.pcg_subtype, aa.account_number, aa.account_parent , aa.label, aa.active "; -$sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa, " . MAIN_DB_PREFIX . "accounting_system as asy"; +$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa, " . MAIN_DB_PREFIX . "accounting_system as asy"; $sql .= " WHERE aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = " . $pcgver; @@ -145,6 +145,7 @@ if ($result) { print '' . $langs->trans("Addanaccount") . ''; print '' . $langs->trans("ImportAccount") . ''; + print '' . $langs->trans("CheckProductAccountancyCode") . ''; print '

'; print ''; @@ -172,11 +173,12 @@ if ($result) { print ''; print ''; - $var = true; + $var = false; $accountstatic=new AccountingAccount($db); - while ( $i < min($num, $limit) ) { + while ( $i < min($num, $limit) ) + { $obj = $db->fetch_object($resql); $accountstatic->id=$obj->rowid; diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 51c6a5c6715..925bf818137 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -139,7 +139,7 @@ $htmlacc = new FormVentilation($db); if ($action == 'create') { - print_fiche_titre($langs->trans('NewAccount')); + print load_fiche_titre($langs->trans('NewAccount')); print '' . "\n"; print ''; diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 3da29bd9cc1..9bde2d23c14 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -4,7 +4,7 @@ * Copyright (C) 2014 Florian Henry * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -43,8 +43,12 @@ if (!$user->admin) $action = GETPOST('action', 'alpha'); -// Other parameters ACCOUNTING_EXPORT_* -$list = array ( +// Parameters ACCOUNTING_EXPORT_* +$main_option = array ( + 'ACCOUNTING_EXPORT_PREFIX_SPEC' +); + +$model_option = array ( 'ACCOUNTING_EXPORT_SEPARATORCSV', 'ACCOUNTING_EXPORT_DATE', 'ACCOUNTING_EXPORT_PIECE', @@ -60,10 +64,18 @@ $list = array ( if ($action == 'update') { $error = 0; + $format = GETPOST('format', 'alpha'); $modelcsv = GETPOST('modelcsv', 'int'); + + if (! empty($format)) { + if (! dolibarr_set_const($db, 'ACCOUNTING_EXPORT_FORMAT', $format, 'chaine', 0, '', $conf->entity)) { + $error ++; + } + } else { + $error ++; + } if (! empty($modelcsv)) { - if (! dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) { $error ++; } @@ -71,7 +83,15 @@ if ($action == 'update') { $error ++; } - foreach ( $list as $constname ) { + foreach ($main_option as $constname) { + $constvalue = GETPOST($constname, 'alpha'); + + if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { + $error ++; + } + } + + foreach ($model_option as $constname) { $constvalue = GETPOST($constname, 'alpha'); if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { @@ -95,19 +115,78 @@ llxHeader(); $form = new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'title_setup'); +print load_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'title_setup'); $head = admin_accounting_prepare_head(); -dol_fiche_head($head, 'export', $langs->trans("Configuration"), 0, 'cron'); print ''; print ''; print ''; -print '
'; +dol_fiche_head($head, 'export', $langs->trans("Configuration"), 0, 'cron'); + $var = true; +/* + * Main Options + */ +print '
'; +print ''; +print ''; +print "\n"; + +$var = ! $var; + +print ''; +print ''; +if (! $conf->use_javascript_ajax) +{ + print '"; +} +else +{ + print ''; +} +print ""; + +$num = count($main_option); +if ($num) +{ + foreach ($main_option as $key) { + $var = ! $var; + + print ''; + + // Param + $label = $langs->trans($key); + print ''; + + // Value + print ''; + } +} + +print "
' . $langs->trans('MainOptions') . '
' . $langs->trans("Selectformat") . ''; + print $langs->trans("NotAvailableWhenAjaxDisabled"); + print "'; + $listformat=array( + 'csv'=>$langs->trans("csv"), + 'txt'=>$langs->trans("txt") + ); + print $form->selectarray("format",$listformat,$conf->global->ACCOUNTING_EXPORT_FORMAT,0); + + print '
' . $label . ''; + print ''; + print '
\n"; + +print "
\n"; + +/* + * Export model + */ +print ''; + print ''; print ''; print ''; @@ -142,8 +221,8 @@ print "
\n"; * Parameters */ -$num = count($list); -if ($num) +$num2 = count($model_option); +if ($num2) { print '
' . $langs->trans("Modelcsv") . '
'; print ''; @@ -151,7 +230,7 @@ if ($num) print "\n"; if ($conf->global->ACCOUNTING_EXPORT_MODELCSV > 1) print ''; - foreach ( $list as $key ) { + foreach ($model_option as $key) { $var = ! $var; print ''; @@ -169,7 +248,9 @@ if ($num) print "
' . $langs->trans('OptionsDeactivatedForThisExportModel') . '
\n"; } -print '
'; +dol_fiche_end(); + +print '
'; print '
'; diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index bd530eaa8d7..31ec91958c9 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -63,7 +63,7 @@ $title = $langs->trans('FiscalYears'); llxHeader('',$title,LOG_ERR); -print_fiche_titre($langs->trans('FiscalYears')); +print load_fiche_titre($langs->trans('FiscalYears')); $sql = "SELECT f.rowid, f.label, f.date_start, f.date_end, f.statut, f.entity"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear as f"; diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index a1692878c55..0e39776946a 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -170,7 +170,7 @@ $form = new Form($db); */ if ($action == 'create') { - print_fiche_titre($langs->trans("NewFiscalYear")); + print load_fiche_titre($langs->trans("NewFiscalYear")); print '
'; print ''; diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php index e81557d0522..61e86b7df19 100644 --- a/htdocs/accountancy/admin/importaccounts.php +++ b/htdocs/accountancy/admin/importaccounts.php @@ -124,7 +124,7 @@ if ($result) { print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index fc8994c4836..af0bccdf00c 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -153,16 +153,17 @@ llxHeader(); $form = new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'title_setup'); +print load_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'title_setup'); $head = admin_accounting_prepare_head($accounting); -dol_fiche_head($head, 'general', $langs->trans("Configuration"), 0, 'cron'); print ''; print ''; print ''; +dol_fiche_head($head, 'general', $langs->trans("Configuration"), 0, 'cron'); + print '
' . $langs->trans("accountingaccount") . '
' . $langs->trans("AccountAccouting") . '' . $langs->trans("label") . '' . $langs->trans("Accountparent") . '' . $langs->trans("Pcgtype") . '
'; // Cas du parametre ACCOUNTING_MODE @@ -291,7 +292,11 @@ print ''; print "
\n"; -print '

'; +dol_fiche_end(); + +print '
'; + print '
'; + llxFooter(); $db->close(); diff --git a/htdocs/accountancy/admin/journaux.php b/htdocs/accountancy/admin/journal.php similarity index 93% rename from htdocs/accountancy/admin/journaux.php rename to htdocs/accountancy/admin/journal.php index e2359ebd8ee..b55728ee080 100644 --- a/htdocs/accountancy/admin/journaux.php +++ b/htdocs/accountancy/admin/journal.php @@ -22,7 +22,7 @@ */ /** - * \file htdocs/accountancy/admin/journaux.php + * \file htdocs/accountancy/admin/journal.php * \ingroup Accounting Expert * \brief Setup page to configure accounting expert module */ @@ -83,16 +83,16 @@ llxHeader(); $form = new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'title_setup'); +print load_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'title_setup'); $head = admin_accounting_prepare_head(null); -dol_fiche_head($head, 'journal', $langs->trans("Configuration"), 0, 'cron'); - print '
'; print ''; print ''; +dol_fiche_head($head, 'journal', $langs->trans("Configuration"), 0, 'cron'); + print ''; print ''; print ''; @@ -115,10 +115,9 @@ foreach ( $list as $key ) { print "
' . $langs->trans('Journaux') . '
\n"; -print '
'; -print '
'; -print '
'; +print '
'; + print ''; print ''; @@ -164,9 +163,12 @@ $db->free($resql); print "
\n"; -print ''; +dol_fiche_end(); + +print '
'; + +print ''; -print '
'; llxFooter(); $db->close(); \ No newline at end of file diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 43b8150d2f6..d79d14e74d1 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -1,10 +1,9 @@ +/* Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2013-2014 Alexandre Spangaro - * Copyright (C) 2014 Florian Henry - * Copyright (C) 2015 Ari Elbaz (elarifr) - + * Copyright (C) 2014 Florian Henry + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2015 Ari Elbaz (elarifr) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,19 +20,19 @@ */ /** - * \file htdocs/accountancy/admin/productaccount.php - * \ingroup Accounting Expert - * \brief Onglet de gestion de parametrages des ventilations + * \file htdocs/accountancy/admin/productaccount.php + * \ingroup Accounting Expert + * \brief Onglet de gestion de parametrages des ventilations */ - require '../../main.inc.php'; // Class -require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php'; -require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; -require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php'; +require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; +require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; // Langs $langs->load("companies"); @@ -41,383 +40,356 @@ $langs->load("compta"); $langs->load("main"); $langs->load("accountancy"); -// Search & action GETPOST +// search & action GETPOST $action = GETPOST('action'); $codeventil_buy = GETPOST('codeventil_buy', 'array'); $codeventil_sell = GETPOST('codeventil_sell', 'array'); -$mesCasesCochees = GETPOST('mesCasesCochees', 'array'); -$account_number_buy = GETPOST('account_number_buy'); +$chk_prod = GETPOST('chk_prod', 'array'); +$account_number_buy = GETPOST('account_number_buy'); $account_number_sell = GETPOST('account_number_sell'); -$changeaccount = GETPOST('changeaccount','array'); -$changeaccount_buy = GETPOST('changeaccount_buy','array'); -$changeaccount_sell = GETPOST('changeaccount_sell','array'); -$search_ref = GETPOST('search_ref','alpha'); -$search_label = GETPOST('search_label','alpha'); -$search_desc = GETPOST('search_desc','alpha'); +$changeaccount = GETPOST('changeaccount', 'array'); +$changeaccount_buy = GETPOST('changeaccount_buy', 'array'); +$changeaccount_sell = GETPOST('changeaccount_sell', 'array'); +$search_ref = GETPOST('search_ref', 'alpha'); +$search_label = GETPOST('search_label', 'alpha'); +$search_desc = GETPOST('search_desc', 'alpha'); +$accounting_product_mode = GETPOST('accounting_product_mode', 'alpha'); +$btn_changeaccount = GETPOST('changeaccount'); +$btn_changetype = GETPOST('changetype'); -$sortfield = GETPOST('sortfield','alpha'); -$sortorder = GETPOST('sortorder','alpha'); -$page = GETPOST('page','int'); -if ($page < 0) $page = 0; +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); +$page = GETPOST('page', 'int'); +if ($page < 0) + $page = 0; $pageprev = $page - 1; $pagenext = $page + 1; -//bug in page limit if ACCOUNTING_LIMIT_LIST_VENTILATION < $conf->liste_limit there is no pagination displayed ! +// bug in page limit if ACCOUNTING_LIMIT_LIST_VENTILATION < $conf->liste_limit there is no pagination displayed ! if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) && $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION >= $conf->liste_limit) { - $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; -//} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { -// $limit = $conf->liste_limit; + $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; + // } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { + // $limit = $conf->liste_limit; } else { - $limit = $conf->liste_limit; + $limit = $conf->liste_limit; } $offset = $limit * $page; -if (! $sortfield) $sortfield="p.ref"; -if (! $sortorder) $sortorder="ASC"; +if (! $sortfield) + $sortfield = "p.ref"; +if (! $sortorder) + $sortorder = "ASC"; + + // sales or purchase +if ($action == 'update') { + if (! empty($btn_changetype)) { + $error = 0; + + $accounting_product_modes = array ( + 'ACCOUNTANCY_SELL', + 'ACCOUNTANCY_BUY' + ); + + $accounting_product_mode = GETPOST('accounting_product_mode', 'alpha'); + + if (in_array($accounting_product_mode, $accounting_product_modes)) { + + if (! dolibarr_set_const($db, 'ACCOUNTING_PRODUCT_MODE', $accounting_product_mode, 'chaine', 0, '', $conf->entity)) { + $error ++; + } + } else { + $error ++; + } + } + + if (! empty($btn_changeaccount)) { + $msg = '
' . $langs->trans("Processing") . '...
'; + if (! empty($chk_prod)) { + + $accounting = new AccountingAccount($db); + + $msg .= '
' . count($chk_prod) . ' ' . $langs->trans("SelectedLines") . '
'; + + $cpt = 0; + foreach ( $chk_prod as $productid ) { + + $accounting_account_id=GETPOST('codeventil_'.$productid); + + $result=$accounting->fetch($accounting_account_id,null,1); + if ($result<0) { + //setEventMessage(null, $accounting->errors,'errors'); + $msg .= '
' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : id=' . $accounting_account_id . '
' . $sql . '
'; + } else { + + $sql = " UPDATE " . MAIN_DB_PREFIX . "product"; + if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { + $sql .= " SET accountancy_code_buy = " . $accounting->account_number; + } + if ($accounting_product_mode == 'ACCOUNTANCY_SELL') { + $sql .= " SET accountancy_code_sell = " . $accounting->account_number; + } + $sql .= " WHERE rowid = " . $productid; + + dol_syslog("/accountancy/admin/productaccount.php sql=" . $sql, LOG_DEBUG); + if ($db->query($sql)) { + $msg .= '
' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '
'; + } else { + $msg .= '
' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $accounting->account_number . '
' . $sql . '
'; + } + } + + $cpt ++; + } + } else { + $msg .= '
' . $langs->trans("AnyLineVentilate") . '
'; + } + $msg .= '
' . $langs->trans("EndProcessing") . '
'; + + } +} // Security check if ($user->societe_id > 0) - accessforbidden(); -// TODO after adding menu -// if (! $user->rights->accounting->ventilation->dispatch) -// accessforbidden(); + accessforbidden(); + // TODO after adding menu + // if (! $user->rights->accounting->ventilation->dispatch) + // accessforbidden(); $form = new FormVentilation($db); -//Defaut AccountingAccount RowId Product / Service -//at this time ACCOUNTING_SERVICE_SOLD_ACCOUNT & ACCOUNTING_PRODUCT_SOLD_ACCOUNT are account number not accountingacount rowid -//so we need to get those default value rowid first +// Defaut AccountingAccount RowId Product / Service +// at this time ACCOUNTING_SERVICE_SOLD_ACCOUNT & ACCOUNTING_PRODUCT_SOLD_ACCOUNT are account number not accountingacount rowid +// so we need to get those default value rowid first $accounting = new AccountingAccount($db); -//TODO: we should need to check if result is a really exist accountaccount rowid..... -$aarowid_servbuy = $accounting->fetch('', ACCOUNTING_SERVICE_BUY_ACCOUNT); -$aarowid_prodbuy = $accounting->fetch('', ACCOUNTING_PRODUCT_BUY_ACCOUNT); -$aarowid_servsell = $accounting->fetch('', ACCOUNTING_SERVICE_SOLD_ACCOUNT); -$aarowid_prodsell = $accounting->fetch('', ACCOUNTING_PRODUCT_SOLD_ACCOUNT); +// TODO: we should need to check if result is a really exist accountaccount rowid..... +$aarowid_servbuy = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT, 1); +$aarowid_prodbuy = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT, 1); +$aarowid_servsell = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1); +$aarowid_prodsell = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT, 1); -$aacompta_servbuy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef")); -$aacompta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef")); +$aacompta_servbuy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef")); +$aacompta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef")); $aacompta_servsell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); $aacompta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); // Purge search criteria if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { - $search_ref=''; - $search_label=''; - $search_desc=''; + $search_ref = ''; + $search_label = ''; + $search_desc = ''; } -//TODO: modify to update all selected product with a sell account -if (is_array($changeaccount) && count($changeaccount) > 0 && $action == $langs->trans("Accountancy_code_sell")) { - $error = 0; - - $db->begin(); - - $sql1 = "UPDATE " . MAIN_DB_PREFIX . "product as p"; - $sql1 .= " SET p.accountancy_code_sell=" . $account_number_sell; - $sql1 .= ' WHERE p.rowid IN (' . implode(',', $changeaccount) . ')'; - - // Debug - // print_r ($sql1); - - dol_syslog('accountancy/customer/lines.php::changeaccount product sell sql= ' . $sql1); - - $resql1 = $db->query($sql1); - if (! $resql1) { - $error ++; - setEventMessage($db->lasterror(), 'errors'); - } - if (! $error) { - $db->commit(); - setEventMessage($langs->trans('Save'), 'mesgs'); - } else { - $db->rollback(); - setEventMessage($db->lasterror(), 'errors'); - } -} - -//TODO: modify to update all selected product with a buy account -if (is_array($changeaccount) && count($changeaccount) > 0 && $action == $langs->trans("Accountancy_code_buy")) { - $error = 0; - - $db->begin(); - - $sql1 = "UPDATE " . MAIN_DB_PREFIX . "product as p"; - $sql1 .= " SET p.accountancy_code_buy=" . $account_number_buy; - $sql1 .= ' WHERE p.rowid IN (' . implode(',', $changeaccount) . ')'; - - // Debug - // print_r ($sql1); - - dol_syslog('accountancy/customer/lines.php::changeaccount product buy sql= ' . $sql1); - - $resql1 = $db->query($sql1); - if (! $resql1) { - $error ++; - setEventMessage($db->lasterror(), 'errors'); - } - if (! $error) { - $db->commit(); - setEventMessage($langs->trans('Save'), 'mesgs'); - } else { - $db->rollback(); - setEventMessage($db->lasterror(), 'errors'); - } -} +// debug move header to top +llxHeader('', $langs->trans("Accounts")); /* * View */ -llxHeader('', $langs->trans("Accounts")); -// For updating account export print ''; + $(function () { + $(\'#select-all\').click(function(event) { + // Iterate each checkbox + $(\':checkbox\').each(function() { + this.checked = true; + }); + }); + $(\'#unselect-all\').click(function(event) { + // Iterate each checkbox + $(\':checkbox\').each(function() { + this.checked = false; + }); + }); + }); + '; -//TODO For select box -print ''; - -/* - * Action - */ -//TODO -/* -if ($action == 'ventil') { - print '
' . $langs->trans("Processing") . '...
'; - if (! empty($codeventil_buy) && ! empty($mesCasesCochees)) { - if (! empty($codeventil_sell) && ! empty($mesCasesCochees)) { - - } else { - print '
' . $langs->trans("AnyLineVentilate") . '
'; - } - print '
' . $langs->trans("EndProcessing") . '
'; -} -*/ -//do we really need to exclude old product not tosell / tobuy ? -//$sql = "SELECT p.rowid, p.ref , p.label, p.description , p.accountancy_code_sell, p.accountancy_code_buy, p.tms, p.fk_product_type as product_type , p.tosell , p.tobuy "; -//$sql .= " WHERE p.accountancy_code_sell IS NULL AND p.tosell = 1 OR p.accountancy_code_buy IS NULL AND p.tobuy = 1"; -//$sql .= " WHERE p.accountancy_code_sell ='' AND p.tosell = 1 OR p.accountancy_code_buy ='' AND p.tobuy = 1"; -$sql = "SELECT p.rowid, p.ref , p.label, p.description , p.accountancy_code_sell, p.accountancy_code_buy, p.tms, p.fk_product_type as product_type"; +$sql = "SELECT p.rowid, p.ref , p.label, p.description , p.accountancy_code_sell, p.accountancy_code_buy, p.tms, p.fk_product_type as product_type"; $sql .= " FROM " . MAIN_DB_PREFIX . "product as p"; -//$sql .= " , " . MAIN_DB_PREFIX . "accountingaccount as aa"; $sql .= " WHERE ("; -$sql .= " p.accountancy_code_sell ='' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='' OR p.accountancy_code_buy IS NULL"; -//Search on correct pcg version $pcgver = $conf->global->CHARTOFACCOUNTS; -$sql .= " OR (p.accountancy_code_sell IS NOT NULL AND p.accountancy_code_sell != '' AND p.accountancy_code_sell NOT IN - (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))"; - //(SELECT account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa WHERE fk_pcg_version='PCG99-BASE'))"; -$sql .= " OR (p.accountancy_code_buy IS NOT NULL AND p.accountancy_code_buy != '' AND p.accountancy_code_buy NOT IN - (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))"; - //(SELECT account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa WHERE fk_pcg_version='PCG99-BASE'))"; + +IF ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') { + $sql .= " p.accountancy_code_buy ='' OR p.accountancy_code_buy IS NULL"; + $sql .= " OR (p.accountancy_code_buy IS NOT NULL AND p.accountancy_code_buy != '' AND p.accountancy_code_buy NOT IN + (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))"; +} else { + $sql .= " p.accountancy_code_sell ='' OR p.accountancy_code_sell IS NULL "; + $sql .= " OR (p.accountancy_code_sell IS NOT NULL AND p.accountancy_code_sell != '' AND p.accountancy_code_sell NOT IN + (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))"; +} + $sql .= ")"; -//Add search filter like + +// Add search filter like if (strlen(trim($search_ref))) { - $sql .= " AND (p.ref like '" . $search_ref . "%')"; + $sql .= " AND (p.ref like '" . $search_ref . "%')"; } if (strlen(trim($search_label))) { - $sql .= " AND (p.label like '" . $search_label . "%')"; + $sql .= " AND (p.label like '" . $search_label . "%')"; } if (strlen(trim($search_desc))) { - $sql .= " AND (p.description like '%" . $search_desc . "%')"; + $sql .= " AND (p.description like '%" . $search_desc . "%')"; } -$sql.= $db->order($sortfield,$sortorder); +$sql .= $db->order($sortfield, $sortorder); $sql .= $db->plimit($limit + 1, $offset); dol_syslog("/accountancy/admin/productaccount.php:: sql=" . $sql, LOG_DEBUG); $result = $db->query($sql); if ($result) { - $num_lines = $db->num_rows($result); - $i = 0; - -/* - - + $num_lines = $db->num_rows($result); + $i = 0; + + /* * View */ - print_barre_liste($langs->trans("ProductAccountingAccountSelect"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines); - - print '' . $langs->trans("DescProductAccountingAccount") . ' '; - print_liste_field_titre($langs->trans("RowId"), $_SERVER["PHP_SELF"],"p.rowid","",$param,'',$sortfield,$sortorder); - print '  '; - - -//DEBUG -//print $sql; - - print '

'; -// print ''; - - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - print '
'; - print '
' . $langs->trans("ChangeAccount") . '
'; - print $langs->trans("Accountancy_code_buy") . ': ' . $form->select_account($account_number_buy, 'account_number_buy', 1,'', 0, 1); - print '
'; - print '
'; - print '
' . $langs->trans("ChangeAccount") . '
'; - print $langs->trans("Accountancy_code_sell") . ': ' . $form->select_account($account_number_sell, 'account_number_sell', 1, '', 0, 1); - print '
'; - print '
'; - //TODO change button - print ''; - print '
'; - - print ''; - print ''; -// print ''; -// print ''; -// print ''; - print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"],"p.label","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"],"l.description","",$param,'',$sortfield,$sortorder); - print ''; - print ''; - print ''; - print ''; - print_liste_field_titre(''); -// print_liste_field_titre(''); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - print ''; - print ''; -// print ''; - print ''; - - $var = true; - - - while ( $i < min($num_lines, 250) ) { - $obj = $db->fetch_object($result); - $var = ! $var; - - - $compta_prodsell = $obj->accountancy_code_sell; - if (empty($compta_prodsell)) { - if ($obj->product_type == 0) { - $compta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); - $compta_prodsell_id = $aarowid_prodsell; - } else { - $compta_prodsell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); - $compta_prodsell_id = $aarowid_servsell; - } - } - - - $compta_prodbuy = $obj->accountancy_code_buy; - if (empty($compta_prodbuy)) { - if ($obj->product_type == 0) { - $compta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef")); - $compta_prodbuy_id = $aarowid_prodbuy; - } else { - $compta_prodbuy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef")); - $compta_prodbuy_id = $aarowid_servbuy; - } - } - - - $product_static = new Product($db); - - print ""; -//debug -print ''; - - print ""; - print ""; - // Ref produit as link - $product_static->ref = $obj->ref; - $product_static->id = $obj->rowid; - $product_static->type = $obj->type; - print ''; - - print ''; -//TODO ADJUST DESCRIPTION SIZE -// print ''; - //TODO: we shoul set a user defined value to adjust user square / wide screen size - $trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32; - print ''; - - //acountingaccount buy - print ''; -//TODO: replace by select -// print ''; - //TODO: we shoul set a user defined value to adjust user square / wide screen size - //$trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50; - print ''; - - //acountingaccount sel - print ''; - -//TODO: replace by select - //TODO: we shoul set a user defined value to adjust user square / wide screen size - //$trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50; - print ''; - //action edit & select box - print ''; - print ''; - //Checkbox select - print ''; - - print ""; - $i ++; - } - - $db->free($result); + print_barre_liste($langs->trans("ProductAccountingAccountSelect"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines); + + print ''; + print ''; + print ''; + + print '
' . $langs->trans("Ref") . '' . $langs->trans("Label") . '' . $langs->trans("Description") . '' . $langs->trans("Accountancy_code_buy") . '' . $langs->trans("Accountancy_code_buy_suggest") . '' . $langs->trans("Accountancy_code_sell") . '' . $langs->trans("Accountancy_code_sell_suggest") . '' . $langs->trans("Ventilate") . '
/'.'
%% '; - print ''; -// print ''; - print ' '; - print ''; -// print ''; - print ' 
Compte Suggeres compta_prodbuy=' . $compta_prodbuy . ' -- compta_prodbuy_id' . $compta_prodbuy_id . '-- compta_prodsell:' . $compta_prodsell . '-- compta_prodsell_id' . $compta_prodsell_id . '
'; - if ($product_static->id) - print $product_static->getNomUrl(1); - else - print '- '; - print '' . $obj->label . '' . $obj->description . '' . nl2br(dol_trunc($obj->description, $trunclengh)) . '' . $obj->accountancy_code_buy . '' . $compta_prodbuy . ''; - print $form->select_account($compta_prodbuy_id, 'codeventil[]', 1); - print '' . $obj->accountancy_code_sell . ''; - print $form->select_account($compta_prodsell_id, 'codeventil[]', 1); - print '' . $obj->rowid . ''; - print img_edit(); - print ''; - print '
'; + print ''; + print ''; + print "\n"; + print ''; + print '\n"; + print ''; + print '\n"; + + print "
' . $langs->trans('OptionMode') . '' . $langs->trans('Description') . '
' . $langs->trans('Accountancy_code_sell') . '' . nl2br($langs->trans('OptionModeProductSell')); + print "
' . $langs->trans('Accountancy_code_buy') . '' . nl2br($langs->trans('OptionModeProductBuy')) . "
\n"; + + print '
'; + + print "
\n"; + + if (! empty($msg)) { + print $msg; + } + + // print '' . $langs->trans("DescProductAccountingAccount") . ' '; + // print_liste_field_titre($langs->trans("RowId"), $_SERVER["PHP_SELF"], "p.rowid", "", $param, '', $sortfield, $sortorder); + print '  '; + + print ''; + print ''; + print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); + if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { + print ''; + + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + + $var = true; + + while ( $i < min($num_lines, 250) ) { + $obj = $db->fetch_object($result); + $var = ! $var; + + $compta_prodsell = $obj->accountancy_code_sell; + + if ($obj->product_type == 0) { + $compta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); + $compta_prodsell_id = $aarowid_prodsell; + } else { + $compta_prodsell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); + $compta_prodsell_id = $aarowid_servsell; + } + + $compta_prodbuy = $obj->accountancy_code_buy; + + if ($obj->product_type == 0) { + $compta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef")); + $compta_prodbuy_id = $aarowid_prodbuy; + } else { + $compta_prodbuy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef")); + $compta_prodbuy_id = $aarowid_servbuy; + } + + $product_static = new Product($db); + + print ""; + + print ""; + print ""; + // Ref produit as link + $product_static->ref = $obj->ref; + $product_static->id = $obj->rowid; + $product_static->type = $obj->type; + print ''; + print ''; + // TODO ADJUST DESCRIPTION SIZE + // print ''; + // TODO: we shoul set a user defined value to adjust user square / wide screen size + $trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32; + print ''; + + // acountingaccount buy + + if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { + print ''; + // TODO: replace by select + // print ''; + // TODO: we shoul set a user defined value to adjust user square / wide screen size + // $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50; + print ''; + } else { + + // acountingaccount sel + print ''; + // TODO: replace by select + // TODO: we shoul set a user defined value to adjust user square / wide screen size + // $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50; + print ''; + } + + // Checkbox select + print ''; + + print ""; + $i ++; + } + print '
' . $langs->trans("Accountancy_code_buy") . ''; + print '' . $langs->trans("Accountancy_code_buy_suggest") . ''; + } else { + print '' . $langs->trans("Accountancy_code_sell") . ''; + print '' . $langs->trans("Accountancy_code_sell_suggest") . ''; + } + // print_liste_field_titre(''); + print_liste_field_titre($langs->trans("Ventilate") . '
/ '); + print '
 '; + print ''; + print ' '; + print ''; + print '
'; + if ($product_static->id) + print $product_static->getNomUrl(1); + else + print '- '; + print '' . dol_trunc($obj->label, 24) . '' . $obj->description . '' . nl2br(dol_trunc($obj->description, $trunclengh)) . '' . $obj->accountancy_code_buy . '' . $compta_prodbuy . ''; + print $form->select_account($compta_prodbuy_id, 'codeventil_'.$product_static->id, 1); + print '' . $obj->accountancy_code_sell . ''; + print $form->select_account($compta_prodsell_id, 'codeventil_'.$product_static->id, 1); + print ''; + print '
'; + print '
'; + print '
'; + + $db->free($result); } else { -// print $db->error(); - dol_print_error($db); + dol_print_error($db); } -print ""; - llxFooter(); $db->close(); \ No newline at end of file diff --git a/htdocs/accountancy/bookkeeping/balancebymonth.php b/htdocs/accountancy/bookkeeping/balancebymonth.php index 54c239f2db9..c1902c16fee 100644 --- a/htdocs/accountancy/bookkeeping/balancebymonth.php +++ b/htdocs/accountancy/bookkeeping/balancebymonth.php @@ -56,7 +56,7 @@ llxHeader('', $langs->trans("Bookkeeping")); $textprevyear = '' . img_previous() . ''; $textnextyear = ' ' . img_next() . ''; -print_fiche_titre($langs->trans("AccountBalanceByMonth") . ' ' . $textprevyear . ' ' . $langs->trans("Year") . ' ' . $year_start . ' ' . $textnextyear); +print load_fiche_titre($langs->trans("AccountBalanceByMonth") . ' ' . $textprevyear . ' ' . $langs->trans("Year") . ' ' . $year_start . ' ' . $textnextyear); $sql = "SELECT count(*) FROM " . MAIN_DB_PREFIX . "facturedet as fd"; $sql .= " , " . MAIN_DB_PREFIX . "facture as f"; diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 515b9898c23..d1bf69a8eee 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -189,7 +189,7 @@ if ($action == 'delete') { } if ($action == 'create') { - print_fiche_titre($langs->trans("CreateMvts")); + print load_fiche_titre($langs->trans("CreateMvts")); $code_journal_array = array ( $conf->global->ACCOUNTING_SELL_JOURNAL => $conf->global->ACCOUNTING_SELL_JOURNAL, @@ -250,7 +250,7 @@ if ($action == 'create') { } if (! empty($book->piece_num)) { - print_fiche_titre($langs->trans("UpdateMvts")); + print load_fiche_titre($langs->trans("UpdateMvts")); print ''; print ''; @@ -280,7 +280,7 @@ if ($action == 'create') { setEventMessage($book->errors, 'errors'); } else { - print_fiche_titre($langs->trans("ListeMvts")); + print load_fiche_titre($langs->trans("ListeMvts")); print "
"; if (count($book->linesmvt) > 0) { @@ -367,7 +367,7 @@ if ($action == 'create') { } } else { - print_fiche_titre($langs->trans("NoRecords")); + print load_fiche_titre($langs->trans("NoRecords")); } } diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 0c79820ea44..9277bcd9a70 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -30,11 +30,6 @@ */ class AccountingAccount extends CommonObject { - var $db; - var $error; - var $errors; - - var $id; var $rowid; var $datec; // Creation date @@ -61,21 +56,26 @@ class AccountingAccount extends CommonObject /** * Load record in memory * - * @param int $rowid Id - * @param string $account_number Account number - * @return int <0 if KO, >0 if OK + * @param int $rowid Id + * @param string $account_number Account number + * @param int $limittocurentchart 1=Do not load record if it is into another accounting system + * @return int <0 if KO, >0 if OK */ - function fetch($rowid = null, $account_number = null) + function fetch($rowid = null, $account_number = null, $limittocurentchart=0) { + global $conf; + if ($rowid || $account_number) { $sql = "SELECT rowid, datec, tms, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, fk_user_author, fk_user_modif, active"; - $sql.= " FROM " . MAIN_DB_PREFIX . "accountingaccount WHERE"; + $sql.= " FROM " . MAIN_DB_PREFIX . "accounting_account WHERE"; if ($rowid) { $sql .= " rowid = '" . $rowid . "'"; } elseif ($account_number) { $sql .= " account_number = '" . $account_number . "'"; } - + if (!empty($limittocurentchart)) { + $sql .=' AND fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid='.$conf->global->CHARTOFACCOUNTS.')'; + } dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -101,14 +101,15 @@ class AccountingAccount extends CommonObject return 0; } } else { - dol_print_error($this->db); + $this->error="Error " . $this->db->lasterror(); + $this->errors[] = "Error " . $this->db->lasterror(); } } return -1; } /** - * Insert line in accountingaccount + * Insert line in accounting_account * * @param User $user Use making action * @param int $notrigger Disable triggers @@ -142,7 +143,7 @@ class AccountingAccount extends CommonObject // Put here code to add control on parameters values // Insert request - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "accountingaccount("; + $sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_account("; $sql .= "datec"; $sql .= ", entity"; @@ -180,7 +181,7 @@ class AccountingAccount extends CommonObject } if (! $error) { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accountingaccount"); + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_account"); // if (! $notrigger) { // Uncomment this and change MYOBJECT to your own tag if you @@ -219,7 +220,7 @@ class AccountingAccount extends CommonObject { $this->db->begin(); - $sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount "; + $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account "; $sql .= " SET fk_pcg_version = " . ($this->fk_pcg_version ? "'" . $this->db->escape($this->fk_pcg_version) . "'" : "null"); $sql .= " , pcg_type = " . ($this->pcg_type ? "'" . $this->db->escape($this->pcg_type) . "'" : "null"); $sql .= " , pcg_subtype = " . ($this->pcg_subtype ? "'" . $this->db->escape($this->pcg_subtype) . "'" : "null"); @@ -307,7 +308,7 @@ class AccountingAccount extends CommonObject // } if (! $error) { - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "accountingaccount"; + $sql = "DELETE FROM " . MAIN_DB_PREFIX . "accounting_account"; $sql .= " WHERE rowid=" . $this->id; dol_syslog(get_class($this) . "::delete sql=" . $sql); @@ -369,7 +370,7 @@ class AccountingAccount extends CommonObject function info($id) { $sql = 'SELECT a.rowid, a.datec, a.fk_user_author, a.fk_user_modif, a.tms'; - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'accountingaccount as a'; + $sql .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as a'; $sql .= ' WHERE a.rowid = ' . $id; dol_syslog(get_class($this) . '::info sql=' . $sql); @@ -411,7 +412,7 @@ class AccountingAccount extends CommonObject if ($result > 0) { $this->db->begin(); - $sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount "; + $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account "; $sql .= "SET active = '0'"; $sql .= " WHERE rowid = ".$this->db->escape($id); @@ -441,7 +442,7 @@ class AccountingAccount extends CommonObject { $this->db->begin(); - $sql = "UPDATE " . MAIN_DB_PREFIX . "accountingaccount "; + $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account "; $sql .= "SET active = '1'"; $sql .= " WHERE rowid = ".$this->db->escape($id); diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index a36ca8c1825..141b122690c 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Olivier Geffroy - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2013-2014 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -29,11 +29,6 @@ */ class BookKeeping extends CommonObject { - var $db; - var $error; - var $errors; - - var $id; var $doc_date; var $doc_type; var $doc_ref; @@ -225,6 +220,8 @@ class BookKeeping extends CommonObject */ function create($user='') { + global $conf; + $this->piece_num = 0; // first check if line not yet in bookkeeping @@ -278,13 +275,45 @@ class BookKeeping extends CommonObject $this->date_create = $now; } - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_bookkeeping (doc_date, "; - $sql .= "doc_type, doc_ref,fk_doc,fk_docdet,code_tiers,numero_compte,label_compte,"; - $sql .= "debit,credit,montant,sens,fk_user_author,import_key,code_journal,piece_num)"; - $sql .= " VALUES ('" . $this->doc_date . "','" . $this->doc_type . "','" . $this->doc_ref . "'," . $this->fk_doc . ","; - $sql .= $this->fk_docdet . ",'" . $this->code_tiers . "','" . $this->numero_compte . "','" . $this->db->escape($this->label_compte) . "',"; - $sql .= $this->debit . "," . $this->credit . "," . $this->montant . ",'" . $this->sens . "'," . $user->id . ", '"; - $sql .= $this->date_create . "','" . $this->code_journal . "'," . $this->piece_num . ")"; + $sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_bookkeeping ("; + + $sql .= "doc_date"; + $sql .= ", doc_type"; + $sql .= ", doc_ref"; + $sql .= ", fk_doc"; + $sql .= ", fk_docdet"; + $sql .= ", code_tiers"; + $sql .= ", numero_compte"; + $sql .= ", label_compte"; + $sql .= ", debit"; + $sql .= ", credit"; + $sql .= ", montant"; + $sql .= ", sens"; + $sql .= ", fk_user_author"; + $sql .= ", import_key"; + $sql .= ", code_journal"; + $sql .= ", piece_num"; + + $sql .= ") VALUES ("; + + $sql .= "'" . $this->doc_date . "'"; + $sql .= ",'" . $this->doc_type . "'"; + $sql .= ",'" . $this->doc_ref . "'"; + $sql .= "," . $this->fk_doc; + $sql .= "," . $this->fk_docdet; + $sql .= ",'" . $this->code_tiers . "'"; + $sql .= ",'" . $this->numero_compte . "'"; + $sql .= ",'" . $this->db->escape($this->label_compte) . "'"; + $sql .= "," . $this->debit; + $sql .= "," . $this->credit; + $sql .= "," . $this->montant; + $sql .= ",'" . $this->sens . "'"; + $sql .= ",'" . $this->fk_user_author."'"; + $sql .= ",'" . $this->date_create . "'"; + $sql .= ",'" . $this->code_journal . "'"; + $sql .= "," . $this->piece_num; + + $sql .= ")"; dol_syslog(get_class($this) . ":: create sql=" . $sql, LOG_DEBUG); $resql = $this->db->query($sql); @@ -296,19 +325,19 @@ class BookKeeping extends CommonObject $result = 0; } else { $result = - 2; - dol_syslog("BookKeeping::Create Erreur $result lecture ID"); + dol_syslog("BookKeeping::Create Error $result lecture ID"); } } else { $result = - 1; - dol_syslog("BookKeeping::Create Erreur $result INSERT Mysql"); + dol_syslog("BookKeeping::Create Error $result INSERT Mysql"); } } else { $result = - 3; - dol_syslog("BookKeeping::Create Erreur $result SELECT Mysql"); + dol_syslog("BookKeeping::Create Error $result SELECT Mysql"); } } else { $result = - 5; - dol_syslog("BookKeeping::Create Erreur $result SELECT Mysql"); + dol_syslog("BookKeeping::Create Error $result SELECT Mysql"); } return $result; diff --git a/htdocs/accountancy/class/html.formventilation.class.php b/htdocs/accountancy/class/html.formventilation.class.php index b86c0fdd2e2..de94d645c92 100644 --- a/htdocs/accountancy/class/html.formventilation.class.php +++ b/htdocs/accountancy/class/html.formventilation.class.php @@ -94,7 +94,7 @@ class FormVentilation extends Form * @param array $event Event options * @param int $select_in $selectid value is a aa.rowid (0 default) or aa.account_number (1) * @param int $select_out set value returned by select 0=rowid (default), 1=account_number - * @param int $aabase set accountingaccount base class to display empty=all or from 1 to 8 will display only account beginning by + * @param int $aabase set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by * * @return string String with HTML select */ @@ -105,7 +105,7 @@ class FormVentilation extends Form $out = ''; $sql = "SELECT DISTINCT aa.account_number, aa.label, aa.rowid, aa.fk_pcg_version"; - $sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa"; + $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS; $sql .= " AND aa.active = 1"; @@ -132,7 +132,7 @@ class FormVentilation extends Form if ($select_in == 1 ) $select_value_in = $obj->account_number; if ($select_out == 0 ) $select_value_out = $obj->rowid; if ($select_out == 1 ) $select_value_out = $obj->account_number; - // Remember guy's we store in database llx_facturedet the rowid of accountingaccount and not the account_number + // Remember guy's we store in database llx_facturedet the rowid of accounting_account and not the account_number // Because same account_number can be share between different accounting_system and do have the same meaning if (($selectid != '') && $selectid == $select_value_in) { // $out .= ''; @@ -171,7 +171,7 @@ class FormVentilation extends Form $out = ''; $sql = "SELECT DISTINCT pcg_type "; - $sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa"; + $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS; $sql .= " ORDER BY pcg_type"; @@ -227,7 +227,7 @@ class FormVentilation extends Form $out = ''; $sql = "SELECT DISTINCT pcg_subtype "; - $sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa"; + $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS; $sql .= " ORDER BY pcg_subtype"; diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 03f6b817101..09e8b24a8ea 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -85,7 +85,7 @@ if (! empty($id)) { $sql .= " l.fk_code_ventilation, aa.account_number, aa.label"; $sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as l"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid"; + $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON l.fk_code_ventilation = aa.rowid"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture"; $sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id; @@ -108,7 +108,7 @@ if (! empty($id)) { print ''; print ''; - print_fiche_titre($langs->trans('CustomersVentilation'),'','title_setup'); + print load_fiche_titre($langs->trans('CustomersVentilation'),'','title_setup'); dol_fiche_head(); diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 24c0e81587f..ea37f237455 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -65,12 +65,12 @@ if ($action == 'validatehistory') { if ($db->type == 'pgsql') { $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd"; $sql1 .= " SET fd.fk_code_ventilation = accnt.rowid"; - $sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accountingaccount as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst"; + $sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst"; $sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS; $sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number"; $sql1 .= " AND fd.fk_code_ventilation = 0"; } else { - $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accountingaccount as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst"; + $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst"; $sql1 .= " SET fd.fk_code_ventilation = accnt.rowid"; $sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS; $sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number"; @@ -98,7 +98,7 @@ llxHeader('', $langs->trans("CustomersVentilation")); $textprevyear = '' . img_previous() . ''; $textnextyear = ' ' . img_next() . ''; -print_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear); +print load_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear); print '' . $langs->trans("DescVentilCustomer") . ''; print ''; @@ -154,7 +154,7 @@ $sql .= " ROUND(SUM(IF(MONTH(f.datef)=12,fd.total_ht,0)),2) AS 'Decembre',"; $sql .= " ROUND(SUM(fd.total_ht),2) as 'Total'"; $sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture"; -$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON aa.rowid = fd.fk_code_ventilation"; +$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation"; $sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'"; $sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'"; diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 11d69e3c7e6..01f34e700cc 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -27,10 +27,13 @@ */ require '../../main.inc.php'; + +// Class require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +// Langs $langs->load("bills"); $langs->load("compta"); $langs->load("main"); @@ -38,23 +41,23 @@ $langs->load("accountancy"); $account_parent = GETPOST('account_parent'); $changeaccount = GETPOST('changeaccount'); +//Search Getpost $search_ref = GETPOST('search_ref','alpha'); $search_invoice = GETPOST('search_invoice','alpha'); $search_label = GETPOST('search_label','alpha'); $search_desc = GETPOST('search_desc','alpha'); $search_amount = GETPOST('search_amount','alpha'); $search_account = GETPOST('search_account','alpha'); +$search_vat = GETPOST('search_vat','alpha'); +//Getpost Order and column and limit page $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); - -//if ($page == -1) { $page = 0; } if ($page < 0) $page = 0; $pageprev = $page - 1; $pagenext = $page + 1; -//$limit = $conf->liste_limit; if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { @@ -62,19 +65,11 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { } else { $limit = $conf->liste_limit; } -//$offset = $conf->liste_limit * $page; $offset = $limit * $page; -// TODO : remove comment -//elarifr we can not use only -//$sql .= " ORDER BY l.rowid"; -// f.datef will order like FA08 FA09 FA10 FA05 FA06 FA07 FA04... -// f.facnumber will not order properly invoice / avoir / accompte you can have All AC then All AV and all FA -// l.rowid when an invoice is edited rowid are added at end of table & facturedet.rowid are not ordered -//if (! $sortfield) $sortfield="f.facnumber"; + if (! $sortfield) $sortfield="f.datef, f.facnumber, l.rowid"; -//if (! $sortorder) $sortorder="DESC"; if (! $sortorder) { if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) { $sortorder = " DESC "; @@ -98,6 +93,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_desc=''; $search_amount=''; $search_account=''; + $search_vat=''; } if (is_array($changeaccount) && count($changeaccount) > 0) { @@ -158,7 +154,7 @@ print ''; -/* - * Action - */ /* * Supplier Invoice lines @@ -134,7 +156,7 @@ print ''; - print_fiche_titre($langs->trans("NewMenu"),'','title_setup'); + print load_fiche_titre($langs->trans("NewMenu"),'','title_setup'); print '
'; print ''; @@ -379,7 +379,7 @@ if ($action == 'create') } elseif ($action == 'edit') { - print_fiche_titre($langs->trans("ModifMenu"),'','title_setup'); + print load_fiche_titre($langs->trans("ModifMenu"),'','title_setup'); print '
'; print ''; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 62bf0bbd617..c8699209268 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -214,7 +214,7 @@ $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css') llxHeader('',$langs->trans("Menus"),'','',0,0,$arrayofjs,$arrayofcss); -print_fiche_titre($langs->trans("Menus"),'','title_setup'); +print load_fiche_titre($langs->trans("Menus"),'','title_setup'); $h = 0; diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index 8a893b21321..73dc0fe3b85 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -71,7 +71,7 @@ else if ($action == 'disable_layoutmenu') llxHeader('',$langs->trans("Setup")); -print_fiche_titre($langs->trans("Menus"),'','title_setup'); +print load_fiche_titre($langs->trans("Menus"),'','title_setup'); $h = 0; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 86cfae1d606..cf974990f01 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -1,11 +1,12 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2013 Laurent Destailleur - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry +/* Copyright (C) 2003-2007 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Raphaël Doursenaud * * 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 +29,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; $langs->load("errors"); $langs->load("admin"); @@ -76,28 +78,7 @@ llxHeader('',$langs->trans("Setup"),$help_url); // Search modules dirs -$modulesdir = array(); -foreach ($conf->file->dol_document_root as $type => $dirroot) -{ - $modulesdir[$dirroot . '/core/modules/'] = $dirroot . '/core/modules/'; - - $handle=@opendir($dirroot); - if (is_resource($handle)) - { - while (($file = readdir($handle))!==false) - { - if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') - { - if (is_dir($dirroot . '/' . $file . '/core/modules/')) - { - $modulesdir[$dirroot . '/' . $file . '/core/modules/'] = $dirroot . '/' . $file . '/core/modules/'; - } - } - } - closedir($handle); - } -} -//var_dump($modulesdir); +$modulesdir = dolGetModulesDirs(); $filename = array(); @@ -469,11 +450,11 @@ if ($mode != 'marketplace') } else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs)) { - print '
'; + print ''; } else { - print ''; + print ''; } } else @@ -500,7 +481,8 @@ if ($mode != 'marketplace') print img_picto($langs->trans("Disabled"),'switch_off'); print "\n"; } - print "\n "; + print "\n"; + print ""; } print "\n"; diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index bab6db29959..fca545e83cd 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -115,7 +115,7 @@ $notify = new Notify($db); llxHeader('',$langs->trans("NotificationSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("NotificationSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("NotificationSetup"),$linkback,'title_setup'); print $langs->trans("NotificationsDesc").'

'; @@ -143,7 +143,7 @@ print '
'; if ($conf->societe->enabled) { - print_fiche_titre($langs->trans("ListOfNotificationsPerContact"),'',''); + print load_fiche_titre($langs->trans("ListOfNotificationsPerContact"),'',''); print '
'.img_picto($langs->trans("Setup"),"setup").''.img_picto($langs->trans("Setup"),"setup").''.img_picto($langs->trans("Setup"),"setup").''.img_picto($langs->trans("Setup"),"setup").'  
'; print ''; @@ -186,7 +186,7 @@ if ($conf->societe->enabled) } -print_fiche_titre($langs->trans("ListOfFixedNotifications"),'',''); +print load_fiche_titre($langs->trans("ListOfFixedNotifications"),'',''); print '
'; print ''; diff --git a/htdocs/admin/order_extrafields.php b/htdocs/admin/order_extrafields.php index 0c71c3285ad..ea0f99021cf 100644 --- a/htdocs/admin/order_extrafields.php +++ b/htdocs/admin/order_extrafields.php @@ -70,7 +70,7 @@ $textobject=$langs->transnoentitiesnoconv("Orders"); llxHeader('',$langs->trans("OrdersSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("OrdersSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("OrdersSetup"),$linkback,'title_setup'); print "
\n"; $head = order_admin_prepare_head(); @@ -100,7 +100,7 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print "
"; - print_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } @@ -113,7 +113,7 @@ if ($action == 'create') if ($action == 'edit' && ! empty($attrname)) { print "
"; - print_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } diff --git a/htdocs/admin/orderdet_extrafields.php b/htdocs/admin/orderdet_extrafields.php index 9f16d7934b1..8e542e3d871 100644 --- a/htdocs/admin/orderdet_extrafields.php +++ b/htdocs/admin/orderdet_extrafields.php @@ -71,7 +71,7 @@ $textobject=$langs->transnoentitiesnoconv("OrderLines"); llxHeader('',$langs->trans("OrdersSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("OrdersSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("OrdersSetup"),$linkback,'title_setup'); print "
\n"; $head = order_admin_prepare_head(); @@ -101,7 +101,7 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print "
"; - print_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } @@ -114,7 +114,7 @@ if ($action == 'create') if ($action == 'edit' && ! empty($attrname)) { print "
"; - print_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 9f12c98e1d8..7bd46ac9684 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -93,7 +93,7 @@ $form=new Form($db); $formother=new FormOther($db); $formadmin=new FormAdmin($db); -print_fiche_titre($langs->trans("PDF"),'','title_setup'); +print load_fiche_titre($langs->trans("PDF"),'','title_setup'); print $langs->trans("PDFDesc")."
\n"; print "
\n"; @@ -110,7 +110,7 @@ if ($action == 'edit') // Edit // Misc options - print_fiche_titre($langs->trans("DictionaryPaperFormat"),'','').'
'; + print load_fiche_titre($langs->trans("DictionaryPaperFormat"),'','').'
'; $var=true; print '
'; print ''; @@ -130,7 +130,7 @@ if ($action == 'edit') // Edit // Addresses - print_fiche_titre($langs->trans("PDFAddressForging"),'','').'
'; + print load_fiche_titre($langs->trans("PDFAddressForging"),'','').'
'; $var=true; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print ''; @@ -212,7 +212,7 @@ if ($action == 'edit') // Edit print '
'; // Other - print_fiche_titre($langs->trans("Other"),'','').'
'; + print load_fiche_titre($langs->trans("Other"),'','').'
'; $var=true; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print ''; @@ -262,7 +262,7 @@ else // Show $var=true; // Misc options - print_fiche_titre($langs->trans("DictionaryPaperFormat"),'','').'
'; + print load_fiche_titre($langs->trans("DictionaryPaperFormat"),'','').'
'; $var=true; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print ''; @@ -299,7 +299,7 @@ else // Show print '
'; - print_fiche_titre($langs->trans("PDFAddressForging"),'','').'
'; + print load_fiche_titre($langs->trans("PDFAddressForging"),'','').'
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print ''; @@ -380,7 +380,7 @@ else // Show print '
'; // Other - print_fiche_titre($langs->trans("Other"),'','').'
'; + print load_fiche_titre($langs->trans("Other"),'','').'
'; $var=true; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print ''; @@ -453,7 +453,7 @@ else // Show * Library */ print '
'; - print_titre($langs->trans("Library")); + print load_fiche_titre($langs->trans("Library")); print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'."\n"; diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 5bb526352f6..cf9dce45c08 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -64,7 +64,7 @@ if ($action == 'remove') llxHeader('',$langs->trans("DefaultRights")); -print_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); +print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); print $langs->trans("DefaultRightsDesc"); print " ".$langs->trans("OnlyActiveElementsAreShown")."

\n"; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 31c1e5e7dba..56aa69e9943 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -119,7 +119,7 @@ llxHeader('',$langs->trans("WithdrawalsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("WithdrawalsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("WithdrawalsSetup"),$linkback,'title_setup'); print '
'; print ''; @@ -178,7 +178,7 @@ print '
'; if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) { $langs->load("mails"); - print_titre($langs->trans("Notifications")); + print load_fiche_titre($langs->trans("Notifications")); $sql = "SELECT u.rowid, u.lastname, u.firstname, u.fk_soc, u.email"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; @@ -238,11 +238,11 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) print "\n"; print ''; print ''; print ''; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index b407f5bc6f8..1294888ceb1 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -261,7 +261,7 @@ $form=new Form($db); //if ($mesg) print $mesg; $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("PropalSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("PropalSetup"),$linkback,'title_setup'); $head = propal_admin_prepare_head(); @@ -270,7 +270,7 @@ dol_fiche_head($head, 'general', $langs->trans("Proposals"), 0, 'propal'); /* * Module numerotation */ -print_titre($langs->trans("ProposalsNumberingModules")); +print load_fiche_titre($langs->trans("ProposalsNumberingModules")); print '
'; - print $form->selectarray('user',$internalusers);// select_users(0,'user',0); + print $form->selectarray('user',$internalusers);// select_dolusers(0,'user',0); print ''; - print $form->selectarray('action',$actions);// select_users(0,'user',0); + print $form->selectarray('action',$actions);// select_dolusers(0,'user',0); print '
'; print ''; @@ -374,7 +374,7 @@ print "

\n"; * Document templates generators */ -print_titre($langs->trans("ProposalsPDFModules")); +print load_fiche_titre($langs->trans("ProposalsPDFModules")); // Load array def with activated templates $def = array(); @@ -536,7 +536,7 @@ print '
'; * Other options * */ -print_titre($langs->trans("OtherOptions")); +print load_fiche_titre($langs->trans("OtherOptions")); $var=true; print ""; @@ -578,7 +578,17 @@ print ''; print ''; print '\n"; @@ -633,7 +643,7 @@ print '
'; print $langs->trans("FreeLegalTextOnProposal").' ('.$langs->trans("AddCRIfTooLong").')
'; -print ''; +$variablename='PROPALE_FREE_TEXT'; +if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) +{ + print ''; +} +else +{ + include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details'); + print $doleditor->Create(); +} print '
'; print ''; print "
'; * Directory */ print '
'; -print_titre($langs->trans("PathToDocuments")); +print load_fiche_titre($langs->trans("PathToDocuments")); print "\n"; print "\n"; @@ -648,7 +658,7 @@ print "
\n
"; * Notifications */ -print_titre($langs->trans("Notifications")); +print load_fiche_titre($langs->trans("Notifications")); print ''; print ''; print ''; diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index 00d66944c97..100da221ce6 100644 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -81,7 +81,7 @@ $form = new Form($db); llxHeader('',$langs->trans("Proxy")); -print_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); +print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); print $langs->trans("ProxyDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/salaries.php b/htdocs/admin/salaries.php index 291c3848a63..bb37e73fc88 100644 --- a/htdocs/admin/salaries.php +++ b/htdocs/admin/salaries.php @@ -77,7 +77,7 @@ llxHeader('',$langs->trans('SalariesSetup')); $form = new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans('SalariesSetup'),$linkback,'title_setup'); +print load_fiche_titre($langs->trans('SalariesSetup'),$linkback,'title_setup'); print ''; print ''; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 0eeef2cbe15..77e5e75f58d 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -185,7 +185,7 @@ $form = new Form($db); llxHeader('',$langs->trans("Passwords")); -print_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); +print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); print $langs->trans("GeneratedPasswordDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index e72ece4375c..a7afaf0ef0a 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -111,7 +111,7 @@ $form = new Form($db); llxHeader('',$langs->trans("Files")); -print_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); +print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); //print $langs->trans("FilesDesc")."
\n"; //print "
\n"; diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 74101f29710..6c040e8d6d6 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -89,7 +89,7 @@ $form = new Form($db); llxHeader('',$langs->trans("Miscellaneous")); -print_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); +print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); print $langs->trans("MiscellaneousDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index 44bab100730..4b7818ecadb 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -147,7 +147,7 @@ if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0; $wikihelp='EN:Setup Sms|FR:Paramétrage Sms|ES:Configuración Sms'; llxHeader('',$langs->trans("Setup"),$wikihelp); -print_fiche_titre($langs->trans("SmsSetup"),'','title_setup'); +print load_fiche_titre($langs->trans("SmsSetup"),'','title_setup'); print $langs->trans("SmsDesc")."
\n"; print "
\n"; @@ -289,7 +289,7 @@ else if ($_GET["action"] == 'testconnect') { print '
'; - print_titre($langs->trans("DoTestServerAvailability")); + print load_fiche_titre($langs->trans("DoTestServerAvailability")); // If we use SSL/TLS if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $server='ssl://'.$server; @@ -311,7 +311,7 @@ else if ($action == 'test') { print '
'; - print_titre($langs->trans("DoTestSend")); + print load_fiche_titre($langs->trans("DoTestSend")); // Cree l'objet formulaire mail include_once DOL_DOCUMENT_ROOT.'/core/class/html.formsms.class.php'; diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index 753fef37be6..e46d9b8f5b7 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -110,7 +110,7 @@ llxHeader('',$langs->trans("MailmanSpipSetup"),$help_url); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'title_setup'); $head = mailmanspip_admin_prepare_head(); @@ -137,7 +137,7 @@ if (! empty($conf->global->ADHERENT_USE_SPIP)) 'ADHERENT_SPIP_PASS' ); - print_fiche_titre($langs->trans('SPIPTitle'), $link, ''); + print load_fiche_titre($langs->trans('SPIPTitle'), $link, ''); print '
'; form_constantes($constantes); print '
'; @@ -148,7 +148,7 @@ else //$link.=$langs->trans("Activate"); $link.=img_picto($langs->trans("Disabled"),'switch_off'); $link.=''; - print_fiche_titre($langs->trans('SPIPTitle'), $link, ''); + print load_fiche_titre($langs->trans('SPIPTitle'), $link, ''); } diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 0f6560ad055..2ed2f4f869e 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -113,7 +113,7 @@ if($action) llxHeader('',$langs->trans("StockSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("StockSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("StockSetup"),$linkback,'title_setup'); $form=new Form($db); diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 9c70ecc5e4c..694247e7b81 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -194,7 +194,7 @@ llxHeader("",""); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'title_setup'); print "
"; @@ -205,7 +205,7 @@ dol_fiche_head($head, 'invoice', $langs->trans("Suppliers"), 0, 'company'); // Supplier invoice numbering module -print_titre($langs->trans("SuppliersInvoiceNumberingModel")); +print load_fiche_titre($langs->trans("SuppliersInvoiceNumberingModel")); print '
'.$langs->trans("Parameter").'
'; print ''; @@ -311,7 +311,7 @@ print '

'; * Modeles documents for supplier invoices */ -print_titre($langs->trans("BillsPDFModules")); +print load_fiche_titre($langs->trans("BillsPDFModules")); // Defini tableau def de modele $def = array(); @@ -453,7 +453,7 @@ print ''; print ''; print ''; -print_titre($langs->trans("OtherOptions")); +print load_fiche_titre($langs->trans("OtherOptions")); print ''; print ''; print ''; @@ -463,7 +463,17 @@ print "\n"; print '\n"; @@ -477,7 +487,7 @@ print ''; * Notifications */ -print_titre($langs->trans("Notifications")); +print load_fiche_titre($langs->trans("Notifications")); print '
'.$langs->trans("Parameter").'
'; print $langs->trans("FreeLegalTextOnInvoices").' ('.$langs->trans("AddCRIfTooLong").')
'; -print ''; +$variablename='SUPPLIER_INVOICE_FREE_TEXT'; +if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) +{ + print ''; +} +else +{ + include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details'); + print $doleditor->Create(); +} print '
'; print ''; print "
'; print ''; print ''; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 87d46ea10b0..861e94c881b 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -168,19 +168,11 @@ else if ($action == 'addcat') else if ($action == 'set_SUPPLIER_ORDER_OTHER') { $freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT'); // No alpha here, we want exact string - $doubleapproval = GETPOST('SUPPLIER_ORDER_DOUBLE_APPROVAL'); - //$doubleapprovalgroup = GETPOST('SUPPLIER_ORDER_DOUBLE_APPROVAL_GROUP') > 0 ? GETPOST('SUPPLIER_ORDER_DOUBLE_APPROVAL_GROUP') : ''; + $doubleapproval = GETPOST('SUPPLIER_ORDER_DOUBLE_APPROVAL','alpha'); + $doubleapproval = price2num($doubleapproval ); $res1 = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); $res2 = dolibarr_set_const($db, "SUPPLIER_ORDER_DOUBLE_APPROVAL",$doubleapproval,'chaine',0,'',$conf->entity); - /*if (isset($_POST["SUPPLIER_ORDER_DOUBLE_APPROVAL_GROUP"])) - { - $res3 = dolibarr_set_const($db, "SUPPLIER_ORDER_DOUBLE_APPROVAL_GROUP",$doubleapprovalgroup,'chaine',0,'',$conf->entity); - } - else - { - $res3=1; - }*/ // TODO We add/delete permission here until permission can have a condition on a global var include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php'; @@ -218,7 +210,7 @@ $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); llxHeader("",""); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'title_setup'); print "
"; @@ -229,7 +221,7 @@ dol_fiche_head($head, 'order', $langs->trans("Suppliers"), 0, 'company'); // Supplier order numbering module -print_titre($langs->trans("OrdersNumberingModules")); +print load_fiche_titre($langs->trans("OrdersNumberingModules")); print '
'.$langs->trans("Parameter").'
'; print ''; @@ -333,7 +325,7 @@ print '

'; * Documents models for supplier orders */ -print_titre($langs->trans("OrdersModelModule")); +print load_fiche_titre($langs->trans("OrdersModelModule")); // Defini tableau def de modele $def = array(); @@ -472,7 +464,7 @@ print '
'; print ''; print ''; -print_titre($langs->trans("OtherOptions")); +print load_fiche_titre($langs->trans("OtherOptions")); print ''; print ''; print ''; @@ -486,23 +478,26 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) print $langs->trans("UseDoubleApproval").'
'; print $langs->trans("IfSetToYesDontForgetPermission"); print '\n"; $var=!$var; - /*print '\n"; - $var=!$var;*/ } print '\n"; @@ -517,7 +512,7 @@ print ''; * Notifications */ -print_titre($langs->trans("Notifications")); +print load_fiche_titre($langs->trans("Notifications")); print '
'.$langs->trans("Parameter").''; - print $form->selectyesno('SUPPLIER_ORDER_DOUBLE_APPROVAL', $conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL, 1); + print ''; print ''; print ''; print "
'; - print $langs->trans("GroupOfUserForSecondApproval").''; - print $form->select_dolgroups($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL_GROUP,'SUPPLIER_ORDER_DOUBLE_APPROVAL_GROUP', 1); - print ''; - print ''; - print "
'; print $langs->trans("FreeLegalTextOnOrders").' ('.$langs->trans("AddCRIfTooLong").')
'; -print ''; +$variablename='SUPPLIER_ORDER_FREE_TEXT'; +if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) +{ + print ''; +} +else +{ + include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details'); + print $doleditor->Create(); +} print '
'; print ''; print "
'; print ''; print ''; diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php index 4e9f1fce9ae..315a88788c2 100644 --- a/htdocs/admin/supplierinvoice_extrafields.php +++ b/htdocs/admin/supplierinvoice_extrafields.php @@ -74,7 +74,7 @@ $textobject=$langs->transnoentitiesnoconv("BillsSuppliers"); llxHeader('',$langs->trans("SuppliersSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'title_setup'); print "
\n"; $head = supplierorder_admin_prepare_head(); @@ -104,7 +104,7 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print "
"; - print_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } @@ -117,7 +117,7 @@ if ($action == 'create') if ($action == 'edit' && ! empty($attrname)) { print "
"; - print_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } diff --git a/htdocs/admin/supplierinvoicedet_extrafields.php b/htdocs/admin/supplierinvoicedet_extrafields.php index b6f71ecc00c..7e0f0f500fd 100644 --- a/htdocs/admin/supplierinvoicedet_extrafields.php +++ b/htdocs/admin/supplierinvoicedet_extrafields.php @@ -74,7 +74,7 @@ $textobject=$langs->transnoentitiesnoconv("BillsSuppliers"); llxHeader('',$langs->trans("SuppliersSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'title_setup'); print "
\n"; $head = supplierorder_admin_prepare_head(); @@ -104,7 +104,7 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print "
"; - print_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } @@ -117,7 +117,7 @@ if ($action == 'create') if ($action == 'edit' && ! empty($attrname)) { print "
"; - print_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php index 135e02a92b4..4dbb8f54760 100644 --- a/htdocs/admin/supplierorder_extrafields.php +++ b/htdocs/admin/supplierorder_extrafields.php @@ -70,7 +70,7 @@ $textobject=$langs->transnoentitiesnoconv("SuppliersOrders"); llxHeader('',$langs->trans("SuppliersSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'title_setup'); print "
\n"; $head = supplierorder_admin_prepare_head(); @@ -100,7 +100,7 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print "
"; - print_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } @@ -113,7 +113,7 @@ if ($action == 'create') if ($action == 'edit' && ! empty($attrname)) { print "
"; - print_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } diff --git a/htdocs/admin/supplierorderdet_extrafields.php b/htdocs/admin/supplierorderdet_extrafields.php index 6d422de4d31..8518c77a8e4 100644 --- a/htdocs/admin/supplierorderdet_extrafields.php +++ b/htdocs/admin/supplierorderdet_extrafields.php @@ -71,7 +71,7 @@ $textobject=$langs->transnoentitiesnoconv("SuppliersOrders"); llxHeader('',$langs->trans("SuppliersSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'title_setup'); print "
\n"; $head = supplierorder_admin_prepare_head(); @@ -101,7 +101,7 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print "
"; - print_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } @@ -114,7 +114,7 @@ if ($action == 'create') if ($action == 'edit' && ! empty($attrname)) { print "
"; - print_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 3eebfebb37b..59921dd3687 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -106,8 +106,17 @@ if ($action == 'set') $activeModules = $newActiveModules; dolibarr_set_const($db, 'SYSLOG_HANDLERS', json_encode($activeModules), 'chaine',0,'',0); + // Check configuration + foreach ($activeModules as $modulename) { + /** + * @var LogHandler + */ + $module = new $modulename; + $error = $module->checkConfiguration(); + } - if (! $error) + + if (! $error) { $db->commit(); setEventMessage($langs->trans("SetupSaved")); @@ -115,7 +124,8 @@ if ($action == 'set') else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessage($error, 'errors'); + } } @@ -147,7 +157,7 @@ llxHeader(); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("SyslogSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SyslogSetup"),$linkback,'title_setup'); print '
'; $def = array(); @@ -168,7 +178,7 @@ if ($conf->global->MAIN_MODULE_MULTICOMPANY && $user->entity) //print "conf->global->MAIN_FEATURES_LEVEL = ".$conf->global->MAIN_FEATURES_LEVEL."

\n"; // Output mode -print_titre($langs->trans("SyslogOutput")); +print load_fiche_titre($langs->trans("SyslogOutput")); // Mode print ''; @@ -215,7 +225,11 @@ foreach ($syslogModules as $moduleName) print ''; print "\n"; @@ -226,7 +240,7 @@ print "\n"; print '
'."\n\n"; -print_titre($langs->trans("SyslogLevel")); +print load_fiche_titre($langs->trans("SyslogLevel")); // Level print ''; diff --git a/htdocs/admin/system/about.php b/htdocs/admin/system/about.php index 889885bb6ea..737e0712ea6 100644 --- a/htdocs/admin/system/about.php +++ b/htdocs/admin/system/about.php @@ -38,7 +38,7 @@ $langs->load("members"); llxHeader(); -print_fiche_titre("Dolibarr",'','title_setup'); +print load_fiche_titre("Dolibarr",'','title_setup'); print '
'.img_picto_common('', 'dolibarr_box.png','height="120"').'
'; @@ -63,11 +63,35 @@ print '
'.$langs->trans("Parameter").'
'; if ($module->getInfo()) { - print $form->textwithpicto('', $module->getInfo()); + print $form->textwithpicto('', $module->getInfo(), 1, 'help'); + } + if ($module->getWarning()) + { + print $form->textwithpicto('', $module->getWarning(), 1, 'warning'); } print '
'; print ''; print ''; diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index 9650b32bd5c..31d35d3f01d 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -46,7 +46,7 @@ if ($action == 'convert') llxHeader(); -print_fiche_titre($langs->trans("Tables")." ".ucfirst($conf->db->type),'','title_setup'); +print load_fiche_titre($langs->trans("Tables")." ".ucfirst($conf->db->type),'','title_setup'); // Define request to get table description diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index e6fc31c4426..365cfaa449d 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -39,7 +39,7 @@ $form=new Form($db); llxHeader(); -print_fiche_titre($langs->trans("InfoDatabase"),'','title_setup'); +print load_fiche_titre($langs->trans("InfoDatabase"),'','title_setup'); // Database print '
'.$langs->trans("Parameter").'
'; diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index b2e01f65ebb..3fc10bb0f3f 100644 --- a/htdocs/admin/system/dbtable.php +++ b/htdocs/admin/system/dbtable.php @@ -41,7 +41,7 @@ $table=GETPOST('table','alpha'); llxHeader(); -print_fiche_titre($langs->trans("Table") . " ".$table,'','title_setup'); +print load_fiche_titre($langs->trans("Table") . " ".$table,'','title_setup'); // Define request to get table description $base=0; diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index a3788e04023..eeea93a2fea 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -42,7 +42,7 @@ $form=new Form($db); llxHeader(); -print_fiche_titre($langs->trans("InfoDolibarr"),'','title_setup'); +print load_fiche_titre($langs->trans("InfoDolibarr"),'','title_setup'); // Version $var=true; diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 431de103fd3..9b7dfb76689 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -31,6 +31,8 @@ $langs->load("admin"); if (!$user->admin) accessforbidden(); +$error=0; + /* * View @@ -38,7 +40,7 @@ if (!$user->admin) llxHeader(); -print_fiche_titre($langs->trans("FileCheckDolibarr"),'','title_setup'); +print load_fiche_titre($langs->trans("FileCheckDolibarr"),'','title_setup'); // Version $var = true; @@ -77,61 +79,91 @@ if (file_exists($xmlfile)) $xml = simplexml_load_file($xmlfile); if ($xml) { - $file_list = array(); - $ret = getFilesUpdated($file_list, $xml->dolibarr_root_dir[0]); // Fill array $file_list - - print '
'; - print ''; - print ''; - print ''; - print ''."\n"; - $var = true; - $tmpfilelist = dol_sort_array($file_list['missing'], 'filename'); - foreach ($tmpfilelist as $file) + if (is_object($xml->dolibarr_htdocs_dir[0])) { - $var = !$var; - print ''; - print '' . "\n"; - print '' . "\n"; - print "\n"; + $file_list = array(); + $ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0]); // Fill array $file_list + + print '
' . $langs->trans("FilesMissing") . '' . $langs->trans("ExpectedChecksum") . '
'.$file['filename'].''.$file['expectedmd5'].'
'; + print ''; + print ''; + print ''; + print ''."\n"; + $var = true; + $tmpfilelist = dol_sort_array($file_list['missing'], 'filename'); + if (is_array($tmpfilelist) && count($tmpfilelist)) + { + foreach ($tmpfilelist as $file) + { + $var = !$var; + print ''; + print '' . "\n"; + print '' . "\n"; + print "\n"; + } + } + else + { + print ''; + } + print '
' . $langs->trans("FilesMissing") . '' . $langs->trans("ExpectedChecksum") . '
'.$file['filename'].''.$file['expectedmd5'].'
'.$langs->trans("None").'
'; + + print '
'; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''."\n"; + $var = true; + $tmpfilelist = dol_sort_array($file_list['updated'], 'filename'); + if (is_array($tmpfilelist) && count($tmpfilelist)) + { + foreach ($tmpfilelist as $file) + { + $var = !$var; + print ''; + print '' . "\n"; + print '' . "\n"; + print '' . "\n"; + print '' . "\n"; + print '' . "\n"; + print "\n"; + } + } + else + { + print ''; + } + print '
' . $langs->trans("FilesUpdated") . '' . $langs->trans("ExpectedChecksum") . '' . $langs->trans("CurrentChecksum") . '' . $langs->trans("Size") . '' . $langs->trans("DateModification") . '
'.$file['filename'].''.$file['expectedmd5'].''.$file['md5'].''.dol_print_size(dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename'])).''.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']),'dayhour').'
'.$langs->trans("None").'
'; } - print ''; - - print '
'; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''."\n"; - $var = true; - $tmpfilelist = dol_sort_array($file_list['updated'], 'filename'); - foreach ($tmpfilelist as $file) + else { - $var = !$var; - print ''; - print '' . "\n"; - print '' . "\n"; - print '' . "\n"; - print '' . "\n"; - print '' . "\n"; - print "\n"; + print 'Error: Failed to found dolibarr_htdocs_dir into XML file '.$xmlfile; + $error++; } - print '
' . $langs->trans("FilesUpdated") . '' . $langs->trans("ExpectedChecksum") . '' . $langs->trans("CurrentChecksum") . '' . $langs->trans("Size") . '' . $langs->trans("DateModification") . '
'.$file['filename'].''.$file['expectedmd5'].''.$file['md5'].''.dol_print_size(dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename'])).''.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']),'dayhour').'
'; + } + else + { + print 'Error: Failed to parse XML for input file '.$xmlfile; + $error++; } } else { print $langs->trans('XmlNotFound') . ': ' . $xmlfile; + $error++; } llxFooter(); $db->close(); +exit($error); + /** * Function to get list of updated or modified files. diff --git a/htdocs/admin/system/index.php b/htdocs/admin/system/index.php index 133b6cfbfff..3d473640618 100644 --- a/htdocs/admin/system/index.php +++ b/htdocs/admin/system/index.php @@ -45,7 +45,7 @@ if (! $user->admin) accessforbidden(); llxHeader(); -print_fiche_titre($langs->trans("SummarySystem"),'','title_setup'); +print load_fiche_titre($langs->trans("SummarySystem"),'','title_setup'); print ''; diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 1014beba184..d812f6c29ed 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -39,7 +39,7 @@ if (! $user->admin) llxHeader(); -print_fiche_titre($langs->trans("AvailableModules"),'','title_setup'); +print load_fiche_titre($langs->trans("AvailableModules"),'','title_setup'); print $langs->trans("ToActivateModule").'
'; print "
\n"; diff --git a/htdocs/admin/system/os.php b/htdocs/admin/system/os.php index 5c20fda1cd4..2e9e56565c0 100644 --- a/htdocs/admin/system/os.php +++ b/htdocs/admin/system/os.php @@ -35,7 +35,7 @@ if (!$user->admin) llxHeader(); -print_fiche_titre($langs->trans("InfoOS"),'','title_setup'); +print load_fiche_titre($langs->trans("InfoOS"),'','title_setup'); print '
'; print ''; diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index b53c666f2af..b993b1ea276 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -48,7 +48,7 @@ $nowstring=dol_print_date(dol_now(),'dayhourlog'); llxHeader(); -print_fiche_titre($langs->trans("PerfDolibarr"),'','title_setup'); +print load_fiche_titre($langs->trans("PerfDolibarr"),'','title_setup'); print $langs->trans("YouMayFindPerfAdviceHere",'http://wiki.dolibarr.org/index.php/FAQ_Increase_Performance').' ('.$langs->trans("Reload").')
'; @@ -108,6 +108,14 @@ if (! $foundcache && $test) $foundcache++; print img_picto('','tick.png').' '.$langs->trans("EAcceleratorInstalled"); } +$test=function_exists('opcache_get_status'); +if (! $foundcache && $test) +{ + $foundcache++; + print img_picto('','tick.png').' '.$langs->trans("ZendOPCacheInstalled"); // Should be by defautl starting with PHP 5.5 + //$tmp=opcache_get_status(); + //var_dump($tmp); +} $test=function_exists('apc_cache_info'); if (! $foundcache && $test) { diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index 89b0f8cd8dc..dfb897ba27c 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -43,7 +43,7 @@ $title='InfoPHP'; if (isset($title)) { - print_fiche_titre($langs->trans($title), '', 'title_setup'); + print load_fiche_titre($langs->trans($title), '', 'title_setup'); } @@ -67,7 +67,7 @@ print '
'; $phparray=phpinfo_array(); foreach($phparray as $key => $value) { - //print_titre($key); + //print load_fiche_titre($key); print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print ''; //print ''; diff --git a/htdocs/admin/system/web.php b/htdocs/admin/system/web.php index 2d51344b68c..d1864b1b409 100644 --- a/htdocs/admin/system/web.php +++ b/htdocs/admin/system/web.php @@ -42,7 +42,7 @@ if (!$user->admin) accessforbidden(); llxHeader(); -print_fiche_titre($langs->trans("InfoWebServer"),'','title_setup'); +print load_fiche_titre($langs->trans("InfoWebServer"),'','title_setup'); print '
'.$langs->trans("Parameter").'
'; print "\n"; diff --git a/htdocs/admin/system/xcache.php b/htdocs/admin/system/xcache.php index e6c0f7ae477..361be2b461a 100644 --- a/htdocs/admin/system/xcache.php +++ b/htdocs/admin/system/xcache.php @@ -35,7 +35,7 @@ $action=GETPOST('action'); llxHeader(); -print_fiche_titre("XCache",'','title_setup'); +print load_fiche_titre("XCache",'','title_setup'); print "
\n"; diff --git a/htdocs/admin/system/xdebug.php b/htdocs/admin/system/xdebug.php index 501f74b414b..4236d8c6019 100644 --- a/htdocs/admin/system/xdebug.php +++ b/htdocs/admin/system/xdebug.php @@ -34,7 +34,7 @@ accessforbidden(); llxHeader(); -print_fiche_titre("XDebug",'','title_setup'); +print load_fiche_titre("XDebug",'','title_setup'); print "
\n"; diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 0802b2230ec..36c2f66aa51 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -114,7 +114,7 @@ llxHeader(); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans('TaxSetup'),$linkback,'title_setup'); +print load_fiche_titre($langs->trans('TaxSetup'),$linkback,'title_setup'); dol_fiche_head(); @@ -143,7 +143,7 @@ else print "
".$langs->trans("Parameter")."".$langs->trans("Value")."
\n"; print '
'; - print_fiche_titre($langs->trans("SummaryOfVatExigibilityUsedByDefault"),'',''); + print load_fiche_titre($langs->trans("SummaryOfVatExigibilityUsedByDefault"),'',''); //print ' ('.$langs->trans("CanBeChangedWhenMakingInvoice").')'; print ''; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 6f1783e5d11..a460f667e2a 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -110,7 +110,7 @@ jQuery(document).ready(function() { trans("Backup"),'','title_setup'); +print load_fiche_titre($langs->trans("Backup"),'','title_setup'); print $langs->trans("BackupDesc",DOL_DATA_ROOT).'

'; @@ -133,7 +133,7 @@ print '
'; trans("BackupDumpWizard")); +print load_fiche_titre($title?$title:$langs->trans("BackupDumpWizard")); print '
'; print ''; diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index 0826eec832a..e1de295eba5 100644 --- a/htdocs/admin/tools/dolibarr_import.php +++ b/htdocs/admin/tools/dolibarr_import.php @@ -63,7 +63,7 @@ jQuery(document).ready(function() { trans("Restore"),'','title_setup'); +print load_fiche_titre($langs->trans("Restore"),'','title_setup'); print $langs->trans("RestoreDesc",DOL_DATA_ROOT).'

'; ?> diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php index da168eec510..588170fbb90 100644 --- a/htdocs/admin/tools/eaccelerator.php +++ b/htdocs/admin/tools/eaccelerator.php @@ -227,7 +227,7 @@ function create_key_table($list) $form=new Form($db); -print_fiche_titre('Dolibarr eAccelerator '.$info['version'].' control panel','','title_setup'); +print load_fiche_titre('Dolibarr eAccelerator '.$info['version'].' control panel','','title_setup'); $var=true; diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index f3f21388cc1..500c766ed77 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -95,7 +95,7 @@ $formfile = new FormFile($db); //$help_url='EN:Backups|FR:Sauvegardes|ES:Copias_de_seguridad'; //llxHeader('','',$help_url); -//print_fiche_titre($langs->trans("Backup"),'','title_setup'); +//print load_fiche_titre($langs->trans("Backup"),'','title_setup'); // Start with empty buffer diff --git a/htdocs/admin/tools/index.php b/htdocs/admin/tools/index.php index 4ea716c322b..6d7082728f3 100644 --- a/htdocs/admin/tools/index.php +++ b/htdocs/admin/tools/index.php @@ -42,7 +42,7 @@ if (GETPOST('leftmenu') == 'modulesadmintools') $title=$langs->trans("ModulesSys llxHeader(array(),$title); -print_fiche_titre($title,'','title_setup'); +print load_fiche_titre($title,'','title_setup'); print $langs->trans("SystemToolsAreaDesc").'
'; print "
"; diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 6d553f1b236..204ac36ea03 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -182,7 +182,8 @@ if ($result) $formquestion=array(); print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeAuditEvents'), $langs->trans('ConfirmPurgeAuditEvents'),'confirm_purge',$formquestion,'no',1); } - + + print ''; print '
'; print ''; print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","","",'align="left"',$sortfield,$sortorder); @@ -195,7 +196,6 @@ if ($result) // Lignes des champs de filtres - print ''; print ''; print ''; @@ -222,7 +222,6 @@ if ($result) print ''; print "\n"; - print ''; $var=True; @@ -283,7 +282,7 @@ if ($result) if ($usefilter) print ''; else print ''; } - print "
'.$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).$form->select_date($date_end,'date_end',0,0,0,'',1,0,1).'
'.$langs->trans("NoEventFoundWithCriteria").'
'.$langs->trans("NoEventOrNoAuditSetup").'
"; + print ""; $db->free($result); if ($num) diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php index 9bd700a7c9e..0c5915fd326 100644 --- a/htdocs/admin/tools/purge.php +++ b/htdocs/admin/tools/purge.php @@ -117,7 +117,7 @@ llxHeader(); $form=new Form($db); -print_fiche_titre($langs->trans("Purge"),'','title_setup'); +print load_fiche_titre($langs->trans("Purge"),'','title_setup'); print $langs->trans("PurgeAreaDesc",$dolibarr_main_data_root).'
'; print '
'; diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index b391ffa0d2a..54a6cab9cbd 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -163,7 +163,7 @@ $dirins_ok=(dol_is_dir($dirins)); $wikihelp='EN:Installation_-_Upgrade|FR:Installation_-_Mise_à_jour|ES:Instalación_-_Actualización'; llxHeader('',$langs->trans("Upgrade"),$wikihelp); -print_fiche_titre($langs->trans("Upgrade"),'','title_setup'); +print load_fiche_titre($langs->trans("Upgrade"),'','title_setup'); print $langs->trans("CurrentVersion").' : '.DOL_VERSION.'
'; diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index cdea31fd7c4..0528d090c52 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -52,7 +52,7 @@ $action=GETPOST('action'); $wikihelp='EN:Setup|FR:Paramétrage|ES:Configuración'; llxHeader('',$langs->trans("Setup"),$wikihelp); -print_fiche_titre($langs->trans("TranslationSetup"),'','title_setup'); +print load_fiche_titre($langs->trans("TranslationSetup"),'','title_setup'); print $langs->trans("TranslationDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index fb7085a6ba8..de59c9136b2 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -42,7 +42,7 @@ llxHeader("",""); $form = new Form($db); -print_fiche_titre($langs->trans("TriggersAvailable"),'','title_setup'); +print load_fiche_titre($langs->trans("TriggersAvailable"),'','title_setup'); print $langs->trans("TriggersDesc")."
"; print "
\n"; diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index dc21790ec32..85ea8501107 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -95,7 +95,7 @@ $help_url='EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios'; llxHeader('',$langs->trans("UsersSetup"),$help_url); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("UsersSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("UsersSetup"),$linkback,'title_setup'); $head=user_admin_prepare_head(); diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 255fc0f6d9c..bdd84a50a7f 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -61,7 +61,7 @@ if (preg_match('/del(.*)/',$action,$reg)) llxHeader('',$langs->trans("WorkflowSetup"),''); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("WorkflowSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("WorkflowSetup"),$linkback,'title_setup'); print $langs->trans("WorkflowDesc").'
'; print "
"; diff --git a/htdocs/api/admin/api.php b/htdocs/api/admin/api.php index 740d3eb7e8d..4d3768070ef 100644 --- a/htdocs/api/admin/api.php +++ b/htdocs/api/admin/api.php @@ -59,7 +59,7 @@ if ($action == 'setproductionmode') llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("ApiSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ApiSetup"),$linkback,'title_setup'); print $langs->trans("ApiDesc")."
\n"; print "
\n"; diff --git a/htdocs/api/class/api_access.class.php b/htdocs/api/class/api_access.class.php index 027c9dcf5f4..3a130fe35d2 100644 --- a/htdocs/api/class/api_access.class.php +++ b/htdocs/api/class/api_access.class.php @@ -60,7 +60,8 @@ class DolibarrApiAccess implements iAuthenticate $userClass = Defaults::$userIdentifierClass; - if (isset($_GET['api_key'])) { + if (isset($_GET['api_key'])) + { $sql = "SELECT u.login, u.datec, u.api_key, "; $sql.= " u.tms as date_modification, u.entity"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; @@ -100,7 +101,9 @@ class DolibarrApiAccess implements iAuthenticate } else { - return false; + throw new RestException(401, "Failed to login to API. No parameter 'api_key' provided"); + //dol_syslog("Failed to login to API. No parameter key provided", LOG_DEBUG); + //return false; } $userClass::setCacheIdentifier(static::$role); diff --git a/htdocs/api/restler.php b/htdocs/api/restler.php new file mode 100644 index 00000000000..ae891386b31 --- /dev/null +++ b/htdocs/api/restler.php @@ -0,0 +1,8 @@ +trans("MassBarcodeInit")); -print_fiche_titre($langs->trans("MassBarcodeInit")); +print load_fiche_titre($langs->trans("MassBarcodeInit")); print '
'; print $langs->trans("MassBarcodeInitDesc").'
'; @@ -211,7 +211,7 @@ if ($conf->societe->enabled) { $nbno=$nbtotal=0; - print_fiche_titre($langs->trans("BarcodeInitForThirdparties"),'','object_company'); + print load_fiche_titre($langs->trans("BarcodeInitForThirdparties"),'','object_company'); print '
'."\n"; $sql="SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe where barcode IS NULL or barcode = ''"; $resql=$db->query($sql); @@ -252,7 +252,7 @@ if ($conf->product->enabled || $conf->product->service) $nbno=$nbtotal=0; - print_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'','object_product'); + print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'','object_product'); print '
'."\n"; $sql ="SELECT count(rowid) as nb, fk_product_type, datec"; diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 36d9117eefe..68673d9c83b 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -141,7 +141,7 @@ if ($action == 'builddoc') $result=@include_once $newdir.$generator.'.modules.php'; if ($result) break; } - + // Load barcode class for generating barcode image $classname = "mod".ucfirst($generator); $module = new $classname($db); @@ -196,7 +196,7 @@ if ($action == 'builddoc') // For labels if ($mode == 'label') { - + $txtforsticker="%PHOTO%"; // Photo will be barcode image, %BARCODE% posible when using TCPDF generator $textleft=make_substitutions((empty($conf->global->BARCODE_LABEL_LEFT_TEXT)?$txtforsticker:$conf->global->BARCODE_LABEL_LEFT_TEXT), $substitutionarray); $textheader=make_substitutions((empty($conf->global->BARCODE_LABEL_HEADER_TEXT)?'':$conf->global->BARCODE_LABEL_HEADER_TEXT), $substitutionarray); @@ -261,7 +261,7 @@ $form=new Form($db); llxHeader('',$langs->trans("BarCodePrintsheet")); -print_fiche_titre($langs->trans("BarCodePrintsheet")); +print load_fiche_titre($langs->trans("BarCodePrintsheet")); print '
'; print $langs->trans("PageToGenerateBarCodeSheets",$langs->transnoentitiesnoconv("BuildPageToPrint")).'
'; @@ -379,7 +379,7 @@ print ''; print ' '.$langs->trans("FillBarCodeTypeAndValueFromThirdParty").'   '; print '
'; print '
'; -print $form->select_company(GETPOST('socid'), 'socid', '', 1); +print $form->select_company(GETPOST('socid'), 'socid', '', 1, 0, 0, array(), 0, 'minwidth300'); print '   '; print '
'; diff --git a/htdocs/bookmarks/admin/bookmark.php b/htdocs/bookmarks/admin/bookmark.php index 51274716eda..05691a227b7 100644 --- a/htdocs/bookmarks/admin/bookmark.php +++ b/htdocs/bookmarks/admin/bookmark.php @@ -59,7 +59,7 @@ if ($action == 'setvalue') llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("BookmarkSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("BookmarkSetup"),$linkback,'title_setup'); print $langs->trans("BookmarkDesc")."
\n"; diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index a821cf8e94f..33a0f383fde 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -149,7 +149,7 @@ if ($action == 'create') print ''; print ''; - print_fiche_titre($langs->trans("NewBookmark")); + print load_fiche_titre($langs->trans("NewBookmark")); dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark'); @@ -165,7 +165,7 @@ if ($action == 'create') print ''.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").''; print ''.$langs->trans("Owner").''; - $form->select_users(isset($_POST['userid'])?$_POST['userid']:$user->id,'userid',1); + $form->select_dolusers(isset($_POST['userid'])?$_POST['userid']:$user->id,'userid',1); print ' '; // Position @@ -262,7 +262,7 @@ if ($id > 0 && ! preg_match('/^add/i',$action)) print ''.$langs->trans("Owner").''; if ($action == 'edit' && $user->admin) { - $form->select_users(isset($_POST['userid'])?$_POST['userid']:($bookmark->fk_user?$bookmark->fk_user:''),'userid',1); + $form->select_dolusers(isset($_POST['userid'])?$_POST['userid']:($bookmark->fk_user?$bookmark->fk_user:''),'userid',1); } else { diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 7512785d78b..c54111239b9 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -72,7 +72,7 @@ $userstatic=new User($db); llxHeader(); -print_fiche_titre($langs->trans("Bookmarks")); +print load_fiche_titre($langs->trans("Bookmarks")); $sql = "SELECT b.fk_soc as rowid, b.dateb, b.rowid as bid, b.fk_user, b.url, b.target, b.title, b.favicon, b.position,"; $sql.= " u.login, u.lastname, u.firstname"; diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php index 48804958b20..74560e8ff6a 100644 --- a/htdocs/cashdesk/admin/cashdesk.php +++ b/htdocs/cashdesk/admin/cashdesk.php @@ -85,7 +85,7 @@ $formproduct=new FormProduct($db); llxHeader('',$langs->trans("CashDeskSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("CashDeskSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("CashDeskSetup"),$linkback,'title_setup'); print '
'; diff --git a/htdocs/cashdesk/affContenu.php b/htdocs/cashdesk/affContenu.php index 6d8f5ca83ee..3f27d19c7f3 100644 --- a/htdocs/cashdesk/affContenu.php +++ b/htdocs/cashdesk/affContenu.php @@ -56,6 +56,7 @@ exit;*/ // Left area with selected articles (area for article, amount and payments) +print '
'; print '
'; $page=GETPOST('menu','alpha'); @@ -78,16 +79,17 @@ else } print '
'; - +print '
'; // Right area with selected articles (shopping cart) +print '
'; print '
'; require ('tpl/liste_articles.tpl.php'); print '
'; - +print '
'; $_SESSION['serObjFacturation'] = serialize($obj_facturation); diff --git a/htdocs/cashdesk/css/style.css b/htdocs/cashdesk/css/style.css index f62a9193830..d639230564b 100644 --- a/htdocs/cashdesk/css/style.css +++ b/htdocs/cashdesk/css/style.css @@ -15,7 +15,7 @@ */ body { - background: #eee; + background: #fff; color: #333; margin: 0; padding: 0; @@ -30,9 +30,9 @@ p { .conteneur { background: #fff; text-align: left; - max-width: 770px; - margin: 10px auto; - border: 2px solid #000; + /*max-width: 770px;*/ + /*margin: 10px auto; + border: 2px solid #000;*/ } .conteneur_img_gauche { @@ -43,6 +43,11 @@ p { /* background: url("../img/bg_conteneur_droite.png") top right repeat-y; */ } +.contenu { + width: 100%; + text-align: center; +} + /* ------------------- Header ------------------- */ .entete { height: 15px; @@ -138,6 +143,7 @@ li.menu_choix0 { margin-right: 20px; border: 1px dotted #5ca64d; padding-bottom: 10px; + vertical-align: middle; } p.titre { @@ -192,8 +198,10 @@ p.titre { /* ------------------- Contenu ------------------- */ .principal_login { - margin: 30px; + margin: 10px; padding: 0; + max-width: 800px; + text-align: left; } .formulaire_login { @@ -221,8 +229,7 @@ p.titre { float: left; margin: 0 15px; padding: 0; - max-width: 500px; - width: 100%; + max-width: 900px; } .titre1 { diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index fa1c6723d20..44d096ab478 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -60,10 +60,11 @@ top_htmlhead('','',0,0,'',$arrayofcss);

-'; + ?> + diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php index 23ebc01f3e2..37ed08703f8 100644 --- a/htdocs/categories/admin/categorie.php +++ b/htdocs/categories/admin/categorie.php @@ -77,7 +77,7 @@ $linkback=''.$langs->trans("BackToM llxHeader('',$langs->trans("Categories"),$help_url); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("CategoriesSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("CategoriesSetup"),$linkback,'title_setup'); $head=categoriesadmin_prepare_head(); diff --git a/htdocs/categories/admin/categorie_extrafields.php b/htdocs/categories/admin/categorie_extrafields.php index df31e07d95b..87e907c696e 100644 --- a/htdocs/categories/admin/categorie_extrafields.php +++ b/htdocs/categories/admin/categorie_extrafields.php @@ -64,7 +64,7 @@ llxHeader('',$langs->trans("Categories"),$help_url); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("CategoriesSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("CategoriesSetup"),$linkback,'title_setup'); $head = categoriesadmin_prepare_head(); @@ -93,7 +93,7 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print "
"; - print_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } @@ -106,7 +106,7 @@ if ($action == 'create') if ($action == 'edit' && ! empty($attrname)) { print "
"; - print_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 814badf95a7..5bd73202f15 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -29,6 +29,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->load("categories"); @@ -46,6 +47,7 @@ $urlfrom = GETPOST('urlfrom','alpha'); $socid=GETPOST('socid','int'); $label=GETPOST('label'); $description=GETPOST('description'); +$color=GETPOST('color'); $visible=GETPOST('visible'); $parent=GETPOST('parent'); @@ -124,6 +126,7 @@ if ($action == 'add' && $user->rights->categorie->creer) $object->label = $label; + $object->color = $color; $object->description = dol_htmlcleanlastbr($description); $object->socid = ($socid ? $socid : 'null'); $object->visible = $visible; @@ -210,6 +213,7 @@ if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->cr */ $form = new Form($db); +$formother = new FormOther($db); llxHeader("","",$langs->trans("Categories")); @@ -232,7 +236,7 @@ if ($user->rights->categorie->creer) if ($origin) print ''; if ($catorigin) print ''; - print_fiche_titre($langs->trans("CreateCat")); + print load_fiche_titre($langs->trans("CreateCat")); dol_fiche_head(''); @@ -250,6 +254,11 @@ if ($user->rights->categorie->creer) $doleditor->Create(); print ''; + // Color + print ''.$langs->trans("Color").''; + print $formother->selectColor($color,'color'); + print ''; + // Parent category print ''.$langs->trans("AddIn").''; print $form->select_all_categories($type, $catorigin); diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 083edbf6b7e..b573d02bf16 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -419,7 +419,7 @@ else if ($id || $ref) // Ref print ''.$langs->trans("Ref").''; print ''; - print $form->showrefnav($member,'id'); + print $form->showrefnav($member,'id','','1','rowid','ref','','&type=3'); print ''; // Login @@ -641,7 +641,7 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1) } print '
'; - print_fiche_titre($title,$linktocreate,''); + print load_fiche_titre($title,$linktocreate,''); // Form to add record into a category if ($showclassifyform) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 190f58d9388..bcb53f8a0f5 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -112,10 +112,16 @@ class Categorie extends CommonObject public $element='category'; public $table_element='categories'; - var $id; var $fk_parent; var $label; var $description; + /** + * @var string Color + */ + var $color; + /** + * @var ??? + */ var $socid; /** * @var int Category type @@ -127,7 +133,6 @@ class Categorie extends CommonObject * @see Categorie::TYPE_CONTACT */ var $type; - var $import_key; var $cats=array(); // Tableau en memoire des categories var $motherof=array(); @@ -156,7 +161,7 @@ class Categorie extends CommonObject // Check parameters if (empty($id) && empty($label)) return -1; - $sql = "SELECT rowid, fk_parent, entity, label, description, fk_soc, visible, type"; + $sql = "SELECT rowid, fk_parent, entity, label, description, color, fk_soc, visible, type"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie"; if ($id) { @@ -180,6 +185,7 @@ class Categorie extends CommonObject $this->fk_parent = $res['fk_parent']; $this->label = $res['label']; $this->description = $res['description']; + $this->color = $res['color']; $this->socid = $res['fk_soc']; $this->visible = $res['visible']; $this->type = $res['type']; @@ -225,6 +231,7 @@ class Categorie extends CommonObject // Clean parameters $this->label = trim($this->label); $this->description = trim($this->description); + $this->color = trim($this->color); $this->import_key = trim($this->import_key); if (empty($this->visible)) $this->visible=0; $this->fk_parent = ($this->fk_parent != "" ? intval($this->fk_parent) : 0); @@ -244,6 +251,7 @@ class Categorie extends CommonObject $sql.= "fk_parent,"; $sql.= " label,"; $sql.= " description,"; + $sql.= " color,"; if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) { $sql.= "fk_soc,"; @@ -256,6 +264,7 @@ class Categorie extends CommonObject $sql.= $this->fk_parent.","; $sql.= "'".$this->db->escape($this->label)."',"; $sql.= "'".$this->db->escape($this->description)."',"; + $sql.= "'".$this->db->escape($this->color)."',"; if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) { $sql.= ($this->socid != -1 ? $this->socid : 'null').","; @@ -357,7 +366,8 @@ class Categorie extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."categorie"; $sql.= " SET label = '".$this->db->escape($this->label)."',"; - $sql.= " description = '".$this->db->escape($this->description)."'"; + $sql.= " description = '".$this->db->escape($this->description)."',"; + $sql.= " color = '".$this->db->escape($this->color)."'"; if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) { $sql .= ", fk_soc = ".($this->socid != -1 ? $this->socid : 'null'); @@ -562,14 +572,15 @@ class Categorie extends CommonObject if ($this->id == -1) return -2; // For backward compatibility - if ($type == 'societe') { + if ($type == 'societe') + { $type = 'customer'; - dol_syslog( get_class( $this ) . "::add_type(): type 'societe' is deprecated, please use 'customer' instead", - LOG_WARNING ); - } elseif ($type == 'fournisseur') { + dol_syslog(get_class($this) . "::add_type(): type 'societe' is deprecated, please use 'customer' instead", LOG_WARNING); + } + elseif ($type == 'fournisseur') + { $type = 'supplier'; - dol_syslog( get_class( $this ) . "::add_type(): type 'fournisseur' is deprecated, please use 'supplier' instead", - LOG_WARNING ); + dol_syslog(get_class($this) . "::add_type(): type 'fournisseur' is deprecated, please use 'supplier' instead", LOG_WARNING); } $this->db->begin(); @@ -850,8 +861,8 @@ class Categorie extends CommonObject * fulllabel = nom avec chemin complet de la categorie * fullpath = chemin complet compose des id * - * @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member'). Old - * mode (0, 1, 2, ...) is deprecated. + * @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member'). + * Old mode (0, 1, 2, ...) is deprecated. * @param int $markafterid Removed all categories including the leaf $markafterid in category tree. * * @return array Array of categories. this->cats and this->motherof are set. @@ -861,12 +872,12 @@ class Categorie extends CommonObject global $conf, $langs; // For backward compatibility - if (is_numeric( $type )) { + if (is_numeric($type)) + { // We want to reverse lookup - $map_type = array_flip( $this->MAP_ID ); + $map_type = array_flip($this->MAP_ID); $type = $map_type[$type]; - dol_syslog( get_class( $this ) . "::get_full_arbo(): numeric types are deprecated, please use string instead", - LOG_WARNING ); + dol_syslog( get_class( $this ) . "::get_full_arbo(): numeric types are deprecated, please use string instead", LOG_WARNING); } $this->cats = array(); @@ -876,7 +887,7 @@ class Categorie extends CommonObject $current_lang = $langs->getDefaultLang(); // Init $this->cats array - $sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.fk_parent"; // Distinct reduce pb with old tables with duplicates + $sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.color, c.fk_parent"; // Distinct reduce pb with old tables with duplicates if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= ", t.label as label_trans, t.description as description_trans"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie as c"; if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'"; @@ -895,6 +906,7 @@ class Categorie extends CommonObject $this->cats[$obj->rowid]['fk_parent'] = $obj->fk_parent; $this->cats[$obj->rowid]['label'] = ! empty($obj->label_trans) ? $obj->label_trans : $obj->label; $this->cats[$obj->rowid]['description'] = ! empty($obj->description_trans) ? $obj->description_trans : $obj->description; + $this->cats[$obj->rowid]['color'] = $obj->color; $i++; } } diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index a10823e6098..836970e7a3c 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -27,6 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->load("categories"); @@ -39,6 +40,7 @@ $confirm=GETPOST('confirm'); $socid=GETPOST('socid','int'); $label=GETPOST('label'); $description=GETPOST('description'); +$color=GETPOST('color','alpha'); $visible=GETPOST('visible'); $parent=GETPOST('parent'); @@ -71,6 +73,7 @@ if ($action == 'update' && $user->rights->categorie->creer) $categorie->label = $label; $categorie->description = dol_htmlcleanlastbr($description); + $categorie->color = $color; $categorie->socid = ($socid ? $socid : 'null'); $categorie->visible = $visible; @@ -82,20 +85,16 @@ if ($action == 'update' && $user->rights->categorie->creer) if (empty($categorie->label)) { - $action = 'create'; + $error++; + $action = 'edit'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors'); } - if (empty($categorie->description)) - { - $action = 'create'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Description")), 'errors'); - } - if (empty($categorie->error)) + if (! $error && empty($categorie->error)) { $ret = $extrafields->setOptionalsFromPost($extralabels,$categorie); if ($ret < 0) $error++; - if ($categorie->update($user) > 0) + if (! $error && $categorie->update($user) > 0) { header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$categorie->id.'&type='.$type); exit; @@ -117,17 +116,15 @@ if ($action == 'update' && $user->rights->categorie->creer) * View */ +$form = new Form($db); +$formother = new FormOther($db); + llxHeader("","",$langs->trans("Categories")); -print_fiche_titre($langs->trans("ModifCat")); +print load_fiche_titre($langs->trans("ModifCat")); $object->fetch($id); -$form = new Form($db); - -print ''; - -print '
'; print "\n"; print '
'; @@ -136,23 +133,32 @@ print ''; print ''; print ''; +dol_fiche_head(''); + print ''; // Ref -print ''; print ''; // Description print ''; -print ''; +print ''; print ''; +// Color +print ''; +print ''; +print ''; + // Parent category print '
'; +print '
'; print $langs->trans("Ref").''; print '
'.$langs->trans("Description").''.$langs->trans("Description").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('description',$object->description,'',200,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,ROWS_6,50); $doleditor->Create(); print '
'.$langs->trans("Color").''; +print $formother->selectColor($object->color, 'color'); +print '
'.$langs->trans("In").''; print $form->select_all_categories($type,$object->fk_parent,'parent',64,$object->id); @@ -165,13 +171,15 @@ if (empty($reshook) && ! empty($extrafields->attribute_label)) } print '
'; -print '
'; + + +dol_fiche_end(); + print '
'; print '
'; -print '
'; llxFooter(); diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index fcfa8f9b910..ff585212dff 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -61,7 +61,7 @@ $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css') llxHeader('',$title,'','',0,0,$arrayofjs,$arrayofcss); -print_fiche_titre($title); +print load_fiche_titre($title); //print ''; //print ''; + print ''; print ''; } else { print ''; } print '' . "\n"; @@ -1485,11 +1412,7 @@ if ($action == 'create') print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; + print ''; + print ''; print ''; print ''; - $parameters=array(); + // Extrafields + if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) + { + foreach($extrafields->attribute_list as $key => $val) + { + if ($val) + { + $crit=$search_array_options['search_options_'.$key]; + print ''; + } + } + } + // Hook fields + $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -449,6 +528,16 @@ if ($resql) print ""; print ""; print ''; + //Country + print ''; + //Type ent + print ''; // Creation date print ''; // Level @@ -460,7 +549,7 @@ if ($resql) print $prospectstatic->LibProspCommStatut($obj->stcomm_id,2,$prospectstatic->cacheprospectstatus[$obj->stcomm_id]['label']); print ""; - print ''; + // Extrafields + if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) + { + foreach($extrafields->attribute_list as $key => $val) + { + if ($val) + { + print ''; + } + } + } + // Hook fields $parameters=array('obj' => $obj); $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index b2d92dd55dc..ea9e1382d40 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2015 Laurent Destailleur * * 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 @@ -99,6 +99,13 @@ if ($socid > 0) $head = societe_prepare_head($objsoc); + + + print '
'; + print ''; + print ''; + print ''; + dol_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"),0,'company'); @@ -117,12 +124,7 @@ if ($socid > 0) print '
'; @@ -148,12 +148,13 @@ foreach($fulltree as $key => $val) $categstatic->ref=$val['label']; $categstatic->type=$type; $li=$categstatic->getNomUrl(1,'',60); + $desc=dol_htmlcleanlastbr($val['description']); $data[] = array( 'rowid'=>$val['rowid'], 'fk_menu'=>$val['fk_parent'], 'entry'=>''. + ''. ''. '
'.$li. - ''.dolGetFirstLineOfText($val['description']).''.dolGetFirstLineOfText($desc).''.img_view().'
' ); @@ -178,7 +179,7 @@ if ($nbofentries > 0) } else { - print '
'; print ''; // Description -print ''; +// Color +print ''; + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 623ebcbf1bc..1e4b969644c 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -243,6 +243,8 @@ if ($action == 'add') $object->percentage = $percentage; $object->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) * 60; + $transparency=(GETPOST("transparency")=='on'?1:0); + $listofuserid=array(); if (! empty($_SESSION['assignedtouser'])) $listofuserid=json_decode($_SESSION['assignedtouser'], true); $i=0; @@ -251,10 +253,10 @@ if ($action == 'add') if ($i == 0) // First entry { if ($value['id'] > 0) $object->userownerid=$value['id']; - $object->transparency = (GETPOST("transparency")=='on'?1:0); + $object->transparency = $transparency; } - $object->userassigned[$value['id']]=array('id'=>$value['id'], 'transparency'=>(GETPOST("transparency")=='on'?1:0)); + $object->userassigned[$value['id']]=array('id'=>$value['id'], 'transparency'=>$transparency); $i++; } @@ -405,7 +407,7 @@ if ($action == 'update') if (! $datef && $percentage == 100) { $error++; $donotclearsession=1; - setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),$object->errors,'errors'); + setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),$object->errors,'errors'); $action = 'edit'; } @@ -436,6 +438,8 @@ if ($action == 'update') $i++; } + $object->transparency = $transparency; // We set transparency on event (even if we can also store it on each user, standard says this property is for event) + if (! empty($conf->global->AGENDA_ENABLE_DONEBY)) { if (GETPOST("doneby")) $object->userdoneid=GETPOST("doneby","int"); @@ -632,8 +636,8 @@ if ($action == 'create') if ($backtopage) print ''; if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) print ''; - if (GETPOST("actioncode") == 'AC_RDV') print_fiche_titre($langs->trans("AddActionRendezVous")); - else print_fiche_titre($langs->trans("AddAnAction")); + if (GETPOST("actioncode") == 'AC_RDV') print load_fiche_titre($langs->trans("AddActionRendezVous")); + else print load_fiche_titre($langs->trans("AddAnAction")); dol_fiche_head(); @@ -780,6 +784,8 @@ if ($action == 'create') print ''; print ''; print ''; + print ''; + print ''; } if (GETPOST("datep") && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/',GETPOST("datep"),$reg)) @@ -967,7 +973,7 @@ if ($id > 0) else if (jQuery("#recurrulefreq").val() == \'WEEKLY\') { jQuery(".repeateventBYMONTHDAY").hide(); - jQuery(".repeateventBYDAY").show(); + jQuery(".repeateventBYDAY").show(); } else { @@ -980,7 +986,7 @@ if ($id > 0) init_repeat(); }); }); - '; + '; print ''; } @@ -1021,7 +1027,7 @@ if ($id > 0) } } print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0'); - if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': id]['transparency']?' checked':'').'">'.$langs->trans("Busy"); + if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': id]['transparency']?' checked':'').'>'.$langs->trans("Busy"); print ''; // Realised by diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index ec2a6c4a182..2b347036a58 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -107,11 +107,10 @@ class ActionComm extends CommonObject var $transparency; // Transparency (ical standard). Used to say if people assigned to event are busy or not by event. 0=available, 1=busy, 2=busy (refused events) var $priority; // Small int (0 By default) - var $note; // Description var $userassigned = array(); // Array of user ids - var $userownerid; // Id of user owner - var $userdoneid; // Id of user done + var $userownerid; // Id of user owner = fk_user_action into table + var $userdoneid; // Id of user done (deprecated) /** * Object user of owner @@ -148,12 +147,6 @@ class ActionComm extends CommonObject */ var $contact; - /** - * Id of project (optional) - * @var int - */ - var $fk_project; - // Properties for links to other objects var $fk_element; // Id of record var $elementtype; // Type of record. This if property ->element of object linked to. @@ -409,8 +402,8 @@ class ActionComm extends CommonObject $this->db->begin(); - // Load source object - $objFrom = dol_clone($this); + // Load source object + $objFrom = clone $this; $this->fetch_optionals(); $this->fetch_userassigned(); @@ -456,11 +449,12 @@ class ActionComm extends CommonObject /** * Load object from database * - * @param int $id Id of action to get - * @param string $ref Ref of action to get - * @return int <0 if KO, >0 if OK + * @param int $id Id of action to get + * @param string $ref Ref of action to get + * @param string $ref_ext Ref ext to get + * @return int <0 if KO, >0 if OK */ - function fetch($id, $ref='') + function fetch($id, $ref='',$ref_ext='') { global $langs; @@ -484,11 +478,12 @@ class ActionComm extends CommonObject $sql.= " s.nom as socname,"; $sql.= " u.firstname, u.lastname as lastname"; $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a "; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action=c.id "; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action=c.id "; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc"; $sql.= " WHERE "; - if ($ref) $sql.= " a.id=".$ref; // No field ref, we use id + if ($ref) $sql.= " a.id=".$ref; // No field ref, we use id + elseif ($ref_ext) $sql.= " a.ref_ext='".$this->db->escape($ref_ext)."'"; else $sql.= " a.id=".$id; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); @@ -880,7 +875,7 @@ class ActionComm extends CommonObject $resql=$this->db->query($sql); if ($resql) { - $now = dol_now(); + $agenda_static = new ActionComm($this->db); $response = new WorkboardResponse(); $response->warning_delay = $conf->actions->warning_delay/60/60/24; @@ -893,7 +888,9 @@ class ActionComm extends CommonObject { $response->nbtodo++; - if (isset($obj->dp) && $this->db->jdate($obj->dp) < ($now - $conf->actions->warning_delay)) { + $agenda_static->datep = $this->db->jdate($obj->dp); + + if ($agenda_static->hasDelay()) { $response->nbtodolate++; } } @@ -1039,9 +1036,9 @@ class ActionComm extends CommonObject * Use $this->id, $this->type_code, $this->label and $this->type_label * * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto - * @param int $maxlength Nombre de caracteres max dans libelle + * @param int $maxlength Max number of charaters into label. If negative, use the ref as label. * @param string $classname Force style class on a link - * @param string $option ''=Link to action,'birthday'=Link to contact + * @param string $option ''=Link to action, 'birthday'=Link to contact * @param int $overwritepicto 1=Overwrite picto * @return string Chaine avec URL */ @@ -1073,7 +1070,8 @@ class ActionComm extends CommonObject { $libelle=(empty($this->libelle)?$label:$this->libelle.(($label && $label != $this->libelle)?' '.$label:'')); if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($libelle)) $libelle=($langs->transnoentities("Action".$this->type_code) != "Action".$this->type_code)?$langs->transnoentities("Action".$this->type_code):$this->type_label; - $libelleshort=dol_trunc($libelle,$maxlength); + if ($maxlength < 0) $libelleshort=$this->ref; + else $libelleshort=dol_trunc($libelle,$maxlength); } if ($withpicto) @@ -1358,5 +1356,19 @@ class ActionComm extends CommonObject return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); } + /** + * Is the action delayed? + * + * @return bool + */ + public function hasDelay() + { + global $conf; + + $now = dol_now(); + + return $this->datep && ($this->datep < ($now - $conf->actions->warning_delay)); + } + } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index c414d3409d6..6b3384b92dd 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -179,12 +179,13 @@ if (empty($conf->global->AGENDA_DISABLE_EXT)) $i++; $source='AGENDA_EXT_SRC'.$i; $name='AGENDA_EXT_NAME'.$i; + $offsettz='AGENDA_EXT_OFFSETTZ'.$i; $color='AGENDA_EXT_COLOR'.$i; $buggedfile='AGENDA_EXT_BUGGEDFILE'.$i; if (! empty($conf->global->$source) && ! empty($conf->global->$name)) { // Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight' - $listofextcals[]=array('src'=>$conf->global->$source,'name'=>$conf->global->$name,'color'=>$conf->global->$color,'buggedfile'=>(isset($conf->global->buggedfile)?$conf->global->buggedfile:0)); + $listofextcals[]=array('src'=>$conf->global->$source,'name'=>$conf->global->$name,'offsettz'=>$conf->global->$offsettz,'color'=>$conf->global->$color,'buggedfile'=>(isset($conf->global->buggedfile)?$conf->global->buggedfile:0)); } } } @@ -197,13 +198,14 @@ if (empty($user->conf->AGENDA_DISABLE_EXT)) $i++; $source='AGENDA_EXT_SRC_'.$user->id.'_'.$i; $name='AGENDA_EXT_NAME_'.$user->id.'_'.$i; + $offsettz='AGENDA_EXT_OFFSETTZ_'.$user->id.'_'.$i; $color='AGENDA_EXT_COLOR_'.$user->id.'_'.$i; $enabled='AGENDA_EXT_ENABLED_'.$user->id.'_'.$i; $buggedfile='AGENDA_EXT_BUGGEDFILE_'.$user->id.'_'.$i; if (! empty($user->conf->$source) && ! empty($user->conf->$name)) { // Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight' - $listofextcals[]=array('src'=>$user->conf->$source,'name'=>$user->conf->$name,'color'=>$user->conf->$color,'buggedfile'=>(isset($user->conf->buggedfile)?$user->conf->buggedfile:0)); + $listofextcals[]=array('src'=>$user->conf->$source,'name'=>$user->conf->$name,'offsettz'=>$user->conf->$offsettz,'color'=>$user->conf->$color,'buggedfile'=>(isset($user->conf->buggedfile)?$user->conf->buggedfile:0)); } } } @@ -412,7 +414,7 @@ else // If javascript off $link.=''; } -print_fiche_titre($s, $link.'     '.$nav, ''); +print load_fiche_titre($s, $link.'     '.$nav, ''); // Load events from database into $eventarray @@ -507,8 +509,12 @@ if ($resql) // Create a new object action $event=new ActionComm($db); $event->id=$obj->id; - $event->datep=$db->jdate($obj->datep); // datep and datef are GMT date + + $event->datep=$db->jdate($obj->datep); // datep and datef are GMT date. Example: 1970-01-01 01:00:00, jdate will return 0 if TZ of PHP server is Europe/Berlin $event->datef=$db->jdate($obj->datep2); + //var_dump($obj->datep); + //var_dump($event->datep); + $event->type_code=$obj->type_code; $event->type_label=$obj->type_label; $event->libelle=$obj->label; @@ -664,6 +670,7 @@ if (count($listofextcals)) { $url=$extcal['src']; // Example: https://www.google.com/calendar/ical/eldy10%40gmail.com/private-cde92aa7d7e0ef6110010a821a2aaeb/basic.ics $namecal = $extcal['name']; + $offsettz = $extcal['offsettz']; $colorcal = $extcal['color']; $buggedfile = $extcal['buggedfile']; //print "url=".$url." namecal=".$namecal." colorcal=".$colorcal." buggedfile=".$buggedfile; @@ -805,12 +812,22 @@ if (count($listofextcals)) { $datestart=$icalevent['DTSTART']; $dateend=$icalevent['DTEND']; + + $datestart+=+($offsettz * 3600); + $dateend+=+($offsettz * 3600); + $addevent=true; + //var_dump($offsettz); + //var_dump(dol_print_date($datestart, 'dayhour', 'gmt')); } elseif (isset($icalevent['DTSTART']['unixtime'])) // File contains a local timezone + a TZ (for example when using bluemind) { $datestart=$icalevent['DTSTART']['unixtime']; $dateend=$icalevent['DTEND']['unixtime']; + + $datestart+=+($offsettz * 3600); + $dateend+=+($offsettz * 3600); + // $buggedfile is set to uselocalandtznodaylight if conf->global->AGENDA_EXT_BUGGEDFILEx = 'uselocalandtznodaylight' if ($buggedfile === 'uselocalandtznodaylight') // unixtime is a local date that does not take daylight into account, TZID is +1 for example for 'Europe/Paris' in summer instead of 2 { @@ -1308,7 +1325,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa // Hour start if ($tmpyearstart == $annee && $tmpmonthstart == $mois && $tmpdaystart == $jour) { - $daterange.=dol_print_date($event->date_start_in_calendar,'%H:%M'); + $daterange.=dol_print_date($event->date_start_in_calendar,'%H:%M'); // Il faudrait utiliser ici tzuser, mais si on ne peut pas car qd on rentre un date dans fiche action, en input la conversion local->gmt se base sur le TZ server et non user if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) { if ($tmpyearstart == $tmpyearend && $tmpmonthstart == $tmpmonthend && $tmpdaystart == $tmpdayend) @@ -1328,7 +1345,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) { if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour) - $daterange.=dol_print_date($event->date_end_in_calendar,'%H:%M'); + $daterange.=dol_print_date($event->date_end_in_calendar,'%H:%M'); // Il faudrait utiliser ici tzuser, mais si on ne peut pas car qd on rentre un date dans fiche action, en input la conversion local->gmt se base sur le TZ server et non user } //print $daterange; if ($event->type_code != 'ICALEVENT') diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index ee16bdd0711..509a9c90d77 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -254,8 +254,22 @@ if ($resql) } */ - print_barre_liste($newtitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $link, $num, 0, '', 0, $nav); - //print '
'; + $s=$newtitle; + + // Calendars from hooks + $parameters=array(); $object=null; + $reshook=$hookmanager->executeHooks('addCalendarChoice',$parameters,$object,$action); + if (empty($reshook)) + { + $s.= $hookmanager->resPrint; + } + elseif ($reshook > 1) + { + $s = $hookmanager->resPrint; + } + + print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $link, $num, 0, '', 0, $nav); + print ''."\n"; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 1563174c3a2..41270d7996e 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -317,14 +317,27 @@ if ($conf->use_javascript_ajax) $s.='
' . $val ['name'] . '  
'; } } + + //$s.='
'.$langs->trans("AgendaShowBirthdayEvents").'  
'; + + // Calendars from hooks + $parameters=array(); $object=null; + $reshook=$hookmanager->executeHooks('addCalendarChoice',$parameters,$object,$action); + if (empty($reshook)) + { + $s.= $hookmanager->resPrint; + } + elseif ($reshook > 1) + { + $s = $hookmanager->resPrint; + } } - //$s.='
'.$langs->trans("AgendaShowBirthdayEvents").'  
'; } $link=''; -print_fiche_titre($s,$link.'     '.$nav, ''); +print load_fiche_titre($s, $link.'     '.$nav, ''); // Get event in an array @@ -681,7 +694,7 @@ foreach ($usernames as $username) { $var = ! $var; echo ""; - echo ''; + echo ''; $tmpday = $sav; // Lopp on each day of week @@ -788,7 +801,7 @@ $db->close(); /** - * Show event of a particular day for a user + * Show event line of a particular day for a user * * @param string $username Login * @param int $day Day @@ -840,6 +853,8 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & // Scan all event for this date foreach ($eventarray[$daykey] as $index => $event) { + //var_dump($event); + $keysofuserassigned=array_keys($event->userassigned); if (! in_array($username->id,$keysofuserassigned)) continue; // We discard record if event is from another user than user we want to show //if ($username->id != $event->userownerid) continue; // We discard record if event is from another user than user we want to show @@ -1008,30 +1023,37 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & } } - - if ($h == $begin_h) echo ''; + print ''; + + print ''; + print ''; @@ -270,6 +298,16 @@ if ($result) print ''; print ''; print ''; + //Country + print ''; + //Type ent + print ''; print ''; print ''; print ''; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index b7d4f909fa7..fde56efb25e 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -673,7 +673,7 @@ if ($action == 'create') print ''; print ''; - print_fiche_titre($langs->trans("NewMailing")); + print load_fiche_titre($langs->trans("NewMailing")); dol_fiche_head(); @@ -958,7 +958,7 @@ else // Affichage formulaire de TEST if ($action == 'test') { - print_titre($langs->trans("TestMailing")); + print load_fiche_titre($langs->trans("TestMailing")); // Create l'objet formulaire mail include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; @@ -991,7 +991,7 @@ else } // Print mail content - print_fiche_titre($langs->trans("EMail"),'',''); + print load_fiche_titre($langs->trans("EMail"),'',''); dol_fiche_head(''); @@ -1102,7 +1102,7 @@ else print ''; // Print mail content - print_fiche_titre($langs->trans("EMail"),'',''); + print load_fiche_titre($langs->trans("EMail"),'',''); print '
'.img_picto_common('','treemenu/branchbottom.gif').''; print $langs->trans("NoCategoryYet"); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 87d6dc57d63..bf86c1d496c 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -29,6 +29,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/categories.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->load("categories"); @@ -159,6 +160,7 @@ if ($type == Categorie::TYPE_PRODUCT && $elemid && $action == 'addintocategory' */ $form = new Form($db); +$formother = new FormOther($db); llxHeader("","",$langs->trans("Categories")); @@ -197,11 +199,17 @@ foreach ($ways as $way) print '
'; +print '
'; print $langs->trans("Description").''; print dol_htmlentitiesbr($object->description); print '
'; +print $langs->trans("Color").''; +print $formother->showColor($object->color); +print '
'.dolGetElementUrl($originid,$origin,1).'
' . $username->getNomUrl(1). '' . $username->getNomUrl(1). ''; - else echo ''; - if (count($cases1[$h]) == 1) // 1 seul evenement - { - $ids=array_keys($cases1[$h]); - $output = array_slice($cases1[$h], 0, 1); - if ($output[0]['string']) $title1.=($title1?' - ':'').$output[0]['string']; - if ($output[0]['color']) $color1 = $output[0]['color']; - } - else if (count($cases1[$h]) > 1) $color1='222222'; - - if (count($cases2[$h]) == 1) // 1 seul evenement - { - $ids=array_keys($cases2[$h]); - $output = array_slice($cases2[$h], 0, 1); - if ($output[0]['string']) $title2.=($title2?' - ':'').$output[0]['string']; - if ($output[0]['color']) $color2 = $output[0]['color']; - } - else if (count($cases2[$h]) > 1) $color2='222222'; $ids1='';$ids2=''; if (count($cases1[$h]) && array_keys($cases1[$h])) $ids1=join(',',array_keys($cases1[$h])); if (count($cases2[$h]) && array_keys($cases2[$h])) $ids2=join(',',array_keys($cases2[$h])); - //var_dump($cases1[$h]); + + if ($h == $begin_h) echo ''; + else echo ''; + if (count($cases1[$h]) == 1) // only 1 event + { + $output = array_slice($cases1[$h], 0, 1); + $title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:''); + if ($output[0]['string']) $title1.=($title1?' - ':'').$output[0]['string']; + if ($output[0]['color']) $color1 = $output[0]['color']; + } + else if (count($cases1[$h]) > 1) + { + $title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:''); + $color1='222222'; + } + + if (count($cases2[$h]) == 1) // only 1 event + { + $output = array_slice($cases2[$h], 0, 1); + $title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:''); + if ($output[0]['string']) $title2.=($title2?' - ':'').$output[0]['string']; + if ($output[0]['color']) $color2 = $output[0]['color']; + } + else if (count($cases2[$h]) > 1) + { + $title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:''); + $color2='222222'; + } print ''; print '
'; print $string1; diff --git a/htdocs/comm/address.php b/htdocs/comm/address.php index 963847aee18..eb3c51b1760 100644 --- a/htdocs/comm/address.php +++ b/htdocs/comm/address.php @@ -211,7 +211,7 @@ if ($action == 'create') $object->country = $tmparray['label']; } - print_fiche_titre($langs->trans("AddAddress")); + print load_fiche_titre($langs->trans("AddAddress")); print "
\n"; @@ -306,7 +306,7 @@ elseif ($action == 'edit') dol_fiche_head($head, 'card', $societe->name); - print_titre($langs->trans("EditAddress")); + print load_fiche_titre($langs->trans("EditAddress")); print "
\n"; if ($socid) diff --git a/htdocs/comm/admin/askpricesupplier_extrafields.php b/htdocs/comm/admin/askpricesupplier_extrafields.php index 4342549c46a..0fb0554203f 100644 --- a/htdocs/comm/admin/askpricesupplier_extrafields.php +++ b/htdocs/comm/admin/askpricesupplier_extrafields.php @@ -60,7 +60,7 @@ llxHeader('',$langs->trans("AskPriceSupplierSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("AskPriceSupplierSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("AskPriceSupplierSetup"),$linkback,'title_setup'); $head = askpricesupplier_admin_prepare_head(); @@ -128,7 +128,7 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print "
"; - print_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } @@ -141,7 +141,7 @@ if ($action == 'create') if ($action == 'edit' && ! empty($attrname)) { print "
"; - print_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } diff --git a/htdocs/comm/admin/askpricesupplierdet_extrafields.php b/htdocs/comm/admin/askpricesupplierdet_extrafields.php index e419b6a3168..09c215d1f3d 100644 --- a/htdocs/comm/admin/askpricesupplierdet_extrafields.php +++ b/htdocs/comm/admin/askpricesupplierdet_extrafields.php @@ -66,7 +66,7 @@ $textobject=$langs->transnoentitiesnoconv("CommRequests"); llxHeader('',$langs->trans("AskPriceSupplierSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("AskPriceSupplierSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("AskPriceSupplierSetup"),$linkback,'title_setup'); $head = askpricesupplier_admin_prepare_head(); @@ -130,7 +130,7 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print "
"; - print_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } @@ -143,7 +143,7 @@ if ($action == 'create') if ($action == 'edit' && ! empty($attrname)) { print "
"; - print_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php index bd0ce34329d..9c55c606e81 100644 --- a/htdocs/comm/admin/propal_extrafields.php +++ b/htdocs/comm/admin/propal_extrafields.php @@ -64,7 +64,7 @@ $textobject=$langs->transnoentitiesnoconv("Proposals"); llxHeader('',$langs->trans("PropalSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("PropalSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("PropalSetup"),$linkback,'title_setup'); $head = propal_admin_prepare_head(); @@ -94,7 +94,7 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print "
"; - print_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } @@ -107,7 +107,7 @@ if ($action == 'create') if ($action == 'edit' && ! empty($attrname)) { print "
"; - print_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php index 58ab3adf109..97d4763ace3 100644 --- a/htdocs/comm/admin/propaldet_extrafields.php +++ b/htdocs/comm/admin/propaldet_extrafields.php @@ -72,7 +72,7 @@ $textobject=$langs->transnoentitiesnoconv("Proposals"); llxHeader('',$langs->trans("PropalSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("PropalSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("PropalSetup"),$linkback,'title_setup'); $head = propal_admin_prepare_head(); @@ -101,7 +101,7 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print "
"; - print_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } @@ -114,7 +114,7 @@ if ($action == 'create') if ($action == 'edit' && ! empty($attrname)) { print "
"; - print_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } diff --git a/htdocs/comm/askpricesupplier/card.php b/htdocs/comm/askpricesupplier/card.php index 3fe244c7396..5b8bd88a920 100644 --- a/htdocs/comm/askpricesupplier/card.php +++ b/htdocs/comm/askpricesupplier/card.php @@ -29,6 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaskpricesupplier.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php'; require_once DOL_DOCUMENT_ROOT . '/comm/askpricesupplier/class/askpricesupplier.class.php'; require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/modules/askpricesupplier/modules_askpricesupplier.php'; @@ -977,6 +978,7 @@ $form = new Form($db); $formother = new FormOther($db); $formfile = new FormFile($db); $formaskpricesupplier = new FormAskPriceSupplier($db); +$formmargin = new FormMargin($this->db); $companystatic = new Societe($db); $now = dol_now(); @@ -984,7 +986,7 @@ $now = dol_now(); // Add new askprice if ($action == 'create') { - print_fiche_titre($langs->trans("NewAskPrice")); + print load_fiche_titre($langs->trans("NewAskPrice")); $soc = new Societe($db); if ($socid > 0) @@ -1263,7 +1265,7 @@ if ($action == 'create') print '
'; $title = $langs->trans('ProductsAndServices'); - print_titre($title); + print load_fiche_titre($title); print ''; @@ -1500,7 +1502,7 @@ if ($action == 'create') // Margin Infos if (! empty($conf->margin->enabled)) { print ''; } print ''; @@ -1664,7 +1666,7 @@ if ($action == 'create') // Create an order if (! empty($conf->commande->enabled) && $object->statut == 2) { - if ($user->rights->commande->creer) { + if ($user->rights->fournisseur->commande->creer) { print ''; } } @@ -1761,7 +1763,7 @@ if ($action == 'create') $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); exit(); } $fileparams = dol_most_recent_file($conf->askpricesupplier->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); @@ -1770,7 +1772,7 @@ if ($action == 'create') print '
'; print '
'; - print_fiche_titre($langs->trans('SendAskByMail')); + print load_fiche_titre($langs->trans('SendAskByMail')); dol_fiche_head(''); diff --git a/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php b/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php index 2854a0a0d4b..971b53a3534 100644 --- a/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php +++ b/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php @@ -53,18 +53,13 @@ class AskPriceSupplier extends CommonObject */ protected $table_ref_field = 'ref'; - var $id; - var $socid; // Id client - var $client; // Objet societe client (a charger par fetch_client) - var $fk_project; /** * @deprecated * @see user_author_id */ var $author; - var $ref; var $ref_fourn; //Reference saisie lors de l'ajout d'une ligne à la demande var $statut; // 0 (draft), 1 (validated), 2 (signed), 3 (not signed), 4 (billed) var $date; // Date of proposal @@ -99,12 +94,6 @@ class AskPriceSupplier extends CommonObject var $user_valid_id; var $user_close_id; - var $total_ht; // Total net of tax - var $total_tva; // Total VAT - var $total_localtax1; // Total Local Taxes 1 - var $total_localtax2; // Total Local Taxes 2 - var $total_ttc; // Total with tax - /** * @deprecated * @see price_ht @@ -121,22 +110,11 @@ class AskPriceSupplier extends CommonObject */ var $total; - var $cond_reglement_id; var $cond_reglement_code; - var $fk_account; // Id of bank account - var $mode_reglement_id; var $mode_reglement_code; var $remise; var $remise_percent; var $remise_absolue; - /** - * @deprecated - * @see note_public, note_private - */ - var $note; - var $note_private; - var $note_public; - var $shipping_method_id; var $products=array(); var $extraparams=array(); @@ -144,9 +122,6 @@ class AskPriceSupplier extends CommonObject var $lines = array(); var $line; - var $origin; - var $origin_id; - var $labelstatut=array(); var $labelstatut_short=array(); @@ -757,8 +732,8 @@ class AskPriceSupplier extends CommonObject $sql.= $this->socid; $sql.= ", 0"; $sql.= ", ".$this->remise; - $sql.= ", ".($this->remise_percent?$this->remise_percent:'null'); - $sql.= ", ".($this->remise_absolue?$this->remise_absolue:'null'); + $sql.= ", ".($this->remise_percent?$this->db->escape($this->remise_percent):'null'); + $sql.= ", ".($this->remise_absolue?$this->db->escape($this->remise_absolue):'null'); $sql.= ", 0"; $sql.= ", 0"; $sql.= ", '".$this->db->idate($now)."'"; @@ -766,7 +741,7 @@ class AskPriceSupplier extends CommonObject $sql.= ", ".($user->id > 0 ? "'".$user->id."'":"null"); $sql.= ", '".$this->db->escape($this->note_private)."'"; $sql.= ", '".$this->db->escape($this->note_public)."'"; - $sql.= ", '".$this->modelpdf."'"; + $sql.= ", '".$this->db->escape($this->modelpdf)."'"; $sql.= ", ".$this->cond_reglement_id; $sql.= ", ".$this->mode_reglement_id; $sql.= ", ".($this->fk_account>0?$this->fk_account:'NULL'); @@ -950,8 +925,8 @@ class AskPriceSupplier extends CommonObject foreach($this->lines as $line) $line->fetch_optionals($line->rowid); - // Load source object - $objFrom = dol_clone($this); + // Load source object + $objFrom = clone $this; $objsoc=new Societe($this->db); diff --git a/htdocs/comm/askpricesupplier/index.php b/htdocs/comm/askpricesupplier/index.php index 4eddadf3803..6936defda49 100644 --- a/htdocs/comm/askpricesupplier/index.php +++ b/htdocs/comm/askpricesupplier/index.php @@ -52,7 +52,7 @@ $help_url="EN:Module_Ask_Price_Supplier|FR:Module_Demande_de_prix_fournisseur"; llxHeader("",$langs->trans("AskPriceSupplierArea"),$help_url); -print_fiche_titre($langs->trans("AskPriceSupplierArea")); +print load_fiche_titre($langs->trans("AskPriceSupplierArea")); print '
'; @@ -61,15 +61,15 @@ print '
'; * Search form */ $var=false; -print '
'; - $object->displayMarginInfos(); + $formmargin->displayMarginInfos($object); print '
'; print ''; print ''; +print '
'; print ''; print ''; print ''; print ''; -print "
'.$langs->trans("SearchRequest").'
'; print $langs->trans("Ref").':
'.$langs->trans("Other").':

\n"; +print "

\n"; /* diff --git a/htdocs/comm/askpricesupplier/tpl/linkedobjectblock.tpl.php b/htdocs/comm/askpricesupplier/tpl/linkedobjectblock.tpl.php index a45fac8b3c9..bf16d01fa1e 100644 --- a/htdocs/comm/askpricesupplier/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/askpricesupplier/tpl/linkedobjectblock.tpl.php @@ -29,7 +29,7 @@ $langs = $GLOBALS['langs']; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; echo '
'; -print_titre($langs->trans('RelatedAskPriceSupplier')); +print load_fiche_titre($langs->trans('RelatedAskPriceSupplier')); ?> @@ -38,24 +38,26 @@ print_titre($langs->trans('RelatedAskPriceSupplier')); + $objectlink) { $var=!$var; ?> > + trans("ShowAskPriceSupplier"),"askpricesupplier").' '.$objectlink->ref; ?> - + - + + rights->askpricesupplier->lire) { echo price($total); } ?> - + +
trans("Date"); ?> trans("AmountHTShort"); ?> trans("Status"); ?>
- trans("ShowAskPriceSupplier"),"askpricesupplier").' '.$object->ref; ?> datec,'day'); ?>datec,'day'); ?> rights->askpricesupplier->lire) { - $total = $total + $object->total_ht; - echo price($object->total_ht); + $total = $total + $objectlink->total_ht; + echo price($objectlink->total_ht); } ?>getLibStatut(3); ?>getLibStatut(3); ?>">transnoentitiesnoconv("RemoveLink")); ?>
 
diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index d6ff35f8af5..a9164676716 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -965,25 +965,25 @@ if ($id > 0) print '
'; - if (! empty($conf->propal->enabled) && $user->rights->propal->creer) + if (! empty($conf->propal->enabled) && $user->rights->propal->creer && $object->status==1) { $langs->load("propal"); print ''; } - if (! empty($conf->commande->enabled) && $user->rights->commande->creer) + if (! empty($conf->commande->enabled) && $user->rights->commande->creer && $object->status==1) { $langs->load("orders"); print ''; } - if ($user->rights->contrat->creer) + if ($user->rights->contrat->creer && $object->status==1) { $langs->load("contracts"); print ''; } - if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) + if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer && $object->status==1) { $langs->load("fichinter"); print ''; @@ -992,7 +992,7 @@ if ($id > 0) // Add invoice if ($user->societe_id == 0) { - if (! empty($conf->deplacement->enabled)) + if (! empty($conf->deplacement->enabled) && $object->status==1) { $langs->load("trips"); print ''; @@ -1000,7 +1000,7 @@ if ($id > 0) if (! empty($conf->facture->enabled)) { - if ($user->rights->facture->creer) + if ($user->rights->facture->creer && $object->status==1) { $langs->load("bills"); $langs->load("orders"); diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 7dc359b4568..6aee0fe939c 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -68,7 +68,7 @@ if (! empty($conf->commande->enabled)) $orderstatic=new Commande($db); llxHeader(); -print_fiche_titre($langs->trans("CommercialArea"),'','title_commercial.png'); +print load_fiche_titre($langs->trans("CommercialArea"),'','title_commercial.png'); print '
'; diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index 126ffc5f470..9752abd31cb 100644 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013-2015 Florian Henry * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Marcos García * @@ -29,6 +29,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; $langs->load("companies"); $langs->load("customers"); @@ -50,12 +52,14 @@ $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="s.nom"; -$search_company=GETPOST("search_company"); -$search_zipcode=GETPOST("search_zipcode"); -$search_town=GETPOST("search_town"); -$search_code=GETPOST("search_code"); -$search_compta=GETPOST("search_compta"); -$search_status= GETPOST("search_status",'int'); +$search_company = GETPOST("search_company"); +$search_zipcode = GETPOST("search_zipcode"); +$search_town = GETPOST("search_town"); +$search_code = GETPOST("search_code"); +$search_compta = GETPOST("search_compta"); +$search_status = GETPOST("search_status",'int'); +$search_country = GETPOST("search_country",'int'); +$search_type_thirdparty = GETPOST("search_type_thirdparty",'int'); // Load sale and categ filters $search_sale = GETPOST("search_sale",'int'); @@ -89,6 +93,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_code=''; $search_compta=''; $search_status=''; + $search_country=""; + $search_type_thirdparty=''; } if ($search_status=='') $search_status=1; // always display activ customer first @@ -101,12 +107,15 @@ if ($search_status=='') $search_status=1; // always display activ customer first $formother=new FormOther($db); $form = new Form($db); $thirdpartystatic=new Societe($db); +$formcompany=new FormCompany($db); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('',$langs->trans("ThirdParty"),$help_url); $sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.client, s.zip, s.town, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,"; $sql.= " s.datec, s.canvas"; +$sql.= ",s.fk_pays"; +$sql.= ",typent.code as typent_code"; if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) // Add fields for extrafields foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key; @@ -116,12 +125,14 @@ $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // N $sql.=$hookmanager->resPrint; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; // We need this table joined to the select in order to filter by categ -if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays) "; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent) "; +if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale $sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st"; $sql.= " WHERE s.fk_stcomm = st.id"; $sql.= " AND s.client IN (1, 3)"; $sql.= ' AND s.entity IN ('.getEntity('societe', 1).')'; -if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; +if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= " AND s.rowid = sc.fk_soc"; if ($socid) $sql.= " AND s.rowid = ".$socid; if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid; @@ -134,6 +145,8 @@ if ($search_town) $sql.= natural_search('s.town', $search_town); if ($search_code) $sql.= natural_search("s.code_client", $search_code); if ($search_compta) $sql.= natural_search("s.code_compta", $search_compta); if ($search_status!='') $sql.= " AND s.status = ".$db->escape($search_status); +if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; +if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; if ($search_sale > 0) $sql.= " AND sc.fk_user = ".$search_sale; // Add where from hooks $parameters=array(); @@ -157,10 +170,15 @@ if ($result) { $num = $db->num_rows($result); - $param = "&search_company=".$search_company."&search_code=".$search_code."&search_zipcode=".$search_zipcode."&search_town=".$search_town; - if ($search_categ != '') $param.='&search_categ='.$search_categ; - if ($search_sale > 0) $param.='&search_sale='.$search_sale; - if ($search_status != '') $param.='&search_status='.$search_status; + $param = "&search_company=".htmlspecialchars($search_company); + $param.="&search_code=".htmlspecialchars($search_code); + $param.="&search_zipcode=".htmlspecialchars($search_zipcode); + $param.="&search_town=".htmlspecialchars($search_town); + if ($search_categ != '') $param.='&search_categ='.htmlspecialchars($search_categ); + if ($search_sale > 0) $param.='&search_sale='.htmlspecialchars($search_sale); + if ($search_status != '') $param.='&search_status='.htmlspecialchars($search_status); + if ($search_country != '') $param.='&search_country='.htmlspecialchars($search_country); + if ($search_type_thirdparty != '') $param.='&search_type_thirdparty='.htmlspecialchars($search_type_thirdparty); print_barre_liste($langs->trans("ListOfCustomers"), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_companies.png'); @@ -198,6 +216,8 @@ if ($result) print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"s.zip","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Country"),$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ThirdPartyType"),$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","",$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec","",$param,'align="right"',$sortfield,$sortorder); @@ -222,6 +242,14 @@ if ($result) print ''; print '
'; + print $form->select_country($search_country,'search_country'); + print ''; + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); + print ''; print ''; print ''.$obj->zip.''.$obj->town.''; + $tmparray=getCountry($obj->fk_pays,'all'); + print $tmparray['label']; + print ''; + if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); + print $typenArray[$obj->typent_code]; + print ''.$obj->code_client.''.$obj->code_compta.''.dol_print_date($db->jdate($obj->datec),'day').'
'; // Subject diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 99c73dc4837..cd3ff7b00ee 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -223,7 +223,7 @@ if ($object->fetch($id) >= 0) // Show email selectors if ($allowaddtarget && $user->rights->mailing->creer) { - print_fiche_titre($langs->trans("ToAddRecipientsChooseHere"),($user->admin?info_admin($langs->trans("YouCanAddYourOwnPredefindedListHere"),1):''),''); + print load_fiche_titre($langs->trans("ToAddRecipientsChooseHere"),($user->admin?info_admin($langs->trans("YouCanAddYourOwnPredefindedListHere"),1):''),''); print '
'; print ''; diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 1df5a7ad18f..f3866f80b96 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -34,8 +34,6 @@ class Mailing extends CommonObject public $element='mailing'; public $table_element='mailing'; - var $id; - var $statut; var $titre; var $sujet; var $body; diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 5c6ae896e42..59753ee1904 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -42,7 +42,7 @@ $result=restrictedArea($user,'mailing'); $help_url='EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing'; llxHeader('','EMailing',$help_url); -print_fiche_titre($langs->trans("MailingArea")); +print load_fiche_titre($langs->trans("MailingArea")); //print '
'; //print '
'; diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index ef2e2c48bf8..8ca6b889310 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -40,10 +40,9 @@ $pagenext = $page + 1; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="m.date_creat"; -$sall=isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"]; -$sref=isset($_GET["sref"])?$_GET["sref"]:$_POST["sref"]; - -$filteremail=$_REQUEST["filteremail"]?$_REQUEST["filteremail"]:''; +$sall=GETPOST("sall","alpha"); +$sref=GETPOST("sref","alpha"); +$filteremail=GETPOST('filteremail','alpha'); @@ -62,8 +61,8 @@ if ($filteremail) $sql.= " FROM ".MAIN_DB_PREFIX."mailing as m, ".MAIN_DB_PREFIX."mailing_cibles as mc"; $sql.= " WHERE m.rowid = mc.fk_mailing AND m.entity = ".$conf->entity; $sql.= " AND mc.email = '".$db->escape($filteremail)."'"; - if ($sref) $sql.= " AND m.rowid = '".$sref."'"; - if ($sall) $sql.= " AND (m.titre like '%".$sall."%' OR m.sujet like '%".$sall."%' OR m.body like '%".$sall."%')"; + if ($sref) $sql.= " AND m.rowid = '".$db->escape($sref)."'"; + if ($sall) $sql.= " AND (m.titre like '%".$db->escape($sall)."%' OR m.sujet like '%".$db->escape($sall)."%' OR m.body like '%".$db->escape($sall)."%')"; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="m.rowid"; $sql.= $db->order($sortfield,$sortorder); @@ -74,8 +73,8 @@ else $sql = "SELECT m.rowid, m.titre, m.nbemail, m.statut, m.date_creat as datec, m.date_envoi as date_envoi"; $sql.= " FROM ".MAIN_DB_PREFIX."mailing as m"; $sql.= " WHERE m.entity = ".$conf->entity; - if ($sref) $sql.= " AND m.rowid = '".$sref."'"; - if ($sall) $sql.= " AND (m.titre like '%".$sall."%' OR m.sujet like '%".$sall."%' OR m.body like '%".$sall."%')"; + if ($sref) $sql.= " AND m.rowid = '".$db->escape($sref)."'"; + if ($sall) $sql.= " AND (m.titre like '%".$db->escape($sall)."%' OR m.sujet like '%".$db->escape($sall)."%' OR m.body like '%".$db->escape($sall)."%')"; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="m.rowid"; $sql.= $db->order($sortfield,$sortorder); @@ -94,9 +93,10 @@ if ($result) $i = 0; - $param = "&sall=".$sall; + $param = "&sall=".urlencode($sall); if ($filteremail) $param.='&filteremail='.urlencode($filteremail); - + + print '
'; print ''; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"m.rowid",$param,"","",$sortfield,$sortorder); @@ -108,14 +108,13 @@ if ($result) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],($filteremail?"mc.statut":"m.statut"),$param,"",'align="right"',$sortfield,$sortorder); print "\n"; - print ''; print ''; print ''; // Title print ''; print ''; if (! $filteremail) print ''; @@ -123,7 +122,6 @@ if ($result) print '"; print "\n"; - print ''; $var=True; @@ -177,7 +175,7 @@ if ($result) print "\n"; $i++; } - print "
'; - print ''; + print ''; print ''; - print ''; + print ''; print '  '; print "
"; + print '
'; $db->free($result); } else diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index dc0f376234e..e8f374c3b8d 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -35,6 +35,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formpropal.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php'; require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/modules/propale/modules_propale.php'; @@ -103,6 +104,8 @@ if ($id > 0 || ! empty($ref)) { $hookmanager->initHooks(array('propalcard','globalcard')); $permissionnote = $user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php +$permissiondellink=$user->rights->propale->creer; // Used by the include of actions_dellink.inc.php +$permissiontoedit = $user->rights->propale->creer; // Used by the include of actions_lineupdown.inc.php /* @@ -117,7 +120,11 @@ if (empty($reshook)) { if ($cancel) $action = ''; - include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once + + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once // Action clone object if ($action == 'confirm_clone' && $confirm == 'yes') @@ -189,22 +196,18 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - // Define output language - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - $model=$object->modelpdf; - $ret = $object->fetch($id); // Reload to get new records - - $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; + if (! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); } + $model=$object->modelpdf; + $ret = $object->fetch($id); // Reload to get new records + + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } else { $langs->load("errors"); @@ -1047,49 +1050,6 @@ if (empty($reshook)) exit(); } - // Generation doc (depuis lien ou depuis cartouche doc) - else if ($action == 'builddoc' && $user->rights->propal->creer) { - if (GETPOST('model')) { - $object->setDocModel($user, GETPOST('model')); - } - if (GETPOST('fk_bank')) { // this field may come from an external module - $object->fk_bank = GETPOST('fk_bank'); - } else { - $object->fk_bank = $object->fk_account; - } - - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) { - $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret = $object->fetch($id); // Reload to get new records - $result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result <= 0) - { - setEventMessages($object->error, $object->errors, 'errors'); - $action=''; - } - } - - // Remove file in doc form - else if ($action == 'remove_file' && $user->rights->propal->creer) { - if ($object->id > 0) { - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - - $langs->load("other"); - $upload_dir = $conf->propal->dir_output; - $file = $upload_dir . '/' . GETPOST('file'); - $ret = dol_delete_file($file, 0, 0, 0, $object); - if ($ret) - setEventMessage($langs->trans("FileWasRemoved", GETPOST('file'))); - else - setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors'); - } - } - // Set project else if ($action == 'classin' && $user->rights->propal->creer) { $object->setProject($_POST['projectid']); @@ -1133,47 +1093,7 @@ if (empty($reshook)) $result=$object->setShippingMethod(GETPOST('shipping_method_id', 'int')); } - /* - * Ordonnancement des lignes - */ - - else if ($action == 'up' && $user->rights->propal->creer) { - $object->line_up(GETPOST('rowid')); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) { - $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret = $object->fetch($id); // Reload to get new records - $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id . '#' . GETPOST('rowid')); - exit(); - } - - else if ($action == 'down' && $user->rights->propal->creer) { - $object->line_down(GETPOST('rowid')); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) { - $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret = $object->fetch($id); // Reload to get new records - $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id . '#' . GETPOST('rowid')); - exit(); - } else if ($action == 'update_extras') { + else if ($action == 'update_extras') { // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); @@ -1245,6 +1165,12 @@ if (empty($reshook)) } } } + + // Actions to build doc + $upload_dir = $conf->propal->dir_output; + $permissioncreate=$user->rights->propal->creer; + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; + } @@ -1258,6 +1184,7 @@ $form = new Form($db); $formother = new FormOther($db); $formfile = new FormFile($db); $formpropal = new FormPropal($db); +$formmargin = new FormMargin($this->db); $companystatic = new Societe($db); if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } @@ -1266,7 +1193,7 @@ $now = dol_now(); // Add new proposal if ($action == 'create') { - print_fiche_titre($langs->trans("NewProp")); + print load_fiche_titre($langs->trans("NewProp")); $soc = new Societe($db); if ($socid > 0) @@ -1361,7 +1288,7 @@ if ($action == 'create') print '
'; - print $form->select_company('', 'socid', 's.client = 1 OR s.client = 2 OR s.client = 3', 1); + print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 1); print '
' . $langs->trans('NotePublic') . ''; - $note_public = ''; - if (is_object($objectsrc)) // Take value from source object - { - $note_public = $objectsrc->note_public; - } + $note_public = $object->getDefaultCreateValueFor('note_public', (is_object($objectsrc)?$objectsrc->note_public:null)); $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); print $doleditor->Create(1); @@ -1499,11 +1422,7 @@ if ($action == 'create') print '
' . $langs->trans('NotePrivate') . ''; - $note_private = ''; - if (! empty($origin) && ! empty($originid) && is_object($objectsrc)) // Take value from source object - { - $note_private = $objectsrc->note_private; - } + $note_private = $object->getDefaultCreateValueFor('note_private', ((! empty($origin) && ! empty($originid) && is_object($objectsrc))?$objectsrc->note_private:null)); $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); print $doleditor->Create(1); // print ' @@ -1662,7 +1581,7 @@ if ($action == 'create') print '
'; $title = $langs->trans('ProductsAndServices'); - print_titre($title); + print load_fiche_titre($title); print ''; @@ -2069,7 +1988,7 @@ if ($action == 'create') // Margin Infos if (! empty($conf->margin->enabled)) { print ''; } print ''; @@ -2361,7 +2280,7 @@ if ($action == 'create') if (! $file || ! is_readable($file)) { $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); exit(); } $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); @@ -2370,7 +2289,7 @@ if ($action == 'create') print '
'; print '
'; - print_fiche_titre($langs->trans('SendPropalByMail')); + print load_fiche_titre($langs->trans('SendPropalByMail')); dol_fiche_head(''); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index b80b96654c1..2645f39968b 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -54,23 +54,14 @@ class Propal extends CommonObject */ protected $table_ref_field = 'ref'; - var $id; - /** * ID of the client * @var int */ var $socid; - /** - * Client (loaded by fetch_client) - * @var Societe - */ - var $client; var $contactid; - var $fk_project; var $author; - var $ref; var $ref_client; /** @@ -122,12 +113,6 @@ class Propal extends CommonObject var $user_valid_id; var $user_close_id; - var $total_ht; // Total net of tax - var $total_tva; // Total VAT - var $total_localtax1; // Total Local Taxes 1 - var $total_localtax2; // Total Local Taxes 2 - var $total_ttc; // Total with tax - /** * @deprecated * @see total_ht @@ -144,29 +129,14 @@ class Propal extends CommonObject */ var $total; - var $cond_reglement_id; var $cond_reglement_code; - var $fk_account; // Id of bank account - var $mode_reglement_id; var $mode_reglement_code; var $remise; var $remise_percent; var $remise_absolue; - /** - * @deprecated - * @see note_private, note_public - */ - var $note; - var $note_private; - var $note_public; - /** - * @deprecated - */ - var $fk_delivery_address; var $fk_address; var $address_type; var $address; - var $shipping_method_id; var $availability_id; var $availability_code; var $demand_reason_id; @@ -181,19 +151,11 @@ class Propal extends CommonObject var $lines = array(); var $line; - var $origin; - var $origin_id; - var $labelstatut=array(); var $labelstatut_short=array(); var $specimen; - //Incorterms - var $fk_incoterms; - var $location_incoterms; - var $libelle_incoterms; //Used into tooltip - /** * Draft status */ @@ -643,16 +605,16 @@ class Propal extends CommonObject $price = $pu - $remise; } - // Update line - $this->line=new PropaleLigne($this->db); + //Fetch current line from the database and then clone the object and set it in $oldline property + $line = new PropaleLigne($this->db); + $line->fetch($rowid); + $staticline = clone $line; + + $line->oldline = $staticline; + $this->line = $line; $this->line->context = $this->context; - // Stock previous line records - $staticline=new PropaleLigne($this->db); - $staticline->fetch($rowid); - $this->line->oldline = $staticline; - // Reorder if fk_parent_line change if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) { @@ -858,8 +820,8 @@ class Propal extends CommonObject $sql.= $this->socid; $sql.= ", 0"; $sql.= ", ".$this->remise; - $sql.= ", ".($this->remise_percent?$this->remise_percent:'null'); - $sql.= ", ".($this->remise_absolue?$this->remise_absolue:'null'); + $sql.= ", ".($this->remise_percent?$this->db->escape($this->remise_percent):'null'); + $sql.= ", ".($this->remise_absolue?$this->db->escape($this->remise_absolue):'null'); $sql.= ", 0"; $sql.= ", 0"; $sql.= ", '".$this->db->idate($this->date)."'"; @@ -868,7 +830,7 @@ class Propal extends CommonObject $sql.= ", ".($user->id > 0 ? "'".$user->id."'":"null"); $sql.= ", '".$this->db->escape($this->note_private)."'"; $sql.= ", '".$this->db->escape($this->note_public)."'"; - $sql.= ", '".$this->modelpdf."'"; + $sql.= ", '".$this->db->escape($this->modelpdf)."'"; $sql.= ", ".($this->fin_validite!=''?"'".$this->db->idate($this->fin_validite)."'":"null"); $sql.= ", ".$this->cond_reglement_id; $sql.= ", ".$this->mode_reglement_id; @@ -1062,9 +1024,9 @@ class Propal extends CommonObject function createFromClone($socid=0) { global $db, $user,$langs,$conf,$hookmanager; - + dol_include_once('/projet/class.project.class.php'); - + $this->context['createfromclone']='createfromclone'; $error=0; @@ -1077,7 +1039,7 @@ class Propal extends CommonObject $line->fetch_optionals($line->rowid); // Load source object - $objFrom = dol_clone($this); + $objFrom = clone $this; $objsoc=new Societe($this->db); @@ -1089,16 +1051,16 @@ class Propal extends CommonObject $this->socid = $objsoc->id; $this->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); $this->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); - + $project = new Project($db); - + if($objFrom->fk_project > 0 && $project->fetch($objFrom->fk_project)) { if($project->socid <= 0) $this->fk_project = $objFrom->fk_project; else $this->fk_project = ''; } else { $this->fk_project = ''; } - + $this->fk_delivery_address = ''; } @@ -3107,10 +3069,12 @@ class PropaleLigne extends CommonObjectLine $this->date_end = $this->db->jdate($objp->date_end); $this->db->free($result); + + return 1; } else { - dol_print_error($this->db); + return -1; } } @@ -3138,11 +3102,12 @@ class PropaleLigne extends CommonObjectLine if (empty($this->total_localtax2)) $this->total_localtax2=0; if (empty($this->rang)) $this->rang=0; if (empty($this->remise)) $this->remise=0; - if (empty($this->remise_percent)) $this->remise_percent=0; + if (empty($this->remise_percent) || ! is_numeric($this->remise_percent)) $this->remise_percent=0; if (empty($this->info_bits)) $this->info_bits=0; if (empty($this->special_code)) $this->special_code=0; if (empty($this->fk_parent_line)) $this->fk_parent_line=0; if (empty($this->fk_fournprice)) $this->fk_fournprice=0; + if (! is_numeric($this->qty)) $this->qty = 0; if (empty($this->pa_ht)) $this->pa_ht=0; diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 428e561f4fe..1bcbec9723d 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -52,7 +52,7 @@ $help_url="EN:Module_Commercial_Proposals|FR:Module_Propositions_commerciales|ES llxHeader("",$langs->trans("ProspectionArea"),$help_url); -print_fiche_titre($langs->trans("ProspectionArea")); +print load_fiche_titre($langs->trans("ProspectionArea")); //print '
'; - $object->displayMarginInfos(); + $formmargin->displayMarginInfos($object); print '
'; //print '
'; @@ -63,15 +63,15 @@ print '
'; * Search form */ $var=false; -print ''; print ''; print ''; +print '
'; print ''; print ''; print ''; print ''; -print "
'.$langs->trans("SearchPropal").'
'; print $langs->trans("Ref").':
'.$langs->trans("Other").':

\n"; +print "

\n"; /* diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 898f228fdb2..e99c7122a10 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -65,7 +65,7 @@ $langs->load('other'); llxHeader('', $langs->trans("ProposalsStatistics")); -print_fiche_titre($langs->trans("ProposalsStatistics"),'','title_commercial.png'); +print load_fiche_titre($langs->trans("ProposalsStatistics"),'','title_commercial.png'); $dir=$conf->propal->dir_temp; @@ -266,8 +266,11 @@ print ''; print ''; print ''; print ''; +print ''; print ''; +print ''; print ''; +print ''; print ''; $oldyear=0; @@ -280,15 +283,21 @@ foreach ($data as $val) print ''; print ''; print ''; + print ''; print ''; + print ''; print ''; + print ''; print ''; } print ''; print ''; print ''; + print ''; print ''; + print ''; print ''; + print ''; print ''; $oldyear=$year; } diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index 19763f8510c..6f53fd37a95 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -34,7 +34,7 @@ $langs = $GLOBALS['langs']; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; echo '
'; -print_titre($langs->trans('RelatedCommercialProposals')); +print load_fiche_titre($langs->trans('RelatedCommercialProposals')); ?>
'.$langs->trans("Year").''.$langs->trans("NbOfProposals").'%'.$langs->trans("AmountTotal").'%'.$langs->trans("AmountAverage").'%
0?'&userid='.$userid:'').'">'.$oldyear.'000
0?'&userid='.$userid:'').'">'.$year.''.$val['nb'].''.round($val['nb_diff']).''.price(price2num($val['total'],'MT'),1).''.round($val['total_diff']).''.price(price2num($val['avg'],'MT'),1).''.round($val['avg_diff']).'
@@ -43,24 +43,26 @@ print_titre($langs->trans('RelatedCommercialProposals')); + $objectlink) { $var=!$var; ?> > - - - + + + - + + rights->propale->lire) { echo price($total); } ?> - + +
trans("Date"); ?> trans("AmountHTShort"); ?> trans("Status"); ?>
getNomUrl(1); ?>ref_client; ?>date,'day'); ?>getNomUrl(1); ?>ref_client; ?>date,'day'); ?> rights->propale->lire) { - $total = $total + $object->total_ht; - echo price($object->total_ht); + $total = $total + $objectlink->total_ht; + echo price($objectlink->total_ht); } ?>getLibStatut(3); ?>getLibStatut(3); ?>">transnoentitiesnoconv("RemoveLink")); ?>
 
diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 0d72eac46e3..fba2fe9d1cd 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -44,7 +44,7 @@ $companystatic=new Societe($db); llxHeader(); -print_fiche_titre($langs->trans("ProspectionArea")); +print load_fiche_titre($langs->trans("ProspectionArea")); //print ''; //print '
'; @@ -54,15 +54,15 @@ print '
'; if (! empty($conf->propal->enabled)) { $var=false; - print ''; print ''; print ''; + print '
'; print ''; print ''; print ''; print ''; - print "
'.$langs->trans("SearchAProposal").'
'; print $langs->trans("Ref").':
'.$langs->trans("Other").':

\n"; + print "

\n"; } /* diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index 70847f479c3..b7a48331dd9 100644 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011 Philippe Grand - * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013-2015 Florian Henry * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud @@ -32,6 +32,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; $langs->load("propal"); $langs->load("companies"); @@ -53,6 +55,8 @@ $search_datec = GETPOST("search_datec"); $search_categ = GETPOST("search_categ",'int'); $search_status = GETPOST("search_status",'int'); $catid = GETPOST("catid",'int'); +$search_country = GETPOST("search_country",'int'); +$search_type_thirdparty = GETPOST("search_type_thirdparty",'int'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -150,7 +154,7 @@ $search_categ = GETPOST('search_categ','int'); // If the internal user must only see his prospect, force searching by him if (!$user->rights->societe->client->voir && !$socid) $search_sale = $user->id; -// List of avaible states; we'll need that for each lines (quick changing prospect states) and for search bar (filter by prospect state) +// List of available states; we'll need that for each lines (quick changing prospect states) and for search bar (filter by prospect state) $sts = array(-1,0,1,2,3); @@ -158,6 +162,10 @@ $sts = array(-1,0,1,2,3); $hookmanager->initHooks(array('prospectlist')); $extrafields = new ExtraFields($db); +// fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('thirdparty'); +$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + // Do we click on purge search criteria ? if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { @@ -171,6 +179,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_datec=""; $search_categ=""; $search_status=""; + $search_country=""; + $search_type_thirdparty=""; + $search_array_options=array(); } if ($search_status=='') $search_status=1; // always display active customer first @@ -206,6 +217,7 @@ if (empty($reshook)) $formother=new FormOther($db); $form=new Form($db); +$formcompany=new FormCompany($db); $prospectstatic=new Client($db); $prospectstatic->client=2; $prospectstatic->loadCacheOfProspStatus(); @@ -214,16 +226,21 @@ $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias, s.zip, s.town, s.d $sql.= " s.prefix_comm, s.fk_prospectlevel, s.fk_stcomm as stcomm_id,"; $sql.= " st.libelle as stcomm_label,"; $sql.= " d.nom as departement"; +$sql.= " ,s.fk_pays"; +$sql.= " ,typent.code as typent_code"; if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) // Add fields for extrafields -foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key; +if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key; // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."c_stcomm as st"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; +if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef on (s.rowid = ef.fk_object)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d on (d.rowid = s.fk_departement)"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays) "; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent) "; if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; // We need this table joined to the select in order to filter by categ if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale $sql.= " WHERE s.fk_stcomm = st.id"; @@ -231,7 +248,7 @@ $sql.= " AND s.client IN (2, 3)"; $sql.= ' AND s.entity IN ('.getEntity('societe', 1).')'; if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; if ($socid) $sql.= " AND s.rowid = " .$socid; -if ($search_stcomm != '') $sql.= natural_search("s.fk_stcomm",$search_stcomm,2); +if ($search_stcomm != '' && $search_stcomm != -2) $sql.= natural_search("s.fk_stcomm",$search_stcomm,2); if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid; if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; @@ -244,6 +261,8 @@ if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)." if ($search_status!='') $sql .= " AND s.status = ".$db->escape($search_status); // Insert levels filters if ($search_levels) $sql .= " AND s.fk_prospectlevel IN (".$search_levels.')'; +if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; +if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; // Insert sale filter if ($search_sale > 0) $sql .= " AND sc.fk_user = ".$db->escape($search_sale); if ($socname) @@ -252,6 +271,19 @@ if ($socname) $sortfield = "s.nom"; $sortorder = "ASC"; } +// Extra fields +foreach ($search_array_options as $key => $val) +{ + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode=0; + if (in_array($typ, array('int'))) $mode=1; // Search on a numeric + if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); + } +} // Add where from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook @@ -265,6 +297,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) } $sql.= " ORDER BY $sortfield $sortorder, s.nom ASC"; $sql.= $db->plimit($conf->liste_limit+1, $offset); +//print $sql; dol_syslog('comm/prospect/list.php', LOG_DEBUG); $resql = $db->query($sql); @@ -284,7 +317,10 @@ if ($resql) llxHeader('',$langs->trans("ThirdParty"),$help_url); } - $param='&search_stcomm='.$search_stcomm.'&search_nom='.urlencode($search_nom).'&search_zipcode='.urlencode($search_zipcode).'&search_town='.urlencode($search_town); + $param='&search_stcomm='.$search_stcomm; + $param.='&search_nom='.urlencode($search_nom); + $param.='&search_zipcode='.urlencode($search_zipcode); + $param.='&search_town='.urlencode($search_town); // Store the status filter in the URL if (isSet($search_setstcomm)) { @@ -298,9 +334,17 @@ if ($resql) } if ($search_level_from != '') $param.='&search_level_from='.$search_level_from; if ($search_level_to != '') $param.='&search_level_to='.$search_level_to; - if ($search_categ != '') $param.='&search_categ='.$search_categ; + if ($search_categ != '') $param.='&search_categ='.urlencode($search_categ); if ($search_sale > 0) $param.='&search_sale='.$search_sale; if ($search_status != '') $param.='&search_status='.$search_status; + if ($search_country != '') $param.='&search_country='.$search_country; + if ($search_type_thirdparty != '') $param.='&search_type_thirdparty='.$search_type_thirdparty; + foreach ($search_array_options as $key => $val) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $param.='&search_options_'.$tmpkey.'='.urlencode($val); + } // $param and $urladd should have the same value $urladd = $param; @@ -342,11 +386,25 @@ if ($resql) print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"s.zip","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("State"),$_SERVER["PHP_SELF"],"s.fk_departement","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Country"),$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ThirdPartyType"),$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"s.datec","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("ProspectLevelShort"),$_SERVER["PHP_SELF"],"s.fk_prospectlevel","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("StatusProsp"),$_SERVER["PHP_SELF"],"s.fk_stcomm","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre(''); - + + // Extrafields + if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) + { + foreach($extrafields->attribute_list as $key => $val) + { + if ($val) + { + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,"",$sortfield,$sortorder); + } + } + } + // Hook fields $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -360,13 +418,19 @@ if ($resql) print ''; print '
'; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; + print ''; + print $form->select_country($search_country,'search_country'); + print ''; + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); print ''; print ''; @@ -404,14 +468,29 @@ if ($resql) { $arraystcomm[$val['id']]=$val['label']; } - print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, 1); + print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2); print ''; print ' '; print ''; + print $extrafields->showInputField($key, $crit, '', '', 'search_', 4); + print '".$obj->zip."".$obj->town."'.$obj->departement.''; + $tmparray=getCountry($obj->fk_pays,'all'); + print $tmparray['label']; + print ''; + if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); + print $typenArray[$obj->typent_code]; + print ''.dol_print_date($db->jdate($obj->datec)).''; + print ''; foreach($prospectstatic->cacheprospectstatus as $key => $val) { $titlealt='default'; @@ -469,6 +558,21 @@ if ($resql) } print ''; + $paramkey='options_'.$key; + print $extrafields->showOutputField($key, $obj->$paramkey); + print '
'; print '
'; - print_fiche_titre($langs->trans("NewRelativeDiscount"),'',''); - - print ''; - print ''; - print ''; - print ''; + print load_fiche_titre($langs->trans("NewRelativeDiscount"),'',''); print ''; @@ -136,6 +138,8 @@ if ($socid > 0) print "
"; + dol_fiche_end(); + print '
'; print ''; if (! empty($backtopage)) @@ -147,8 +151,6 @@ if ($socid > 0) print ""; - dol_fiche_end(); - print '
'; diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index a68e9d28c19..957f109268a 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -221,14 +221,14 @@ if ($socid > 0) */ $head = societe_prepare_head($objsoc); - dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"),0,'company'); - print '
'; print ''; print ''; print ''; + dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"),0,'company'); + print ''; // Name @@ -264,7 +264,7 @@ if ($socid > 0) print '
'; print '
'; - print_fiche_titre($langs->trans("NewGlobalDiscount"),'',''); + print load_fiche_titre($langs->trans("NewGlobalDiscount"),'',''); print ''; print ''; print '
'.$langs->trans("AmountHT").''; @@ -278,6 +278,8 @@ if ($socid > 0) print "
"; + dol_fiche_end(); + print '
'; print ''; if (! empty($backtopage)) @@ -289,7 +291,6 @@ if ($socid > 0) print ''; - dol_fiche_end(); print '
'; @@ -316,7 +317,7 @@ if ($socid > 0) $resql=$db->query($sql); if ($resql) { - print_titre($langs->trans("DiscountStillRemaining")); + print load_fiche_titre($langs->trans("DiscountStillRemaining")); print ''; print ''; print ''; // Need 120+ for format with AM/PM @@ -329,8 +330,10 @@ if ($socid > 0) print ''; print ''; + $showconfirminfo=array(); + $var = true; - $i = 0 ; + $i = 0; $num = $db->num_rows($resql); while ($i < $num) { @@ -382,24 +385,26 @@ if ($socid > 0) if ($_GET["action"]=='split' && $_GET['remid'] == $obj->rowid) { - print ""; - print ''; - print ''; + $showconfirminfo['rowid']=$obj->rowid; + $showconfirminfo['amount_ttc']=$obj->amount_ttc; } $i++; } $db->free($resql); print "
'.$langs->trans("Date").' 
'; - $amount1=price2num($obj->amount_ttc/2,'MT'); - $amount2=($obj->amount_ttc-$amount1); - $formquestion=array( - 'text' => $langs->trans('TypeAmountOfEachNewDiscount'), - array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC").' 1', 'value' => $amount1, 'size' => '5'), - array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5') - ); - $langs->load("dict"); - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$obj->rowid, $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($obj->amount_ttc),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0); - print '
"; + + if (count($showconfirminfo)) + { + $amount1=price2num($showconfirminfo['amount_ttc']/2,'MT'); + $amount2=($showconfirminfo['amount_ttc']-$amount1); + $formquestion=array( + 'text' => $langs->trans('TypeAmountOfEachNewDiscount'), + array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC").' 1', 'value' => $amount1, 'size' => '5'), + array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5') + ); + $langs->load("dict"); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$showconfirminfo['rowid'], $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($showconfirminfo['amount_ttc']),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0); + } } else { @@ -452,7 +457,7 @@ if ($socid > 0) if ($resql) $resql2=$db->query($sql2); if ($resql2) { - print_titre($langs->trans("DiscountAlreadyCounted")); + print load_fiche_titre($langs->trans("DiscountAlreadyCounted")); print ''; print ''; print ''; // Need 120+ for format with AM/PM diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 5cc0c6db9ce..d5f3427b77c 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -36,6 +36,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formorder.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/modules/commande/modules_commande.php'; require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; @@ -93,8 +94,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('ordercard','globalcard')); -$permissionnote = $user->rights->commande->creer; // Used by the include of actions_setnotes.inc.php -$permissionedit = $user->rights->commande->creer; // Used by the include of actions_lineupdown.inc.php +$permissionnote = $user->rights->commande->creer; // Used by the include of actions_setnotes.inc.php +$permissiondellink = $user->rights->commande->creer; // Used by the include of actions_dellink.inc.php +$permissionedit = $user->rights->commande->creer; // Used by the include of actions_lineupdown.inc.php @@ -112,6 +114,8 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once // Action clone object @@ -126,7 +130,7 @@ if (empty($reshook)) if ($object->id > 0) { // Because createFromClone modifies the object, we must clone it so that we can restore it later - $orig = dol_clone($object); + $orig = clone $object; $result=$object->createFromClone($socid); if ($result > 0) @@ -1162,8 +1166,10 @@ if (empty($reshook)) - if (! $error && ! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->commande->creer) { - if ($action == 'addcontact') { + if (! $error && ! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->commande->creer) + { + if ($action == 'addcontact') + { if ($object->id > 0) { $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); $result = $object->add_contact($contactid, GETPOST('type'), GETPOST('source')); @@ -1183,7 +1189,8 @@ if (empty($reshook)) } // bascule du statut d'un contact - else if ($action == 'swapstatut') { + else if ($action == 'swapstatut') + { if ($object->id > 0) { $result = $object->swapContactStatus(GETPOST('ligne')); } else { @@ -1192,7 +1199,8 @@ if (empty($reshook)) } // Efface un contact - else if ($action == 'deletecontact') { + else if ($action == 'deletecontact') + { $result = $object->delete_contact($lineid); if ($result >= 0) { @@ -1215,6 +1223,7 @@ llxHeader('', $langs->trans('Order'), 'EN:Customers_Orders|FR:Commandes_Clients| $form = new Form($db); $formfile = new FormFile($db); $formorder = new FormOrder($db); +$formmargin = new FormMargin($db); if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } /** @@ -1226,7 +1235,7 @@ if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } */ if ($action == 'create' && $user->rights->commande->creer) { - print_fiche_titre($langs->trans('CreateOrder'),'','title_commercial.png'); + print load_fiche_titre($langs->trans('CreateOrder'),'','title_commercial.png'); $soc = new Societe($db); if ($socid > 0) @@ -1285,8 +1294,8 @@ if ($action == 'create' && $user->rights->commande->creer) $datedelivery = (! empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : ''); - $note_private = (! empty($objectsrc->note_private) ? $objectsrc->note_private : (! empty($objectsrc->note_private) ? $objectsrc->note_private : '')); - $note_public = (! empty($objectsrc->note_public) ? $objectsrc->note_public : ''); + $note_private = $object->getDefaultCreateValueFor('note_private', (! empty($objectsrc->note_private) ? $objectsrc->note_private : null)); + $note_public = $object->getDefaultCreateValueFor('note_public', (! empty($objectsrc->note_public) ? $objectsrc->note_public : null)); // Object source contacts list $srccontactslist = $objectsrc->liste_contact(- 1, 'external', 1); @@ -1304,6 +1313,9 @@ if ($action == 'create' && $user->rights->commande->creer) $remise_absolue = 0; $dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER)?-1:''; $projectid = 0; + + $note_private = $object->getDefaultCreateValueFor('note_private'); + $note_public = $object->getDefaultCreateValueFor('note_public'); } $absolute_discount=$soc->getAvailableDiscounts(); @@ -1564,7 +1576,7 @@ if ($action == 'create' && $user->rights->commande->creer) // Show origin lines if (! empty($origin) && ! empty($originid) && is_object($objectsrc)) { $title = $langs->trans('ProductsAndServices'); - print_titre($title); + print load_fiche_titre($title); print '
'.$langs->trans("Date").'
'; @@ -2074,7 +2086,7 @@ if ($action == 'create' && $user->rights->commande->creer) // Margin Infos if (! empty($conf->margin->enabled)) { print ''; } else print ''; @@ -2357,7 +2369,7 @@ if ($action == 'create' && $user->rights->commande->creer) if (! $file || ! is_readable($file)) { $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); exit(); } $fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); @@ -2366,7 +2378,7 @@ if ($action == 'create' && $user->rights->commande->creer) print '
'; print '
'; - print_fiche_titre($langs->trans('SendOrderByMail')); + print load_fiche_titre($langs->trans('SendOrderByMail')); dol_fiche_head(''); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index c941dfc1ff8..a50e18fe0d4 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -51,26 +51,15 @@ class Commande extends CommonOrder */ protected $table_ref_field = 'ref'; - var $id; - /** * Client ID * @var int */ var $socid; - /** - * Client (loaded by fetch_client) - * @var Societe - */ - var $client; - - var $ref; var $ref_client; - var $ref_ext; var $ref_int; var $contactid; - var $fk_project; /** * Status of the order. Check the following constants: @@ -86,16 +75,12 @@ class Commande extends CommonOrder var $billed; // billed or not var $brouillon; - var $cond_reglement_id; var $cond_reglement_code; - var $fk_account; - var $mode_reglement_id; var $mode_reglement_code; var $availability_id; var $availability_code; var $demand_reason_id; var $demand_reason_code; - var $fk_delivery_address; var $address; var $date; // Date commande /** @@ -104,31 +89,15 @@ class Commande extends CommonOrder */ var $date_commande; var $date_livraison; // Date livraison souhaitee - var $shipping_method_id; var $fk_remise_except; var $remise_percent; - var $total_ht; // Total net of tax - var $total_ttc; // Total with tax - var $total_tva; // Total VAT - var $total_localtax1; // Total Local tax 1 - var $total_localtax2; // Total Local tax 2 var $remise_absolue; - var $modelpdf; var $info_bits; var $rang; var $special_code; var $source; // Origin of order - /** - * @deprecated - * @see note_private, note_public - */ - var $note; - var $note_private; - var $note_public; var $extraparams=array(); - var $origin; - var $origin_id; var $linked_objects=array(); var $user_author_id; @@ -138,11 +107,6 @@ class Commande extends CommonOrder */ var $lines = array(); - //Incorterms - var $fk_incoterms; - var $location_incoterms; - var $libelle_incoterms; //Used into tooltip - // Pour board var $nbtodo; var $nbtodolate; @@ -745,13 +709,13 @@ class Commande extends CommonOrder $sql.= " VALUES ('(PROV)',".$this->socid.", '".$this->db->idate($now)."', ".$user->id; $sql.= ", ".($this->fk_project>0?$this->fk_project:"null"); $sql.= ", '".$this->db->idate($date)."'"; - $sql.= ", ".($this->source>=0 && $this->source != '' ?$this->source:'null'); + $sql.= ", ".($this->source>=0 && $this->source != '' ?$this->db->escape($this->source):'null'); $sql.= ", '".$this->db->escape($this->note_private)."'"; $sql.= ", '".$this->db->escape($this->note_public)."'"; $sql.= ", ".($this->ref_ext?"'".$this->db->escape($this->ref_ext)."'":"null"); $sql.= ", ".($this->ref_client?"'".$this->db->escape($this->ref_client)."'":"null"); $sql.= ", ".($this->ref_int?"'".$this->db->escape($this->ref_int)."'":"null"); - $sql.= ", '".$this->modelpdf."'"; + $sql.= ", '".$this->db->escape($this->modelpdf)."'"; $sql.= ", ".($this->cond_reglement_id>0?"'".$this->cond_reglement_id."'":"null"); $sql.= ", ".($this->mode_reglement_id>0?"'".$this->mode_reglement_id."'":"null"); $sql.= ", ".($this->fk_account>0?$this->fk_account:'NULL'); @@ -760,8 +724,8 @@ class Commande extends CommonOrder $sql.= ", ".($this->date_livraison?"'".$this->db->idate($this->date_livraison)."'":"null"); $sql.= ", ".($this->fk_delivery_address>0?$this->fk_delivery_address:'NULL'); $sql.= ", ".($this->shipping_method_id>0?$this->shipping_method_id:'NULL'); - $sql.= ", ".($this->remise_absolue>0?$this->remise_absolue:'NULL'); - $sql.= ", ".($this->remise_percent>0?$this->remise_percent:0); + $sql.= ", ".($this->remise_absolue>0?$this->db->escape($this->remise_absolue):'NULL'); + $sql.= ", ".($this->remise_percent>0?$this->db->escape($this->remise_percent):0); $sql.= ", ".(int) $this->fk_incoterms; $sql.= ", '".$this->db->escape($this->location_incoterms)."'"; $sql.= ", ".$conf->entity; @@ -958,7 +922,7 @@ class Commande extends CommonOrder $line->fetch_optionals($line->rowid); // Load source object - $objFrom = dol_clone($this); + $objFrom = clone $this; // Change socid if needed if (! empty($socid) && $socid != $this->socid) @@ -1112,10 +1076,10 @@ class Commande extends CommonOrder // get extrafields from original line $object->fetch_optionals($object->id); - + $e = new ExtraFields($db); $element_extrafields = $e->fetch_name_optionals_label($this->element); - + foreach($object->array_options as $options_key => $value) { if(array_key_exists(str_replace('options_', '', $options_key), $element_extrafields)){ $this->array_options[$options_key] = $value; @@ -2503,16 +2467,16 @@ class Commande extends CommonOrder $price = ($pu - $remise); } - // Update line - $this->line=new OrderLine($this->db); + //Fetch current line from the database and then clone the object and set it in $oldline property + $line = new OrderLine($this->db); + $line->fetch($rowid); + $staticline = clone $line; + + $line->oldline = $staticline; + $this->line = $line; $this->line->context = $this->context; - // Stock previous line records - $staticline=new OrderLine($this->db); - $staticline->fetch($rowid); - $this->line->oldline = $staticline; - // Reorder if fk_parent_line change if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) { @@ -2846,7 +2810,7 @@ class Commande extends CommonOrder $clause = " WHERE"; - $sql = "SELECT c.rowid, c.date_creation as datec, c.date_livraison as delivery_date, c.fk_statut"; + $sql = "SELECT c.rowid, c.date_creation as datec, c.date_commande, c.date_livraison as delivery_date, c.fk_statut"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; if (!$user->rights->societe->client->voir && !$user->societe_id) { @@ -2862,21 +2826,22 @@ class Commande extends CommonOrder $resql=$this->db->query($sql); if ($resql) { - $now=dol_now(); - $response = new WorkboardResponse(); $response->warning_delay=$conf->commande->client->warning_delay/60/60/24; $response->label=$langs->trans("OrdersToProcess"); $response->url=DOL_URL_ROOT.'/commande/list.php?viewstatut=-3'; $response->img=img_object($langs->trans("Orders"),"order"); + $generic_commande = new Commande($this->db); + while ($obj=$this->db->fetch_object($resql)) { - $response->nbtodo++; + $response->nbtodo++; - $date_to_test = empty($obj->delivery_date) ? $obj->datec : $obj->delivery_date; + $generic_commande->statut = $obj->fk_statut; + $generic_commande->date_livraison = $obj->delivery_date; - if ($obj->fk_statut != 3 && $this->db->jdate($date_to_test) < ($now - $conf->commande->client->warning_delay)) { + if ($generic_commande->hasDelay()) { $response->nbtodolate++; } } @@ -3341,6 +3306,24 @@ class Commande extends CommonOrder return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); } + + /** + * Is the customer order delayed? + * + * @return bool + */ + public function hasDelay() + { + global $conf; + + if (!($this->statut > Commande::STATUS_DRAFT) && ($this->statut < Commande::STATUS_CLOSED)) { + return false; + } + + $now = dol_now(); + + return max($this->date_commande, $this->date_livraison) < ($now - $conf->commande->client->warning_delay); + } } @@ -3471,10 +3454,12 @@ class OrderLine extends CommonOrderLine $this->date_end = $this->db->jdate($objp->date_end); $this->db->free($result); + + return 1; } else { - dol_print_error($this->db); + return -1; } } diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 7957803a5d5..d6432a257ba 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -53,7 +53,7 @@ $help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Ped llxHeader("",$langs->trans("Orders"),$help_url); -print_fiche_titre($langs->trans("OrdersArea")); +print load_fiche_titre($langs->trans("OrdersArea")); //print '
'; - $object->displayMarginInfos(); + $formmargin->displayMarginInfos($object); print '
'; //print '
'; @@ -62,15 +62,15 @@ print '
'; // Search customer orders $var=false; -print ''; print ''; print ''; +print '
'; print ''; print ''; print ''; print ''; -print "
'.$langs->trans("SearchOrder").'
'; print $langs->trans("Ref").':
'.$langs->trans("Other").':

\n"; +print "

\n"; /* diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 6af44d4a7d6..1c2f34c0931 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -357,9 +357,11 @@ if ($resql) $var=!$var; print ''; print ''; - $generic_commande->id=$objp->rowid; $generic_commande->ref=$objp->ref; + $generic_commande->statut = $objp->fk_statut; + $generic_commande->date_commande = $db->jdate($objp->date_commande); + $generic_commande->date_livraison = $db->jdate($objp->date_delivery); $generic_commande->ref_client = $objp->ref_client; $generic_commande->total_ht = $objp->total_ht; $generic_commande->total_tva = $objp->total_tva; @@ -444,8 +446,9 @@ if ($resql) // warning late icon print ''; - if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_commande),$db->jdate($objp->date_delivery)) < ($now - $conf->commande->client->warning_delay)) - print img_picto($langs->trans("Late"),"warning"); + if ($generic_commande->hasDelay()) { + print img_picto($langs->trans("Late"), "warning"); + } if(!empty($objp->note_private)) { print ' '; diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index e75a9dda73b..136ac6c1b89 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -370,7 +370,7 @@ if ($action == 'create' && !$error) $facturestatic=new Facture($db); llxHeader(); - print_fiche_titre($langs->trans('NewBill')); + print load_fiche_titre($langs->trans('NewBill')); $soc = new Societe($db); if ($socid) $res=$soc->fetch($socid); @@ -394,6 +394,9 @@ if ($action == 'create' && !$error) print ''; print ''; print ''; + + dol_fiche_head(); + print ''; // Ref @@ -495,16 +498,20 @@ if ($action == 'create' && !$error) $i++; } + dol_fiche_end(); + // Button "Create Draft" - print '
'; + print '
'; print "\n"; print ''; print "
\n"; + + } -//Mode liste -if (($action != 'create' && $action != 'add') && !$error) +// Mode liste +if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)) { llxHeader(); ?> @@ -563,7 +570,7 @@ if (($action != 'create' && $action != 'add') && !$error) $title = $langs->trans('ListOfOrders'); $title.=' - '.$langs->trans('StatusOrderValidated').', '.$langs->trans("StatusOrderSent").', '.$langs->trans('StatusOrderToBill'); $num = $db->num_rows($resql); - print_fiche_titre($title); + print load_fiche_titre($title); $i = 0; $period=$html->select_date($date_start,'date_start',0,0,1,'',1,0,1).' - '.$html->select_date($date_end,'date_end',0,0,1,'',1,0,1); $periodely=$html->select_date($date_starty,'date_start_dely',0,0,1,'',1,0,1).' - '.$html->select_date($date_endy,'date_end_dely',0,0,1,'',1,0,1); @@ -633,6 +640,9 @@ if (($action != 'create' && $action != 'add') && !$error) $generic_commande->id=$objp->rowid; $generic_commande->ref=$objp->ref; + $generic_commande->statut = $objp->fk_statut; + $generic_commande->date_commande = $db->jdate($objp->date_commande); + $generic_commande->date_livraison = $db->jdate($objp->date_livraison); print ''; print ''; print ''; print ''; - print "
'; @@ -640,7 +650,9 @@ if (($action != 'create' && $action != 'add') && !$error) print ''; - if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && $db->jdate($objp->date_valid) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning"); + if ($generic_commande->hasDelay()) { + print img_picto($langs->trans("Late"),"warning"); + } print ''; diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 71558be0e57..c4d48d8f72e 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -77,7 +77,7 @@ if ($mode == 'supplier') $dir=$conf->fournisseur->dir_output.'/commande/temp'; } -print_fiche_titre($title,'','title_commercial.png'); +print load_fiche_titre($title,'','title_commercial.png'); dol_mkdir($dir); @@ -279,8 +279,11 @@ print ''; print ''; print ''; print ''; +print ''; print ''; +print ''; print ''; +print ''; print ''; $oldyear=0; @@ -289,21 +292,27 @@ foreach ($data as $val) $year = $val['year']; while (! empty($year) && $oldyear > $year+1) { // If we have empty year - $oldyear--; - print ''; - print ''; + $oldyear--; + print ''; + print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; } print ''; print ''; print ''; + print ''; print ''; + print ''; print ''; + print ''; print ''; $oldyear=$year; } diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index 2eb94d7974a..bf399c250d9 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -30,7 +30,7 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; $langs->load("orders"); echo '
'; -print_titre($langs->trans('RelatedCustomerOrders')); +print load_fiche_titre($langs->trans('RelatedCustomerOrders')); ?>
'.$langs->trans("Year").''.$langs->trans("NbOfOrders").'%'.$langs->trans("AmountTotal").'%'.$langs->trans("AmountAverage").'%
0?'&userid='.$userid:'').'">'.$oldyear.'
0?'&userid='.$userid:'').'">'.$oldyear.'000
000
0?'&userid='.$userid:'').'">'.$year.''.$val['nb'].''.round($val['nb_diff']).''.price(price2num($val['total'],'MT'),1).''.round($val['total_diff']).''.price(price2num($val['avg'],'MT'),1).''.round($val['avg_diff']).'
@@ -40,24 +40,26 @@ print_titre($langs->trans('RelatedCustomerOrders')); + $objectlink) { $var=!$var; ?> > - - - + + + - + + rights->commande->lire) { echo price($total); } ?> - + +
trans("Date"); ?> trans("AmountHTShort"); ?> trans("Status"); ?>
getNomUrl(1); ?>ref_client; ?>date,'day'); ?>getNomUrl(1); ?>ref_client; ?>date,'day'); ?> rights->commande->lire) { - $total = $total + $object->total_ht; - echo price($object->total_ht); + $total = $total + $objectlink->total_ht; + echo price($objectlink->total_ht); } ?>getLibStatut(3); ?>getLibStatut(3); ?>">transnoentitiesnoconv("RemoveLink")); ?>
 
diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index c64d8b48e3d..deed3b1b97a 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -371,23 +371,32 @@ if ($id > 0 || ! empty($ref)) /* - * Boutons actions + * Buttons actions */ - if ($action != 'delete') { + if ($action != 'delete') + { print '
'; - if ($object->type != 2 && $object->rappro) { // If not cash account and can be reconciliate - if ($user->rights->banque->consolidate) { + if ($object->type != 2 && $object->rappro) + { + // If not cash account and can be reconciliate + if ($user->rights->banque->consolidate) + { print ''.$langs->trans("Conciliate").''; - } else { + } + else + { print ''.$langs->trans("Conciliate").''; } } - if ($action != 'addline') { - if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { - if (empty($conf->accounting->enabled)) { + if ($action != 'addline') + { + if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) + { + if (empty($conf->accounting->enabled)) + { if ($user->rights->banque->modifier) { print 'id.'&page='.$page.($vline?'&vline='.$vline:'').'">'.$langs->trans("AddBankRecord").''; } else { @@ -460,7 +469,7 @@ if ($id > 0 || ! empty($ref)) // Form to add a transaction with no invoice if ($user->rights->banque->modifier && $action == 'addline') { - print_fiche_titre($langs->trans("AddBankRecordLong"),'',''); + print load_fiche_titre($langs->trans("AddBankRecordLong"),'',''); print ''; print ''; @@ -500,12 +509,13 @@ if ($id > 0 || ! empty($ref)) print '
'; } - print '
'; - + /* - * Affiche tableau des transactions bancaires + * Show list of bank transactions */ + print '
'; + // Ligne de titre tableau des ecritures print ''; print ''; @@ -528,11 +538,11 @@ if ($id > 0 || ! empty($ref)) print ''; $period_filter .= $langs->trans('From').' '.$form->select_date($req_stdt,'req_stdt',0,0,1,null,1,1,1); - $period_filter .= '
'. $langs->trans('to').' '.$form->select_date($req_enddt,'req_enddt',0,0,1,null,1,1,1); + $period_filter .= ' '; + $period_filter .= $langs->trans('to').' '.$form->select_date($req_enddt,'req_enddt',0,0,1,null,1,1,1); print ''; - print ''; - print ''; + print ''; print '
'.$langs->trans("Date").'
 '.$period_filter.''.$period_filter.''; //$filtertype=array('TIP'=>'TIP','PRE'=>'PRE',...) $filtertype=''; @@ -654,7 +664,8 @@ if ($id > 0 || ! empty($ref)) $label=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$objp->fk_type; if ($objp->fk_type == 'SOLD') $label=' '; - if ($objp->fk_type == 'CHQ' && $objp->fk_bordereau > 0) { + if ($objp->fk_type == 'CHQ' && $objp->fk_bordereau > 0) + { dol_include_once('/compta/paiement/cheque/class/remisecheque.class.php'); $bordereaustatic = new RemiseCheque($db); $bordereaustatic->id = $objp->fk_bordereau; @@ -678,6 +689,7 @@ if ($id > 0 || ! empty($ref)) { print dol_trunc($objp->label,60); } + // Add links after description $links = $object->get_url($objp->rowid); foreach($links as $key=>$val) diff --git a/htdocs/compta/bank/bilan.php b/htdocs/compta/bank/bilan.php index edfc84c23cc..7e44778b9bd 100644 --- a/htdocs/compta/bank/bilan.php +++ b/htdocs/compta/bank/bilan.php @@ -58,7 +58,7 @@ function valeur($sql) llxHeader(); -print_titre("Bilan"); +print load_fiche_titre("Bilan"); print '
'; print ''; diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php index f22ce342bf0..c35dec41e7d 100644 --- a/htdocs/compta/bank/budget.php +++ b/htdocs/compta/bank/budget.php @@ -44,7 +44,7 @@ $companystatic=new Societe($db); llxHeader(); // List movements bu category for bank transactions -print_fiche_titre($langs->trans("BankTransactionByCategories"), '', 'title_bank.png'); +print load_fiche_titre($langs->trans("BankTransactionByCategories"), '', 'title_bank.png'); print '
'; print ""; diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 61e3dc111df..063fee8ca78 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -243,7 +243,7 @@ if ($action == 'create') { $account=new Account($db); - print_fiche_titre($langs->trans("NewFinancialAccount"), '', 'title_bank.png'); + print load_fiche_titre($langs->trans("NewFinancialAccount"), '', 'title_bank.png'); if ($conf->use_javascript_ajax) { @@ -579,7 +579,7 @@ else // State print ''; // Conciliate @@ -777,7 +777,7 @@ else $account = new Account($db); $account->fetch(GETPOST('id','int')); - print_fiche_titre($langs->trans("EditFinancialAccount"), '', 'title_bank.png'); + print load_fiche_titre($langs->trans("EditFinancialAccount"), '', 'title_bank.png'); if ($conf->use_javascript_ajax) { diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index b854503f084..1d9da7f9f59 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -108,7 +108,7 @@ if ($action == 'delete') llxHeader(); -print_fiche_titre($langs->trans("Rubriques"), '', 'title_bank.png'); +print load_fiche_titre($langs->trans("Rubriques"), '', 'title_bank.png'); print ''; print ''; @@ -158,7 +158,6 @@ if ($result) $db->free($result); } -print ""; /* * Line to add category @@ -172,9 +171,7 @@ if ($action != 'edit') print ''; } -print "
'.$langs->trans('State').''; - if ($account->fk_departement > 0) print getState($account->fk_departement); + if ($account->state_id > 0) print getState($account->state_id); print '
"; - -print ""; +print '
'; llxFooter(); diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 8ccf4107ee7..e8978310ca3 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -44,9 +44,7 @@ class Account extends CommonObject * @see id */ var $rowid; - var $id; - var $ref; var $label; //! 1=Compte courant/check/carte, 2=Compte liquide, 0=Compte épargne var $courant; @@ -75,10 +73,6 @@ class Account extends CommonObject var $state_code; var $state; - var $country_id; - var $country_code; - var $country; - var $type_lib=array(); var $account_number; @@ -122,8 +116,10 @@ class Account extends CommonObject */ function canBeConciliated() { + global $conf; + if (empty($this->rappro)) return -1; - if ($this->courant == 2) return -2; + if ($this->courant == 2 && empty($conf->global->BANK_CAN_RECONCILIATE_CASHACCOUNT)) return -2; if ($this->clos) return -3; return 1; } @@ -1086,8 +1082,8 @@ class Account extends CommonObject { $country_code=$this->getCountryCode(); - if (in_array($country_code,array('CH','DE','FR','ES','GA','IT'))) return 1; // France, Spain, Gabon - if (in_array($country_code,array('AU','BE','CA','DK','GR','GB','ID','IE','IR','KR','NL','NZ','UK','US'))) return 2; // Australia, Great Britain... + if (in_array($country_code,array('CH','FR','ES','GA','IT'))) return 1; // France, Spain, Gabon, ... + if (in_array($country_code,array('AU','BE','CA','DE','DK','GR','GB','ID','IE','IR','KR','NL','NZ','UK','US'))) return 2; // Australia, England... return 0; } @@ -1146,6 +1142,10 @@ class AccountLine extends CommonObject var $ref; var $datec; var $dateo; + + /** + * Value date + */ var $datev; var $amount; var $label; @@ -1244,7 +1244,6 @@ class AccountLine extends CommonObject } else { - dol_print_error($this->db); return -1; } } diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php new file mode 100644 index 00000000000..2290edd8cc5 --- /dev/null +++ b/htdocs/compta/bank/document.php @@ -0,0 +1,232 @@ + + * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2011 Regis Houssin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/compta/bank/document.php + * \ingroup banque + * \brief Page de gestion des documents attaches a un compte bancaire + */ +require('../../main.inc.php'); +require_once(DOL_DOCUMENT_ROOT . "/core/lib/bank.lib.php"); +require_once(DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php"); +require_once(DOL_DOCUMENT_ROOT . "/core/lib/images.lib.php"); +require_once(DOL_DOCUMENT_ROOT . "/core/class/html.formfile.class.php"); +require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; + +$langs->load("banks"); + + +$langs->load('companies'); +$langs->load('other'); + +$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('account', 'int')); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); + +$mesg = ''; +if (isset($_SESSION['DolMessage'])) { + $mesg = $_SESSION['DolMessage']; + unset($_SESSION['DolMessage']); +} + +// Security check +if ($user->societe_id) { + $action = ''; + $socid = $user->societe_id; +} +if ($user->societe_id) + $socid = $user->societe_id; +$result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account', '', '', + $fieldtype); + +// Get parameters +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); +if ($page == -1) { + $page = 0; +} +$offset = $conf->liste_limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (!$sortorder) + $sortorder = "ASC"; +if (!$sortfield) + $sortfield = "name"; + +$object = new Account($db); +if ($id) + $object->fetch($id); + +/* + * Actions + */ + +// Envoi fichier +if ($_POST["sendit"] && !empty($conf->global->MAIN_UPLOAD_DOC)) { + if ($object->fetch($id)) { + + $upload_dir = $conf->bank->dir_output . "/" . $object->ref; + + if (dol_mkdir($upload_dir) >= 0) { + $resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], + $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']), + 0, 0, $_FILES['userfile']['error']); + if (is_numeric($resupload) && $resupload > 0) { + if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) + == 1) { + // Create small thumbs for image (Ratio is near 16/9) + // Used on logon for example + $imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], + $maxwidthsmall, $maxheightsmall, '_small', $quality, + "thumbs"); + // Create mini thumbs for image (Ratio is near 16/9) + // Used on menu or for setup page for example + $imgThumbMini = vignette($upload_dir . "/" . $_FILES['userfile']['name'], + $maxwidthmini, $maxheightmini, '_mini', $quality, + "thumbs"); + } + $mesg = '
' . $langs->trans("FileTransferComplete") . '
'; + } + else { + $langs->load("errors"); + if ($resupload < 0) { // Unknown error + $mesg = '
' . $langs->trans("ErrorFileNotUploaded") . '
'; + } + else if (preg_match('/ErrorFileIsInfectedWithAVirus/', + $resupload)) { // Files infected by a virus + $mesg = '
' . $langs->trans("ErrorFileIsInfectedWithAVirus") . '
'; + } + else { // Known error + $mesg = '
' . $langs->trans($resupload) . '
'; + } + } + } + } +} + +// Delete +else if ($action == 'confirm_deletefile' && $confirm == 'yes') { + if ($object->fetch($id)) { + + $upload_dir = $conf->bank->dir_output; + $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). + + $ret = dol_delete_file($file, 0, 0, 0, $object); + if ($ret) { + setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); + } else { + setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); + } + + Header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id); + exit; + } +} + + +/* + * View + */ + +llxHeader(); + +$form = new Form($db); + +if ($id > 0 || !empty($ref)) { + if ($object->fetch($id, $ref)) { + + $upload_dir = $conf->bank->dir_output . '/' . $object->ref; + + // Onglets + $head = bank_prepare_head($object); + dol_fiche_head($head, 'document', $langs->trans("FinancialAccount"), 0, + 'account'); + + + // Construit liste des fichiers + $filearray = dol_dir_list($upload_dir, "files", 0, '', '\.meta$', + $sortfield, + (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1); + $totalsize = 0; + foreach ($filearray as $key => $file) { + $totalsize+=$file['size']; + } + + + print ''; + + // Ref + // Ref + print ''; + print ''; + + // Label + print ''; + print ''; + + // Status + print ''; + print ''; + print ''; + print ''; + print "
' . $langs->trans("Ref") . ''; + print $form->showrefnav($object, 'ref', '', 1, 'ref'); + print '
' . $langs->trans("Label") . '' . $object->label . '
' . $langs->trans("Status") . '' . $object->getLibStatut(4) . '
' . $langs->trans("NbOfAttachedFiles") . '' . count($filearray) . '
' . $langs->trans("TotalSizeOfAttachedFiles") . '' . $totalsize . ' ' . $langs->trans("bytes") . '
\n"; + print "
\n"; + + dol_htmloutput_mesg($mesg, $mesgs); + + /* + * Confirmation suppression fichier + */ + if ($action == 'delete') { + $ret = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode($_GET["urlfile"]), + $langs->trans('DeleteFile'), + $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', + '', 0, 1); + if ($ret == 'html') + print '
'; + } + + // Affiche formulaire upload + $formfile = new FormFile($db); + $formfile->form_attach_new_file(DOL_URL_ROOT . '/compta/bank/document.php?id=' . $object->id, + '', 0, 0, $user->rights->banque, 50, $object); + + + // List of document + $param = '&id=' . $object->id; + $formfile->list_of_documents($filearray, $object, 'bank', $param); + } + else { + dol_print_error($db); + } +} +else { + Header('Location: index.php'); +} + + +llxFooter(); + +$db->close(); diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index ac175b5b7d7..46b382ed080 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -51,7 +51,7 @@ llxHeader('',$langs->trans('AccountsArea'),$help_url); $link=''; if ($statut == '') $link=''.$langs->trans("IncludeClosedAccount").''; if ($statut == 'all') $link=''.$langs->trans("OnlyOpenedAccount").''; -print_fiche_titre($langs->trans("AccountsArea"),$link, 'title_bank.png'); +print load_fiche_titre($langs->trans("AccountsArea"),$link, 'title_bank.png'); // On charge tableau des comptes financiers (ouverts par defaut) diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index e69e2dce2e7..45a87fea87c 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -553,7 +553,7 @@ if ($result) if ($acct->canBeConciliated() > 0) // Si compte rapprochable { print '
'."\n"; - print_fiche_titre($langs->trans("Reconciliation"), '', 'title_bank.png'); + print load_fiche_titre($langs->trans("Reconciliation"), '', 'title_bank.png'); print '
'; print ''; print ''; @@ -596,8 +596,7 @@ if ($result) } print '
"; - print ''; + print ''; } } @@ -610,22 +609,21 @@ print '
'; // List of bank categories - print '
'; -print ''; print ''; print ''; print ''; print ''; + +print '
'; print ''; } -print ""; -print ""; +print ''; $sql = "SELECT c.label, c.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_class as a, ".MAIN_DB_PREFIX."bank_categ as c"; @@ -650,13 +648,13 @@ if ($result) { print ''; } - print ""; + print ''; $i++; } $db->free($result); } -print "
'.$langs->trans("Rubriques").''; if ($user->rights->banque->modifier) { print ' '; print '
'.img_delete($langs->trans("Remove")).'
"; +print ''; llxFooter(); diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php index 18aacc82bf9..aa9f043b2d5 100644 --- a/htdocs/compta/bank/rappro.php +++ b/htdocs/compta/bank/rappro.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * @@ -43,6 +43,7 @@ if (! $user->rights->banque->consolidate) accessforbidden(); $action=GETPOST('action', 'alpha'); $id=GETPOST('account', 'int'); + /* * Actions */ @@ -181,7 +182,7 @@ if ($resql) $var=True; $num = $db->num_rows($resql); - print_fiche_titre($langs->trans("Reconciliation").': '.$acct->label.'', '', 'title_bank.png'); + print load_fiche_titre($langs->trans("Reconciliation").': '.$acct->label.'', '', 'title_bank.png'); print '
'; // Show last bank receipts @@ -220,7 +221,7 @@ if ($resql) print ""; print "id."\">"; - print $langs->trans("InputReceiptNumber").': '; + print ''.$langs->trans("InputReceiptNumber").': '; print ''; print '
'; if ($options) diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index eb56a95f96a..9620b00098b 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -94,10 +94,10 @@ $banklinestatic=new AccountLine($db); // Load account -$acct = new Account($db); +$object = new Account($db); if ($id > 0 || ! empty($ref)) { - $acct->fetch($id, $ref); + $object->fetch($id, $ref); } if (empty($num)) @@ -107,7 +107,7 @@ if (empty($num)) */ $sql = "SELECT DISTINCT(b.num_releve) as numr"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; - $sql.= " WHERE b.fk_account = ".$acct->id; + $sql.= " WHERE b.fk_account = ".$object->id; $sql.= " ORDER BY numr DESC"; $sql.= $db->plimit($conf->liste_limit+1,$offset); @@ -120,7 +120,7 @@ if (empty($num)) $i = 0; // Onglets - $head=bank_prepare_head($acct); + $head=bank_prepare_head($object); dol_fiche_head($head,'statement',$langs->trans("FinancialAccount"),0,'account'); print ''; @@ -130,19 +130,36 @@ if (empty($num)) // Ref print ''; print ''; // Label print ''; - print ''; + print ''; print '
'.$langs->trans("Ref").''; - print $form->showrefnav($acct, 'ref', $linkback, 1, 'ref'); + print $form->showrefnav($object, 'ref', $linkback, 1, 'ref'); print '
'.$langs->trans("Label").''.$acct->label.'
'.$object->label.'
'; dol_fiche_end(); + print '
'; + + if ($object->type != 2 && $object->rappro) + { + // If not cash account and can be reconciliate + if ($user->rights->banque->consolidate) + { + print ''.$langs->trans("Conciliate").''; + } + else + { + print ''.$langs->trans("Conciliate").''; + } + } - print_barre_liste('', $page, $_SERVER["PHP_SELF"], "&account=".$acct->id, $sortfield, $sortorder,'',$numrows); + print '
'; + + + print_barre_liste('', $page, $_SERVER["PHP_SELF"], "&account=".$object->id, $sortfield, $sortorder,'',$numrows); print ''; print ''; @@ -164,13 +181,13 @@ if (empty($num)) } else { - print ''; + print ''; // Calculate start amount $sql = "SELECT sum(b.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= " WHERE b.num_releve < '".$db->escape($objp->numr)."'"; - $sql.= " AND b.fk_account = ".$acct->id; + $sql.= " AND b.fk_account = ".$object->id; $resql=$db->query($sql); if ($resql) { @@ -184,7 +201,7 @@ if (empty($num)) $sql = "SELECT sum(b.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= " WHERE b.num_releve = '".$db->escape($objp->numr)."'"; - $sql.= " AND b.fk_account = ".$acct->id; + $sql.= " AND b.fk_account = ".$object->id; $resql=$db->query($sql); if ($resql) { @@ -222,7 +239,7 @@ else $sql = "SELECT DISTINCT(b.num_releve) as num"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= " WHERE b.num_releve < '".$db->escape($num)."'"; - $sql.= " AND b.fk_account = ".$acct->id; + $sql.= " AND b.fk_account = ".$object->id; $sql.= " ORDER BY b.num_releve DESC"; dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG); @@ -244,7 +261,7 @@ else $sql = "SELECT DISTINCT(b.num_releve) as num"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= " WHERE b.num_releve > '".$db->escape($num)."'"; - $sql.= " AND b.fk_account = ".$acct->id; + $sql.= " AND b.fk_account = ".$object->id; $sql.= " ORDER BY b.num_releve ASC"; dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG); @@ -265,10 +282,10 @@ else $found=true; } - $mesprevnext ="id\">".img_previous()."  "; + $mesprevnext ="id\">".img_previous()."  "; $mesprevnext.= $langs->trans("AccountStatement")." $num"; - $mesprevnext.="   id\">".img_next().""; - print_fiche_titre($langs->trans("AccountStatement").' '.$num.', '.$langs->trans("BankAccount").' : '.$acct->getNomUrl(0),$mesprevnext, 'title_bank.png'); + $mesprevnext.="   id\">".img_next().""; + print load_fiche_titre($langs->trans("AccountStatement").' '.$num.', '.$langs->trans("BankAccount").' : '.$object->getNomUrl(0),$mesprevnext, 'title_bank.png'); print '
'; print ""; @@ -291,7 +308,7 @@ else $sql = "SELECT sum(b.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= " WHERE b.num_releve < '".$db->escape($num)."'"; - $sql.= " AND b.fk_account = ".$acct->id; + $sql.= " AND b.fk_account = ".$object->id; $resql=$db->query($sql); if ($resql) @@ -309,7 +326,7 @@ else $sql.= ", ".MAIN_DB_PREFIX."bank as b"; $sql.= " WHERE b.num_releve='".$db->escape($num)."'"; if (!isset($num)) $sql.= " OR b.num_releve is null"; - $sql.= " AND b.fk_account = ".$acct->id; + $sql.= " AND b.fk_account = ".$object->id; $sql.= " AND b.fk_account = ba.rowid"; $sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day @@ -321,7 +338,7 @@ else $i = 0; // Ligne Solde debut releve - print ""; + print ""; print "\n"; while ($i < $numrows) @@ -337,10 +354,10 @@ else // Date de valeur print '\n"; @@ -353,7 +370,7 @@ else print ''; // Description - print '"; } @@ -522,6 +539,7 @@ else print "
'.$objp->numr.'
'.$objp->numr.'
id."\"> 
id."\"> ".$langs->trans("InitialBankBalance")." :".price($total)." 
'; - print ''; + print ''; print img_previous().' '; print dol_print_date($db->jdate($objp->dv),"day") .' '; - print ''; + print ''; print img_next().''; print "'.$type_label.' '.($objp->num_chq?$objp->num_chq:'').''; + print ''; $reg=array(); preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthese on tente recherche de traduction if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]); @@ -364,7 +381,7 @@ else * Ajout les liens (societe, company...) */ $newline=1; - $links = $acct->get_url($objp->rowid); + $links = $object->get_url($objp->rowid); foreach($links as $key=>$val) { if (! $newline) print ' - '; @@ -500,7 +517,7 @@ else if ($user->rights->banque->modifier || $user->rights->banque->consolidate) { - print "rowid&account=".$acct->id."\">"; + print "rowid&account=".$object->id."\">"; print img_edit(); print "
\n"; } -$db->close(); llxFooter(); + +$db->close(); diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index d81390a0205..3a64d0cc3d1 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -152,7 +152,7 @@ if($error) $amount = GETPOST('amount','int'); } -print_fiche_titre($langs->trans("BankTransfer"), '', 'title_bank.png'); +print load_fiche_titre($langs->trans("BankTransfer"), '', 'title_bank.png'); print $langs->trans("TransferDesc"); print "

"; diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 45b10f2363c..69b95d16e03 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -75,7 +75,7 @@ if (GETPOST("mode") == 'sconly') $param='&mode=sconly'; if ($sortfield) $param.='&sortfield='.$sortfield; if ($sortorder) $param.='&sortorder='.$sortorder; -print_fiche_titre($title, ($year?"".img_previous()." ".$langs->trans("Year")." $year ".img_next()."":""), 'title_accountancy.png'); +print load_fiche_titre($title, ($year?"".img_previous()." ".$langs->trans("Year")." $year ".img_next()."":""), 'title_accountancy.png'); if ($year) $param.='&year='.$year; @@ -92,7 +92,7 @@ if ($conf->salaries->enabled) { $sal = new PaymentSalary($db); - print_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); + print load_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); $sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, u.salary as current_salary"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s, ".MAIN_DB_PREFIX."user as u"; @@ -172,7 +172,7 @@ if ($conf->tax->enabled) // Social contributions only if (GETPOST("mode") != 'sconly') { - print_fiche_titre($langs->trans("SocialContributionsPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); + print load_fiche_titre($langs->trans("SocialContributionsPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); } print ''; @@ -286,7 +286,7 @@ if ($conf->tax->enabled) $tva = new Tva($db); - print_fiche_titre($langs->trans("VATPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); + print load_fiche_titre($langs->trans("VATPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); $sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm"; $sql.= " FROM ".MAIN_DB_PREFIX."tva as pv"; @@ -386,7 +386,7 @@ while($j<$numlt) $tva = new Tva($db); - print_fiche_titre($langs->transcountry(($j==1?"LT1Payments":"LT2Payments"),$mysoc->country_code).($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); + print load_fiche_titre($langs->transcountry(($j==1?"LT1Payments":"LT2Payments"),$mysoc->country_code).($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); $sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm, pv.datep as dp"; diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 083aeb48986..d4858d5ab29 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -240,7 +240,7 @@ if ($action == 'create') //WYSIWYG Editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - print_fiche_titre($langs->trans("NewTrip")); + print load_fiche_titre($langs->trans("NewTrip")); $datec = dol_mktime(12, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int')); diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index f09875456c2..4b2dce9f14e 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -37,23 +37,13 @@ class Deplacement extends CommonObject public $fk_element = ''; protected $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - var $id; - var $datec; // Creation date var $dated; var $fk_user_author; var $fk_user; var $km; - /** - * @deprecated - * @see note_private, note_public - */ - var $note; // TODO deprecated - var $note_private; - var $note_public; var $socid; var $statut; // 0=draft, 1=validated - var $fk_project; var $extraparams=array(); var $statuts=array(); diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index b8920bb45a4..0d9d63e8bb2 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -91,7 +91,7 @@ if ($result) } -print_fiche_titre($langs->trans("ExpensesArea")); +print load_fiche_titre($langs->trans("ExpensesArea")); print '
'; diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 0d0a32a877c..1d9f7b70201 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -78,7 +78,7 @@ llxHeader(); $title=$langs->trans("TripsAndExpensesStatistics"); $dir=$conf->deplacement->dir_temp; -print_fiche_titre($title, $mesg); +print load_fiche_titre($title, $mesg); dol_mkdir($dir); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 087780fdaad..e23f1f9414a 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -42,6 +42,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; @@ -108,6 +109,8 @@ if ($id > 0 || ! empty($ref)) { $hookmanager->initHooks(array('invoicecard','globalcard')); $permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php +$permissiondellink=$user->rights->facture->creer; // Used by the include of actions_dellink.inc.php +$permissiontoedit = $user->rights->facture->creer; // Used by the include of actions_lineupdonw.inc.php /* @@ -120,7 +123,11 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once + + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once // Action clone object if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->facture->creer) { @@ -436,7 +443,7 @@ if (empty($reshook)) $ret = $object->fetch($id); // Reload to get new records $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result < 0) dol_print_error($db,$result); + if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } } else @@ -917,7 +924,11 @@ if (empty($reshook)) $exp = new Expedition($db); $exp->fetch($object->origin_id); $exp->fetchObjectLinked(); - if (count($exp->linkedObjectsIds['commande']) > 0) $object->linked_objects['commande'] = $exp->linkedObjectsIds['commande'][0]; + if (count($exp->linkedObjectsIds['commande']) > 0) { + foreach ($exp->linkedObjectsIds['commande'] as $key => $value){ + $object->linked_objects['commande'] = $value; + } + } } if (is_array($_POST['other_linked_objects']) && ! empty($_POST['other_linked_objects'])) @@ -1415,10 +1426,7 @@ if (empty($reshook)) $ret = $object->fetch($id); // Reload to get new records $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result < 0) - { - setEventMessages($object->error, $object->errors, 'errors'); - } + if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } unset($_POST['prod_entry_mode']); @@ -1644,54 +1652,6 @@ if (empty($reshook)) exit(); } - // Modify line position (up) - else if ($action == 'up' && $user->rights->facture->creer) { - $object->fetch($id); - $object->fetch_thirdparty(); - $object->line_up($_GET ['rowid']); - - // Define output language - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) - $newlang = $_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '#' . $_GET ['rowid']); - exit(); - } // Modify line position (down) - else if ($action == 'down' && $user->rights->facture->creer) { - $object->fetch($id); - $object->fetch_thirdparty(); - $object->line_down($_GET ['rowid']); - - // Define output language - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) - $newlang = $_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '#' . $_GET ['rowid']); - exit(); - } - // Link invoice to order if (GETPOST('linkedOrder')) { $object->fetch($id); @@ -1763,61 +1723,7 @@ if (empty($reshook)) else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); $action = ''; } - } - - include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; - - if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->facture->creer) - { - if ($action == 'addcontact') - { - $result = $object->fetch($id); - - if ($result > 0 && $id > 0) { - $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); - $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); - } - - if ($result >= 0) { - header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); - exit(); - } else { - if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { - $langs->load("errors"); - setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors'); - } else { - setEventMessage($object->error, 'errors'); - } - } - } - - // bascule du statut d'un contact - else if ($action == 'swapstatut') - { - if ($object->fetch($id)) { - $result = $object->swapContactStatus(GETPOST('ligne')); - } else { - dol_print_error($db); - } - } - - // Efface un contact - else if ($action == 'deletecontact') - { - $object->fetch($id); - $result = $object->delete_contact($lineid); - - if ($result >= 0) { - header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); - exit(); - } else { - dol_print_error($db); - } - } - - - if ($action == 'update_extras') - { + } elseif ($action == 'update_extras') { // Fill array 'array_options' with data from add form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); @@ -1829,18 +1735,60 @@ if (empty($reshook)) $hookmanager->initHooks(array('invoicedao')); $parameters = array('id' => $object->id); $reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been modified by - // some hooks + // some hooks if (empty($reshook)) { - $result = $object->insertExtraFields(); - if ($result < 0) { - $error ++; - } - } else if ($reshook < 0) + $result = $object->insertExtraFields(); + if ($result < 0) { $error ++; + } + } else if ($reshook < 0) + $error ++; + } + + if ($error) + $action = 'edit_extras'; + } + + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; + + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->facture->creer) { + if ($action == 'addcontact') { + $result = $object->fetch($id); + + if ($result > 0 && $id > 0) { + $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); + $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); } - if ($error) - $action = 'edit_extras'; + if ($result >= 0) { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit(); + } else { + if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $langs->load("errors"); + setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors'); + } else { + setEventMessage($object->error, 'errors'); + } + } + } // bascule du statut d'un contact + elseif ($action == 'swapstatut') { + if ($object->fetch($id)) { + $result = $object->swapContactStatus(GETPOST('ligne')); + } else { + dol_print_error($db); + } + } // Efface un contact + elseif ($action == 'deletecontact') { + $object->fetch($id); + $result = $object->delete_contact($lineid); + + if ($result >= 0) { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit(); + } else { + dol_print_error($db); + } } } } @@ -1853,6 +1801,7 @@ if (empty($reshook)) $form = new Form($db); $formother = new FormOther($db); $formfile = new FormFile($db); +$formmargin = new FormMargin($this->db); $bankaccountstatic = new Account($db); if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } @@ -1875,7 +1824,7 @@ if ($action == 'create') $facturestatic = new Facture($db); $extralabels = $extrafields->fetch_name_optionals_label($facturestatic->table_element); - print_fiche_titre($langs->trans('NewBill')); + print load_fiche_titre($langs->trans('NewBill')); $soc = new Societe($db); if ($socid > 0) @@ -2227,9 +2176,9 @@ if ($action == 'create') $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); print $desc; - print '
'; - print '    0 ? 'checked':'').' /> "; - print '
    0 ? 'checked':'').' /> "; + print '
'; + print '    0 ? 'checked':'').' /> "; + print '
    0 ? 'checked':'').' /> "; print '
'; print '
'; @@ -2287,6 +2236,10 @@ if ($action == 'create') print ''; // Bank Account + if (isset($_POST['fk_account'])) { + $fk_account = $_POST['fk_account']; + } + print '
'; @@ -2334,11 +2287,7 @@ if ($action == 'create') print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -800,10 +805,14 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) $facturestatic->total_tva=$obj->total_tva; $facturestatic->total_ttc=$obj->total_ttc; $facturestatic->type=$obj->type; + $facturestatic->statut = $obj->fk_statut; + $facturestatic->date_lim_reglement = $db->jdate($obj->datelimite); print $facturestatic->getNomUrl(1,''); print ''; print ''; print '"; + print ""; print ''; $i++; } diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index a4b699b70b7..b8a5779c708 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -184,7 +184,7 @@ print ""; print ""; print "\n"; -$var=true; +$var=false; $invoicestatic=new FactureFournisseur($db); $companystatic=new Fournisseur($db); diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index f0aeeeb6458..cddbdcaa064 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -114,8 +114,13 @@ $sql.= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ct ON fd.tva_tx = ct.taux AND fd.info_bits = ct.recuperableonly AND ct.fk_pays = '".$idpays."'"; $sql.= " WHERE f.entity = ".$conf->entity; $sql.= " AND f.fk_statut > 0"; -if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; -else $sql.= " AND f.type IN (0,1,2,3,5)"; +if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql.= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_SITUATION.")"; +} +else { + $sql.= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_STANDARD.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")"; +} + $sql.= " AND fd.product_type IN (0,1)"; if ($date_start && $date_end) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; $sql.= " ORDER BY f.rowid"; @@ -163,10 +168,15 @@ if ($result) $line = new FactureLigne($db); $line->fetch($obj->id); $prev_progress = $line->get_prev_progress(); - if ($obj->situation_percent == 0) { // Avoid divide by 0 - $situation_ratio = 0; + if ($obj->type==Facture::TYPE_SITUATION) { + // Avoid divide by 0 + if ($obj->situation_percent == 0) { + $situation_ratio = 0; + } else { + $situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent; + } } else { - $situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent; + $situation_ratio = 1; } //la ligne facture @@ -205,7 +215,7 @@ print ''; print ''; print "\n"; -$var=true; +$var=false; $invoicestatic=new Facture($db); $companystatic=new Client($db); diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index 308bcac6dc9..579d80ea919 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -154,7 +154,7 @@ if ($_GET["action"] == 'create') print ''; print ''; - print_fiche_titre($langs->transcountry($lttype==2?"newLT2Payment":"newLT1Payment",$mysoc->country_code)); + print load_fiche_titre($langs->transcountry($lttype==2?"newLT2Payment":"newLT1Payment",$mysoc->country_code)); if ($mesg) print $mesg; diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 04461117271..067c8dc9cbe 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -29,15 +29,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Localtax extends CommonObject { - var $id; - var $ref; var $ltt; var $tms; var $datep; var $datev; var $amount; var $label; - var $note; var $fk_bank; var $fk_user_creat; var $fk_user_modif; diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index 1e8570d7378..c3512fdcc1e 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -122,7 +122,7 @@ if($localTaxType==1) { $textprevyear="".img_previous().""; $textnextyear=" ".img_next().""; -print_fiche_titre($langs->transcountry($LT,$mysoc->country_code),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear"); +print load_fiche_titre($langs->transcountry($LT,$mysoc->country_code),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear"); print $langs->trans("LTReportBuildWithOptionDefinedInModule").'
'; print '('.$langs->trans("TaxModuleSetupToModifyRulesLT",DOL_URL_ROOT.'/admin/company.php').')
'; @@ -130,10 +130,10 @@ print '
'; print '
' . $langs->trans('BankAccount') . ''; $form->select_comptes($fk_account, 'fk_account', 0, '', 1); print '
' . $langs->trans('NotePublic') . ''; - $note_public = ''; - if (is_object($objectsrc)) // Take value from source object - { - $note_public = $objectsrc->note_public; - } + $note_public = $object->getDefaultCreateValueFor('note_public', (is_object($objectsrc)?$objectsrc->note_public:null)); $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); print $doleditor->Create(1); @@ -2348,11 +2297,7 @@ if ($action == 'create') print '
' . $langs->trans('NotePrivate') . ''; - $note_private = ''; - if (! empty($origin) && ! empty($originid) && is_object($objectsrc)) // Take value from source object - { - $note_private = $objectsrc->note_private; - } + $note_private = $object->getDefaultCreateValueFor('note_private', ((! empty($origin) && ! empty($originid) && is_object($objectsrc))?$objectsrc->note_private:null)); $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); print $doleditor->Create(1); // print ' @@ -2492,7 +2437,7 @@ if ($action == 'create') print '
'; $title = $langs->trans('ProductsAndServices'); - print_titre($title); + print load_fiche_titre($title); print ''; @@ -3223,7 +3168,7 @@ else if ($id > 0 || ! empty($ref)) if (! empty($conf->margin->enabled)) { print '
'; - $object->displayMarginInfos($object->statut > 0); + $formmargin->displayMarginInfos($object, $object->statut > 0); } print ''; @@ -3264,8 +3209,9 @@ else if ($id > 0 || ! empty($ref)) $form->form_date($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->date_lim_reglement, 'paymentterm'); } else { print dol_print_date($object->date_lim_reglement, 'daytext'); - if ($object->date_lim_reglement < ($now - $conf->facture->client->warning_delay) && ! $object->paye && $object->statut == 1 && ! isset($object->am)) + if ($object->hasDelay()) { print img_warning($langs->trans('Late')); + } } } else { print ' '; @@ -3578,14 +3524,17 @@ else if ($id > 0 || ! empty($ref)) // modified by hook if (empty($reshook)) { // Editer une facture deja validee, sans paiement effectue et pas exporte en compta - if ($object->statut == 1) { + if ($object->statut == 1) + { // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees $ventilExportCompta = $object->getVentilExportCompta(); - if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0) { - if (! $objectidnext && $object->is_last_in_cycle()) { + if ($resteapayer == $object->total_ttc && empty($object->paye) && $ventilExportCompta == 0) + { + if (! $objectidnext && $object->is_last_in_cycle()) + { if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->invoice_advance->unvalidate))) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->unvalidate))) { print ''; } else { @@ -3848,7 +3797,7 @@ else if ($id > 0 || ! empty($ref)) if (! $file || ! is_readable($file)) { $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); exit(); } $fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); @@ -3857,7 +3806,7 @@ else if ($id > 0 || ! empty($ref)) print '
'; print '
'; - print_fiche_titre($langs->trans($titreform)); + print load_fiche_titre($langs->trans($titreform)); // Cree l'objet formulaire mail dol_fiche_head(); @@ -3893,6 +3842,7 @@ else if ($id > 0 || ! empty($ref)) $formmail->substit['__REFCLIENT__'] = $object->ref_client; $formmail->substit['__THIRPARTY_NAME__'] = $object->thirdparty->name; $formmail->substit['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:''); + $formmail->substit['__PROJECT_NAME__'] = (is_object($object->projet)?$object->projet->title:''); $formmail->substit['__PERSONALIZED__'] = ''; $formmail->substit['__CONTACTCIVNAME__'] = ''; diff --git a/htdocs/compta/facture/admin/facture_cust_extrafields.php b/htdocs/compta/facture/admin/facture_cust_extrafields.php index 58d4e46f8dd..fa2c3ba3a1e 100644 --- a/htdocs/compta/facture/admin/facture_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_cust_extrafields.php @@ -65,7 +65,7 @@ $textobject=strtolower($langs->transnoentitiesnoconv("BillsCustomers")); llxHeader('',$langs->trans("BillsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("BillsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("BillsSetup"),$linkback,'title_setup'); print '
'; $head = invoice_admin_prepare_head(); @@ -95,7 +95,7 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print "
"; - print_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } @@ -110,7 +110,7 @@ if ($action == 'edit' && ! empty($attrname)) $langs->load("members"); print "
"; - print_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } diff --git a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php index e69060aa3cf..50749f89ab1 100644 --- a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php @@ -66,7 +66,7 @@ $textobject=strtolower($langs->transnoentitiesnoconv("BillsCustomers")); llxHeader('',$langs->trans("BillsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("BillsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("BillsSetup"),$linkback,'title_setup'); print '
'; $head = invoice_admin_prepare_head(); @@ -96,7 +96,7 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print "
"; - print_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } @@ -109,7 +109,7 @@ if ($action == 'create') if ($action == 'edit' && ! empty($attrname)) { print "
"; - print_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 7d0de20ce0b..204092b257a 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -42,35 +42,20 @@ class FactureRec extends Facture public $table_element_line='facturedet_rec'; public $fk_element='fk_facture'; - var $id; - - //! Id customer - var $socid; - //! Customer object (charging by fetch_client) - var $client; - var $number; - var $author; var $date; - var $ref; var $amount; var $remise; var $tva; var $total; - var $note_private; - var $note_public; var $db_table; var $propalid; - var $fk_project; var $rang; var $special_code; var $usenewprice=0; - var $lines=array(); - - /** * Constructor * diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index dbbc1d88212..d9e0e198456 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -58,27 +58,15 @@ class Facture extends CommonInvoice */ protected $table_ref_field = 'facnumber'; - var $id; - //! Id client var $socid; - //! Objet societe client (to load with fetch_client method) - /** - * Customer - * @var Societe - */ - var $client; var $author; var $fk_user_author; var $fk_user_valid; - //! Invoice date - var $date; // Invoice date var $date_creation; // Creation date var $date_validation; // Validation date var $datem; - var $ref; var $ref_client; - var $ref_ext; var $ref_int; //Check constants for types var $type = self::TYPE_STANDARD; @@ -90,20 +78,7 @@ class Facture extends CommonInvoice var $total_tva=0; var $total_ttc=0; var $revenuestamp; - /** - * @deprecated - * @see note_private, note_public - */ - var $note; - var $note_private; - var $note_public; - /** - * Invoice status - * @var int - * @see Facture::STATUS_DRAFT, Facture::STATUS_VALIDATED, Facture::STATUS_PAID, Facture::STATUS_ABANDONED - */ - var $statut; //! Fermeture apres paiement partiel: discount_vat, badcustomer, abandon //! Fermeture alors que aucun paiement: replaced (si remplace), abandon var $close_code; @@ -113,18 +88,11 @@ class Facture extends CommonInvoice var $paye; //! id of source invoice if replacement invoice or credit note var $fk_facture_source; - var $origin; - var $origin_id; var $linked_objects=array(); - var $fk_project; var $date_lim_reglement; - var $cond_reglement_id; // Id in llx_c_paiement var $cond_reglement_code; // Code in llx_c_paiement - var $mode_reglement_id; // Id in llx_c_paiement var $mode_reglement_code; // Code in llx_c_paiement - var $fk_account; // Id of bank account var $fk_bank; // Field to store bank id to use when payment mode is withdraw - var $modelpdf; /** * @deprecated */ @@ -139,11 +107,6 @@ class Facture extends CommonInvoice var $fac_rec; - //Incoterms - var $fk_incoterms; - var $location_incoterms; - var $libelle_incoterms; //Used into tooltip - /** * @var int Situation cycle reference number */ @@ -159,64 +122,6 @@ class Facture extends CommonInvoice */ public $situation_final; - /** - * Standard invoice - */ - const TYPE_STANDARD = 0; - - /** - * Replacement invoice - */ - const TYPE_REPLACEMENT = 1; - - /** - * Credit note invoice - */ - const TYPE_CREDIT_NOTE = 2; - - /** - * Deposit invoice - */ - const TYPE_DEPOSIT = 3; - - /** - * Proforma invoice - */ - const TYPE_PROFORMA = 4; - - /** - * Situation invoice - */ - const TYPE_SITUATION = 5; - - /** - * Draft - */ - const STATUS_DRAFT = 0; - - /** - * Validated (need to be paid) - */ - const STATUS_VALIDATED = 1; - - /** - * Classified paid. - * If paid partially, $this->close_code can be: - * - CLOSECODE_DISCOUNTVAT - * - CLOSECODE_BADDEBT - * If paid completelly, this->close_code will be null - */ - const STATUS_CLOSED = 2; - - /** - * Classified abandoned and no payment done. - * $this->close_code can be: - * - CLOSECODE_BADDEBT - * - CLOSECODE_ABANDONED - * - CLOSECODE_REPLACED - */ - const STATUS_ABANDONED = 3; - const CLOSECODE_DISCOUNTVAT = 'discount_vat'; const CLOSECODE_BADDEBT = 'badcustomer'; const CLOSECODE_ABANDONED = 'abandon'; @@ -332,7 +237,7 @@ class Facture extends CommonInvoice $sql.= "'(PROV)'"; $sql.= ", ".$conf->entity; $sql.= ", ".($this->ref_ext?"'".$this->db->escape($this->ref_ext)."'":"null"); - $sql.= ", '".$this->type."'"; + $sql.= ", '".$this->db->escape($this->type)."'"; $sql.= ", '".$socid."'"; $sql.= ", '".$this->db->idate($now)."'"; $sql.= ", ".($this->remise_absolue>0?$this->remise_absolue:'NULL'); @@ -348,7 +253,7 @@ class Facture extends CommonInvoice $sql.= ", ".($this->fk_project?$this->fk_project:"null"); $sql.= ", ".$this->cond_reglement_id; $sql.= ", ".$this->mode_reglement_id; - $sql.= ", '".$this->db->idate($datelim)."', '".$this->modelpdf."'"; + $sql.= ", '".$this->db->idate($datelim)."', '".$this->db->escape($this->modelpdf)."'"; $sql.= ", ".($this->situation_cycle_ref?"'".$this->db->escape($this->situation_cycle_ref)."'":"null"); $sql.= ", ".($this->situation_counter?"'".$this->db->escape($this->situation_counter)."'":"null"); $sql.= ", ".($this->situation_final?$this->situation_final:0); @@ -701,7 +606,7 @@ class Facture extends CommonInvoice $line->fetch_optionals($line->rowid); // Load source object - $objFrom = dol_clone($this); + $objFrom = clone $this; @@ -2345,16 +2250,26 @@ class Facture extends CommonInvoice $pu_tva = $tabprice[4]; $pu_ttc = $tabprice[5]; - // Update line into database - $this->line=new FactureLigne($this->db); + // Old properties: $price, $remise (deprecated) + $price = $pu; + $remise = 0; + if ($remise_percent > 0) + { + $remise = round(($pu * $remise_percent / 100),2); + $price = ($pu - $remise); + } + $price = price2num($price); + //Fetch current line from the database and then clone the object and set it in $oldline property + $line = new FactureLigne($this->db); + $line->fetch($rowid); + + $staticline = clone $line; + + $line->oldline = $staticline; + $this->line = $line; $this->line->context = $this->context; - // Stock previous line records - $staticline=new FactureLigne($this->db); - $staticline->fetch($rowid); - $this->line->oldline = $staticline; - // Reorder if fk_parent_line change if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) { @@ -2755,15 +2670,16 @@ class Facture extends CommonInvoice $numref = ""; $numref = $obj->getNextValue($soc,$this,$mode); - if ($numref != "") - { - return $numref; - } - else - { + /** + * $numref can be empty in case we ask for the last value because if there is no invoice created with the + * set up mask. + */ + if ($mode != 'last' && !$numref) { dol_print_error($db,"Facture::getNextNumRef ".$obj->error); return ""; } + + return $numref; } else { @@ -3236,11 +3152,15 @@ class Facture extends CommonInvoice $response->url=DOL_URL_ROOT.'/compta/facture/list.php?search_status=1'; $response->img=img_object($langs->trans("Bills"),"bill"); + $generic_facture = new Facture($this->db); + while ($obj=$this->db->fetch_object($resql)) { + $generic_facture->date_lim_reglement = $this->db->jdate($obj->datefin); + $response->nbtodo++; - if ($this->db->jdate($obj->datefin) < ($now - $conf->facture->client->warning_delay)) { + if ($generic_facture->hasDelay()) { $response->nbtodolate++; } } @@ -3697,6 +3617,25 @@ class Facture extends CommonInvoice return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); } + + /** + * Is the customer invoice delayed? + * + * @return bool + */ + public function hasDelay() + { + global $conf; + + $now = dol_now(); + + //Paid invoices have status STATUS_CLOSED + if (!$this->statut != Facture::STATUS_VALIDATED) { + return false; + } + + return $this->date_lim_reglement < ($now - $conf->facture->client->warning_delay); + } } /** @@ -3843,10 +3782,12 @@ class FactureLigne extends CommonInvoiceLine $this->fk_prev_id = $objp->fk_prev_id; $this->db->free($result); + + return 1; } else { - dol_print_error($this->db); + return -1; } } diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index eefedcdcc6e..f01c288e29e 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -118,7 +118,7 @@ $companystatic = new Societe($db); */ if ($action == 'create') { - print_fiche_titre($langs->trans("CreateRepeatableInvoice"),'','title_accountancy.png'); + print load_fiche_titre($langs->trans("CreateRepeatableInvoice"),'','title_accountancy.png'); $object = new Facture($db); // Source invoice $product_static = new Product($db); @@ -191,7 +191,7 @@ if ($action == 'create') else if (empty($conf->product->enabled)) $title = $langs->trans("Services"); - print_titre($title); + print load_fiche_titre($title); /* * Invoice lines @@ -456,7 +456,7 @@ else else if (empty($conf->product->enabled)) $title = $langs->trans("Services"); - print_titre($title); + print load_fiche_titre($title); print '
'; print ''; @@ -636,7 +636,7 @@ else $i++; } } - else print ''; + else print ''; print "
'.$langs->trans("NoneF").'
'.$langs->trans("NoneF").'
"; $db->free($resql); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index faefe63d9af..11931de6a7e 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -129,6 +129,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_montant_ht=''; $search_montant_ttc=''; $search_status=''; + $day=''; $year=''; $month=''; } @@ -190,7 +191,7 @@ if ($search_refcustomer) $sql .= natural_search('f.ref_client', $search_refcusto if ($search_societe) $sql .= natural_search('s.nom', $search_societe); if ($search_montant_ht != '') $sql.= natural_search('f.total', $search_montant_ht, 1); if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1); -if ($search_status != '') $sql.= " AND f.fk_statut = '".$db->escape($search_status)."'"; +if ($search_status >= 0 ) $sql.= " AND f.fk_statut = ".$db->escape($search_status); if ($month > 0) { if ($year > 0 && empty($day)) @@ -350,7 +351,7 @@ if ($resql) print '
'; - $liststatus=array('0'=>$langs->trans("Draft"), '1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid"), '3'=>$langs->trans("Cancel")); + $liststatus=array('0'=>$langs->trans("BillShortStatusDraft"), '1'=>$langs->trans("BillShortStatusNotPaid"), '2'=>$langs->trans("BillShortStatusPaid"), '3'=>$langs->trans("BillShortStatusCanceled")); print $form->selectarray('search_status', $liststatus, $search_status, 1); print ''; @@ -378,6 +379,8 @@ if ($resql) $facturestatic->id=$objp->facid; $facturestatic->ref=$objp->facnumber; $facturestatic->type=$objp->type; + $facturestatic->statut = $objp->fk_statut; + $facturestatic->date_lim_reglement = $db->jdate($objp->datelimite); $notetoshow=dol_string_nohtmltag(($user->societe_id>0?$objp->note_public:$objp->note),1); $paiement = $facturestatic->getSommePaiement(); @@ -417,7 +420,7 @@ if ($resql) // Date limit print ''.dol_print_date($datelimit,'day'); - if ($datelimit < ($now - $conf->facture->client->warning_delay) && ! $objp->paye && $objp->fk_statut == 1 && ! $paiement) + if ($facturestatic->hasDelay()) { print img_warning($langs->trans('Late')); } diff --git a/htdocs/compta/facture/mergepdftool.php b/htdocs/compta/facture/mergepdftool.php index d29f237c331..72276b77069 100644 --- a/htdocs/compta/facture/mergepdftool.php +++ b/htdocs/compta/facture/mergepdftool.php @@ -56,7 +56,7 @@ if (GETPOST('button_search')) } if ($option == 'late') $filter = 'paye:0'; if ($option == 'unpaidall') $filter = 'paye:0'; -if ($mode == 'sendremind' && $filter == '') $filter = 'paye:0'; +if ($mode == 'sendmassremind' && $filter == '') $filter = 'paye:0'; if ($filter == '') $filter = 'paye:0'; $search_user = GETPOST('search_user','int'); @@ -165,10 +165,12 @@ if ($action == 'presend' && GETPOST('sendmail')) '__CHECK_READ__' => '', //'__LASTNAME__' => $obj2->lastname, //'__FIRSTNAME__' => $obj2->firstname, - '__REF__' => $object->ref, + '__FACREF__' => $object->ref, // For backward compatibility + '__REF__' => $object->ref, '__REFCLIENT__' => $object->thirdparty->name ); + $subject=make_substitutions($subject, $substitutionarray); $message=make_substitutions($message, $substitutionarray); $actiontypecode='AC_FAC'; @@ -196,7 +198,7 @@ if ($action == 'presend' && GETPOST('sendmail')) } else { - //$result=$mailfile->sendfile(); + $result=$mailfile->sendfile(); if ($result) { $resultmasssend.=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); // Must not contain " @@ -246,12 +248,11 @@ if ($action == 'presend' && GETPOST('sendmail')) } } else - { + { $nbignored++; $langs->load("other"); $resultmasssend.='
'.$langs->trans('ErrorCantReadFile',$file).'
'; - dol_syslog('Failed to read file: '.$file); - break ; + dol_syslog('Failed to read file: '.$file, LOG_WARNING); } } } @@ -263,7 +264,7 @@ if ($action == 'presend' && GETPOST('sendmail')) } else { - setEventMessage($langs->trans("NoRemindSent"), 'warnings'); + setEventMessage($langs->trans("NoRemindSent"), 'warnings'); // May be object has no generated PDF file } } } @@ -543,7 +544,7 @@ if ($resql) $param.=(! empty($option)?"&option=".$option:""); - print_fiche_titre($titre,$link); + print load_fiche_titre($titre,$link); //print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',0); // We don't want pagination on this page print '
'; @@ -556,9 +557,7 @@ if ($resql) include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); - print '
'; - print_fiche_titre($langs->trans("SendRemind"),'',''); - print '
'; + dol_fiche_head(null, '', $langs->trans("SendRemind")); $topicmail="MailTopicSendRemindUnpaidInvoices"; $modelmail="facture_relance"; @@ -598,7 +597,8 @@ if ($resql) $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; print $formmail->get_form(); - print '
'."\n"; + + dol_fiche_end(); } print ''; @@ -734,6 +734,8 @@ if ($resql) $facturestatic->id=$objp->facid; $facturestatic->ref=$objp->facnumber; $facturestatic->type=$objp->type; + $facturestatic->statut=$objp->fk_statut; + $facturestatic->date_lim_reglement= $db->jdate($objp->datelimite); print ''; @@ -744,7 +746,9 @@ if ($resql) // Warning picto print ''; // PDF Picto diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index be78b422fe6..78a93d7da0d 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -356,7 +356,9 @@ if ($object->id > 0) else { print dol_print_date($object->date_lim_reglement,'daytext'); - if ($object->date_lim_reglement < ($now - $conf->facture->client->warning_delay) && ! $object->paye && $object->statut == Facture::STATUS_VALIDATED && ! isset($object->am)) print img_warning($langs->trans('Late')); + if ($object->hasDelay()) { + print img_warning($langs->trans('Late')); + } } } else diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 4eeea76abc0..f61e92687f6 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -75,7 +75,7 @@ if ($mode == 'supplier') $dir=$conf->fournisseur->dir_output.'/facture/temp'; } -print_fiche_titre($title, $mesg, 'title_accountancy.png'); +print load_fiche_titre($title, $mesg, 'title_accountancy.png'); dol_mkdir($dir); @@ -263,8 +263,11 @@ print '
'; - if ($date_limit < ($now - $conf->facture->client->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late")); + if ($facturestatic->hasDelay()) { + print img_warning($langs->trans("Late")); + } print '
'; print ''; print ''; print ''; +print ''; print ''; +print ''; print ''; +print ''; print ''; $oldyear=0; @@ -277,15 +280,21 @@ foreach ($data as $val) print ''; print ''; print ''; + print ''; print ''; + print ''; print ''; + print ''; print ''; } print ''; print ''; print ''; + print ''; print ''; + print ''; print ''; + print ''; print ''; $oldyear=$year; } diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index eac0043e56f..b0c28efe4c0 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -30,7 +30,7 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; $langs->load("bills"); echo '
'; -print_titre($langs->trans("RelatedCustomerInvoices")); +print load_fiche_titre($langs->trans("RelatedCustomerInvoices")); ?>
'.$langs->trans("Year").''.$langs->trans("NumberOfBills").'%'.$langs->trans("AmountTotal").'%'.$langs->trans("AmountAverage").'%
0?'&userid='.$userid:'').'">'.$oldyear.'000
0?'&userid='.$userid:'').'">'.$year.''.$val['nb'].''.round($val['nb_diff']).''.price(price2num($val['total'],'MT'),1).''.round($val['total_diff']).''.price(price2num($val['avg'],'MT'),1).''.round($val['avg_diff']).'
@@ -39,24 +39,26 @@ print_titre($langs->trans("RelatedCustomerInvoices")); + $objectlink) { $var=!$var; ?> > - - - + + + - + + rights->facture->lire) { echo price($total); } ?> - + +
trans("Date"); ?> trans("AmountHTShort"); ?> trans("Status"); ?>
getNomUrl(1); ?>ref_client; ?>date,'day'); ?>getNomUrl(1); ?>ref_client; ?>date,'day'); ?> rights->facture->lire) { - $total = $total + $object->total_ht; - echo price($object->total_ht); + $total = $total + $objectlink->total_ht; + echo price($objectlink->total_ht); } ?>getLibStatut(3); ?>getLibStatut(3); ?>">transnoentitiesnoconv("RemoveLink")); ?>
 
diff --git a/htdocs/compta/hrm.php b/htdocs/compta/hrm.php index 4e931ef2b9d..12b410e29af 100644 --- a/htdocs/compta/hrm.php +++ b/htdocs/compta/hrm.php @@ -67,7 +67,7 @@ $childids[]=$user->id; llxHeader(array(),$langs->trans('HRMArea')); -print_fiche_titre($langs->trans("HRMArea"),'', 'title_hrm.png'); +print load_fiche_titre($langs->trans("HRMArea"),'', 'title_hrm.png'); print '
'; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 11296bda93e..cf5d6c990aa 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Raphaël Doursenaud * * 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 @@ -80,7 +81,7 @@ $thirdpartystatic = new Societe($db); llxHeader("",$langs->trans("AccountancyTreasuryArea")); -print_fiche_titre($langs->trans("AccountancyTreasuryArea"),'','title_accountancy.png'); +print load_fiche_titre($langs->trans("AccountancyTreasuryArea"),'','title_accountancy.png'); print '
'; @@ -358,11 +359,15 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) $facturestatic->total_ht=$obj->total_ht; $facturestatic->total_tva=$obj->total_tva; $facturestatic->total_ttc=$obj->total_ttc; + $facturestatic->statut = $obj->fk_statut; + $facturestatic->date_lim_reglement = $db->jdate($obj->datelimite); $facturestatic->type=$obj->type; print $facturestatic->getNomUrl(1,''); print '
'; - if ($obj->fk_statut == 1 && ! $obj->paye && $db->jdate($obj->datelimite) < ($now - $conf->facture->client->warning_delay)) print img_warning($langs->trans("Late")); + if ($facturestatic->hasDelay()) { + print img_warning($langs->trans("Late")); + } print ''; $filename=dol_sanitizeFileName($obj->facnumber); @@ -606,7 +611,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $chargestatic->lib=$obj->libelle; $chargestatic->paye=$obj->paye; print ''.$chargestatic->getNomUrl(1).''.dol_print_date($obj->date_ech,'day').''.dol_print_date($db->jdate($obj->date_ech),'day').''.price($obj->amount).''.price($obj->sumpaid).''.$chargestatic->getLibStatut(3).''; - if ($db->jdate($obj->datelimite) < ($now - $conf->facture->client->warning_delay)) print img_warning($langs->trans("Late")); + if ($facturestatic->hasDelay()) { + print img_warning($langs->trans("Late")); + } print ''; $filename=dol_sanitizeFileName($obj->facnumber); @@ -966,7 +975,7 @@ if ($resql) $obj = $db->fetch_object($resql); $var=!$var; - print "
".dol_print_date($obj->da,"day")."
".dol_print_date($db->jdate($obj->da),"day")."'.$obj->libelle.' '.$obj->label.'
".$langs->trans("Account")."".$langs->trans("Type")."".$langs->trans("Debit")."".$langs->trans("Credit")."
'.$langs->trans('Account').''.$langs->trans('Type').''.$langs->trans('Debit').''.$langs->trans('Credit').'
'; print ''; print '
'; -print_titre($langs->transcountry($LTSummary,$mysoc->country_code)); +print load_fiche_titre($langs->transcountry($LTSummary,$mysoc->country_code)); print ' '; -print_titre($langs->transcountry($LTPaid,$mysoc->country_code)); +print load_fiche_titre($langs->transcountry($LTPaid,$mysoc->country_code)); print '
'; diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 7396c625165..0e88980796b 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -116,7 +116,7 @@ $product_static=new Product($db); $payment_static=new Paiement($db); $paymentfourn_static=new PaiementFourn($db); -//print_fiche_titre($langs->trans("VAT"),""); +//print load_fiche_titre($langs->trans("VAT"),""); //$fsearch.='
'; $fsearch.=' '; diff --git a/htdocs/compta/localtax/reglement.php b/htdocs/compta/localtax/reglement.php index 6d8c1bc7a9c..bfe0cb828c0 100644 --- a/htdocs/compta/localtax/reglement.php +++ b/htdocs/compta/localtax/reglement.php @@ -41,7 +41,7 @@ llxHeader(); $localtax_static = new Localtax($db); -print_fiche_titre($langs->transcountry($ltt==2?"LT2Payments":"LT1Payments",$mysoc->country_code)); +print load_fiche_titre($langs->transcountry($ltt==2?"LT2Payments":"LT1Payments",$mysoc->country_code)); $sql = "SELECT rowid, amount, label, f.datev as dm"; $sql.= " FROM ".MAIN_DB_PREFIX."localtax as f "; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index aaebcf697f3..5534468da35 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -277,7 +277,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $title=''; if ($facture->type != 2) $title.=$langs->trans("EnterPaymentReceivedFromCustomer"); if ($facture->type == 2) $title.=$langs->trans("EnterPaymentDueToCustomer"); - print_fiche_titre($title); + print load_fiche_titre($title); // Initialize data for confirmation (this is used because data can be change during confirmation) if ($action == 'add_paiement') @@ -658,7 +658,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $text.='
'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed"); print ''; } - $form->form_confirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type,$langs->trans('ReceivedCustomersPayments'),$text,'confirm_paiement',$formquestion,$preselectedchoice); + $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type,$langs->trans('ReceivedCustomersPayments'),$text,'confirm_paiement',$formquestion,$preselectedchoice); } print "\n"; diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index d0e15307be5..71d32404c94 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -201,27 +201,27 @@ if ($action == 'valide') print ''; // Ref -print ''; +print ''; // Date payment -print ''; // Payment type (VIR, LIQ, ...) $labeltype=$langs->trans("PaymentType".$object->type_code)!=("PaymentType".$object->type_code)?$langs->trans("PaymentType".$object->type_code):$object->type_libelle; -print ''; +print ''; // Payment numero -print ''; // Amount -print ''; +print ''; // Note -print ''; @@ -250,7 +250,8 @@ if (! empty($conf->banque->enabled)) print ''; print ''; - if($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0) { + if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0) + { dol_include_once('/compta/paiement/cheque/class/remisecheque.class.php'); $bordereau = new RemiseCheque($db); $bordereau->fetch($bankline->fk_bordereau); diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index aa496a17720..bf6ed4f807a 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -88,10 +88,6 @@ if ($action == 'setdate' && $user->rights->banque->cheque) } } -/* - * Actions - */ - if ($action == 'setrefext' && $user->rights->banque->cheque) { $result = $object->fetch(GETPOST('id','int')); @@ -231,16 +227,18 @@ if ($action == 'confirm_reject_check' && $confirm == 'yes' && $user->rights->ban $rejected_check = GETPOST('bankid'); $object->fetch($id); - $paiement_id = $object->reject_check($rejected_check, $reject_date); + $paiement_id = $object->rejectCheck($rejected_check, $reject_date); if ($paiement_id > 0) { setEventMessage($langs->trans("CheckRejectedAndInvoicesReopened")); - header("Location: ".DOL_URL_ROOT.'/compta/paiement/card.php?id='.$paiement_id); - exit; + //header("Location: ".DOL_URL_ROOT.'/compta/paiement/card.php?id='.$paiement_id); + //exit; + $action=''; } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); + $action=''; } } @@ -282,7 +280,7 @@ else if ($action == 'remove_file' && $user->rights->banque->cheque) $langs->load("other"); - $file=$dir.get_exdir($object->number,2,1,0,$object,'cheque') . GETPOST('file'); + $file=$dir.get_exdir($object->number,0,1,0,$object,'cheque') . GETPOST('file'); $ret=dol_delete_file($file,0,0,0,$object); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('file'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors'); @@ -314,7 +312,7 @@ if ($action == 'new') $hselected = $h; $h++; - print_fiche_titre($langs->trans("Cheques")); + print load_fiche_titre($langs->trans("Cheques")); } else { @@ -371,6 +369,9 @@ $accounts = array(); if ($action == 'new') { + $paymentstatic=new Paiement($db); + $accountlinestatic=new AccountLine($db); + $lines = array(); $now=dol_now(); @@ -406,9 +407,11 @@ if ($action == 'new') print ''; print '
'; - $sql = "SELECT ba.rowid as bid, b.datec as datec, b.dateo as date, b.rowid as chqid, "; - $sql.= " b.amount, ba.label, b.emetteur, b.num_chq, b.banque"; + $sql = "SELECT ba.rowid as bid, b.datec as datec, b.dateo as date, b.rowid as transactionid, "; + $sql.= " b.amount, ba.label, b.emetteur, b.num_chq, b.banque,"; + $sql.= " p.rowid as paymentid"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement as p ON p.fk_bank = b.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON (b.fk_account = ba.rowid)"; $sql.= " WHERE b.fk_type = 'CHQ'"; $sql.= " AND ba.entity IN (".getEntity('bank_account', 1).")"; @@ -430,7 +433,8 @@ if ($action == 'new') $lines[$obj->bid][$i]["emetteur"] = $obj->emetteur; $lines[$obj->bid][$i]["numero"] = $obj->num_chq; $lines[$obj->bid][$i]["banque"] = $obj->banque; - $lines[$obj->bid][$i]["id"] = $obj->chqid; + $lines[$obj->bid][$i]["id"] = $obj->transactionid; + $lines[$obj->bid][$i]["paymentid"] = $obj->paymentid; $i++; } @@ -473,6 +477,8 @@ if ($action == 'new') print '\n"; print '\n"; print '\n"; + print '\n"; + print '\n"; print ''; @@ -495,7 +501,34 @@ if ($action == 'new') print '\n"; print '\n"; print '\n"; - print ''; + print ''; + + // Link to payment + print ''; + // Link to bank transaction + print ''; + print '' ; @@ -581,6 +614,7 @@ else print ''; // External ref + /* Ext ref are not visible field on standard usage print '\n"; + $checked=($_POST["superadmin"]?' checked':''); + $disabled=($_POST["superadmin"]?'':' disabled'); + print ' '.$langs->trans("SuperAdministrator"); } + print "\n"; } // Type @@ -1038,7 +1047,7 @@ if (($action == 'create') || ($action == 'adduserldap')) { print ''; print ''; } @@ -1605,7 +1614,7 @@ else if ($canreadgroup) { - print_fiche_titre($langs->trans("ListOfGroupsForUser"),'',''); + print load_fiche_titre($langs->trans("ListOfGroupsForUser"),'',''); // On selectionne les groupes auquel fait parti le user $exclude = array(); @@ -2085,14 +2094,20 @@ else $langs->load("salaries"); // THM - print ''; + print ''; print ''; print "\n"; // TJM - print ''; + print ''; print ''; @@ -2137,7 +2152,7 @@ else { print ''; print ''; } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 81beed0a69c..31d56f0ad4b 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -44,14 +44,9 @@ class User extends CommonObject protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id=0; - var $ref; - var $ref_ext; var $ldap_sid; var $search_sid; - var $lastname; - var $firstname; var $gender; - var $note; var $email; var $skype; var $job; @@ -193,7 +188,7 @@ class User extends CommonObject if ($sid) // permet une recherche du user par son SID ActiveDirectory ou Samba { - $sql.= " AND (u.ldap_sid = '".$sid."' OR u.login = '".$this->db->escape($login)."') LIMIT 1"; + $sql.= " AND (u.ldap_sid = '".$this->db->escape($sid)."' OR u.login = '".$this->db->escape($login)."') LIMIT 1"; } else if ($login) { @@ -807,9 +802,9 @@ class User extends CommonObject /** * Create a user into database * - * @param User $user Objet user qui demande la creation - * @param int $notrigger 1 ne declenche pas les triggers, 0 sinon - * @return int <0 si KO, id compte cree si OK + * @param User $user Objet user doing creation + * @param int $notrigger 1=do not execute triggers, 0 otherwise + * @return int <0 if KO, id of created user if OK */ function create($user,$notrigger=0) { @@ -829,6 +824,12 @@ class User extends CommonObject $this->error = $langs->trans("ErrorBadEMail",$this->email); return -1; } + if (empty($this->login)) + { + $langs->load("errors"); + $this->error = $langs->trans("ErrorFieldRequired",$this->login); + return -1; + } $this->datec = dol_now(); @@ -856,7 +857,7 @@ class User extends CommonObject else { $sql = "INSERT INTO ".MAIN_DB_PREFIX."user (datec,login,ldap_sid,entity)"; - $sql.= " VALUES('".$this->db->idate($this->datec)."','".$this->db->escape($this->login)."','".$this->ldap_sid."',".$this->db->escape($this->entity).")"; + $sql.= " VALUES('".$this->db->idate($this->datec)."','".$this->db->escape($this->login)."','".$this->db->escape($this->ldap_sid)."',".$this->db->escape($this->entity).")"; $result=$this->db->query($sql); dol_syslog(get_class($this)."::create", LOG_DEBUG); @@ -1171,7 +1172,13 @@ class User extends CommonObject $this->error = $langs->trans("ErrorBadEMail",$this->email); return -1; } - + if (empty($this->login)) + { + $langs->load("errors"); + $this->error = $langs->trans("ErrorFieldRequired",$this->login); + return -1; + } + $this->db->begin(); // Update datas @@ -1179,7 +1186,7 @@ class User extends CommonObject $sql.= " lastname = '".$this->db->escape($this->lastname)."'"; $sql.= ", firstname = '".$this->db->escape($this->firstname)."'"; $sql.= ", login = '".$this->db->escape($this->login)."'"; - $sql.= ", api_key = '".$this->db->escape($this->api_key)."'"; + $sql.= ", api_key = ".($this->api_key ? "'".$this->db->escape($this->api_key)."'" : "null"); $sql.= ", gender = ".($this->gender != -1 ? "'".$this->db->escape($this->gender)."'" : "null"); // 'man' or 'woman' $sql.= ", admin = ".$this->admin; $sql.= ", address = '".$this->db->escape($this->address)."'"; @@ -1397,7 +1404,7 @@ class User extends CommonObject // Mise a jour if (! $changelater) { - if (! is_object($this->oldcopy)) $this->oldcopy=dol_clone($this); + if (! is_object($this->oldcopy)) $this->oldcopy = clone $this; $this->db->begin(); @@ -1824,9 +1831,11 @@ class User extends CommonObject * @param integer $notooltip 1=Disable tooltip * @param int $maxlen Max length of visible user name * @param int $hidethirdpartylogo Hide logo of thirdparty if user is external user + * @param string $mode 'firstname'=Show only firstname + * @param string $morecss Add more css on link * @return string String with URL */ - function getNomUrl($withpicto=0, $option='', $infologin=0, $notooltip=0, $maxlen=24, $hidethirdpartylogo=0) + function getNomUrl($withpicto=0, $option='', $infologin=0, $notooltip=0, $maxlen=24, $hidethirdpartylogo=0, $mode='',$morecss='') { global $langs, $conf, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -1876,13 +1885,15 @@ class User extends CommonObject $s=picto_from_langcode($langs->getDefaultLang()); $label.= '
'.$langs->trans("CurrentUserLanguage").': '.($s?$s.' ':'').$langs->getDefaultLang(); $label.= '
'.$langs->trans("Browser").': '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.$_SERVER['HTTP_USER_AGENT'].')'; + $label.= '
'.$langs->trans("Layout").': '.$conf->browser->layout; + $label.= '
'.$langs->trans("Screen").': '.$_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight']; if (! empty($conf->browser->phone)) $label.= '
'.$langs->trans("Phone").': '.$conf->browser->phone; if (! empty($_SESSION["disablemodules"])) $label.= '
'.$langs->trans("DisabledModules").':
'.join(', ',explode(',',$_SESSION["disablemodules"])); } $link = 'getFullName($langs,'',-1,$maxlen) . $linkend . $companylink; + $result.= $link . $this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen) . $linkend . $companylink; return $result; } diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 687c2077760..50237b0ef61 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -38,16 +38,13 @@ class UserGroup extends CommonObject public $table_element='usergroup'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - var $id; // Group id var $entity; // Entity of group /** * @deprecated * @see name */ var $nom; // Name of group - var $name; // Name of group var $globalgroup; // Global group - var $note; // Note on group var $datec; // Creation date of group var $datem; // Modification date of group var $members=array(); // Array of users diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 3de421e4f4f..4edb037d8d6 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -142,7 +142,7 @@ if ($action == 'adduser' || $action =='removeuser') if ($userid) { $object->fetch($id); - $object->oldcopy=dol_clone($object); + $object->oldcopy = clone $object; $edituser = new User($db); $edituser->fetch($userid); @@ -176,7 +176,7 @@ if ($action == 'update') $object->fetch($id); - $object->oldcopy=dol_clone($object); + $object->oldcopy = clone $object; $object->name = trim($_POST["group"]); $object->nom = $object->name; // For backward compatibility @@ -222,7 +222,7 @@ $fuserstatic = new User($db); if ($action == 'create') { - print_fiche_titre($langs->trans("NewGroup")); + print load_fiche_titre($langs->trans("NewGroup")); print dol_set_focus('#nom'); @@ -374,7 +374,7 @@ else * Liste des utilisateurs dans le groupe */ - print_fiche_titre($langs->trans("ListOfUsersInGroup"),'',''); + print load_fiche_titre($langs->trans("ListOfUsersInGroup"),'',''); // On selectionne les users qui ne sont pas deja dans le groupe $exclude = array(); diff --git a/htdocs/user/group/index.php b/htdocs/user/group/index.php index 7496d7bc816..b45615455d8 100644 --- a/htdocs/user/group/index.php +++ b/htdocs/user/group/index.php @@ -55,7 +55,7 @@ if (! $sortorder) $sortorder="ASC"; llxHeader(); -print_fiche_titre($langs->trans("ListOfGroups")); +print load_fiche_titre($langs->trans("ListOfGroups")); $sql = "SELECT g.rowid, g.nom as name, g.entity, g.datec, COUNT(DISTINCT ugu.fk_user) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."usergroup as g"; diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index f53775b9b3e..ed7122fe164 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -155,7 +155,7 @@ if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') print "
\n"; // Affichage attributs LDAP -print_titre($langs->trans("LDAPInformationsForThisGroup")); +print load_fiche_titre($langs->trans("LDAPInformationsForThisGroup")); print '
'.$langs->trans('Ref').''.$object->id.'
'.$langs->trans('Ref').''.$object->id.'
'.$form->editfieldkey("Date",'datep',$object->date,$object,$user->rights->facture->paiement).''; +print '
'.$form->editfieldkey("Date",'datep',$object->date,$object,$user->rights->facture->paiement).''; print $form->editfieldval("Date",'datep',$object->date,$object,$user->rights->facture->paiement,'datepicker','',null,$langs->trans('PaymentDateUpdateSucceeded')); print '
'.$langs->trans('PaymentMode').''.$labeltype.'
'.$langs->trans('PaymentMode').''.$labeltype.'
'.$form->editfieldkey("Numero",'num_paiement',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).''; +print '
'.$form->editfieldkey("Numero",'num_paiement',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).''; print $form->editfieldval("Numero",'num_paiement',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('PaymentNumberUpdateSucceeded')); print '
'.$langs->trans('Amount').''.price($object->montant,'',$langs,0,0,-1,$conf->currency).'
'.$langs->trans('Amount').''.price($object->montant,'',$langs,0,0,-1,$conf->currency).'
'.$form->editfieldkey("Note",'note',$object->note,$object,$user->rights->facture->paiement).''; +print '
'.$form->editfieldkey("Note",'note',$object->note,$object,$user->rights->facture->paiement).''; print $form->editfieldval("Note",'note',$object->note,$object,$user->rights->facture->paiement,'textarea'); print '
'.$langs->trans("CheckTransmitter")."'.$langs->trans("Bank")."'.$langs->trans("Amount")."'.$langs->trans("Payment")."'.$langs->trans("LineRecord")."'.$langs->trans("Select")."
"; if ($conf->use_javascript_ajax) print ''.$langs->trans("All").' / '.$langs->trans("None").''; print '
'.$value["numero"]."'.$value["emetteur"]."'.$value["banque"]."'.price($value["amount"]).''.price($value["amount"], 0, $langs, 1, -1, -1, $conf->currency).''; + $paymentstatic->id=$value["paymentid"]; + $paymentstatic->ref=$value["paymentid"]; + if ($paymentstatic->id) + { + print $paymentstatic->getNomUrl(1); + } + else + { + print ' '; + } + print ''; + $accountlinestatic->rowid=$value["id"]; + if ($accountlinestatic->rowid) + { + print $accountlinestatic->getNomUrl(1); + } + else + { + print ' '; + } + print ''; print ''; print '
'; print ''; print ''; - + */ + print ''; @@ -626,7 +661,7 @@ else print '
'; @@ -605,7 +639,8 @@ else print '
'.$langs->trans('Account').''; print $accountstatic->getNomUrl(1); print '

'; - // Liste des cheques + // List of cheques $sql = "SELECT b.rowid, b.amount, b.num_chq, b.emetteur,"; $sql.= " b.dateo as date, b.datec as datec, b.banque,"; $sql.= " p.rowid as pid, ba.rowid as bid, p.statut"; @@ -636,7 +671,7 @@ else $sql.= " WHERE ba.entity IN (".getEntity('bank_account', 1).")"; $sql.= " AND b.fk_type= 'CHQ'"; $sql.= " AND b.fk_bordereau = ".$object->id; - $sql.= " ORDER BY $sortfield $sortorder"; + $sql.= $db->order($sortfield, $sortorder); $resql = $db->query($sql); if ($resql) @@ -646,6 +681,7 @@ else print ''; $param="&id=".$object->id; + print ''; print_liste_field_titre($langs->trans("Cheques"),'','','','','width="30"'); print_liste_field_titre($langs->trans("DateChequeReceived"),$_SERVER["PHP_SELF"],"b.dateo,b.rowid", "",$param,'align="center"',$sortfield,$sortorder); @@ -653,9 +689,9 @@ else print_liste_field_titre($langs->trans("CheckTransmitter"),$_SERVER["PHP_SELF"],"b.emetteur", "",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Bank"),$_SERVER["PHP_SELF"],"b.banque", "",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"b.amount", "",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("LineRecord"),$_SERVER["PHP_SELF"],"b.rowid", "",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Payment"),$_SERVER["PHP_SELF"],"p.rowid", "",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); + print_liste_field_titre($langs->trans("LineRecord"),$_SERVER["PHP_SELF"],"b.rowid", "",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre(''); print "\n"; $i=1; $var=false; @@ -673,17 +709,7 @@ else print ''; print ''; print ''; - print ''; + // Link to payment print ''; + // Link to bank transaction + print ''; + // Action button + print ''; + print 'rowid.'">'.img_delete().''; } - else if($objp->statut == 2) { - print ''; + if ($object->statut == 1 && $objp->statut != 2) + { + print 'rowid.'">'.img_picto($langs->trans("RejectCheck"),'disable').''; + } + if ($objp->statut == 2) + { + print '   '.img_picto($langs->trans('CheckRejected'),'statut8').''; } + print ''; print ''; $var=!$var; $i++; @@ -751,7 +796,7 @@ if ($action != 'new') if ($object->statut == 1) { $filename=dol_sanitizeFileName($object->ref); - $filedir=$dir.get_exdir($object->number,2,1,0,$object,'cheque') . dol_sanitizeFileName($object->ref); + $filedir=$dir.get_exdir($object->number,0,1,0,$object,'cheque') . dol_sanitizeFileName($object->ref); $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; $formfile->show_documents('remisecheque', $filename, $filedir, $urlsource, 1, 1); diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index a51072fe2de..e70993bcaed 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2006 Rodolphe Quiedeville * Copyright (C) 2007-2011 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2015 Juanjo Menent * Copyright (C) 2015 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -36,14 +36,18 @@ class RemiseCheque extends CommonObject public $element='chequereceipt'; public $table_element='bordereau_cheque'; - var $id; var $num; var $intitule; - var $ref_ext; //! Numero d'erreur Plage 1024-1279 var $errno; - public $statut; + public $amount; + public $date_bordereau; + public $account_id; + public $account_label; + public $author_id; + public $nbcheque; + public $number; /** * Constructor @@ -548,7 +552,7 @@ class RemiseCheque extends CommonObject // We save charset_output to restore it because write_file can change it if needed for // output format that does not support UTF8. $sav_charseSupprimert_output=$outputlangs->charset_output; - $result=$docmodel->write_file($conf->banque->dir_output.'/bordereau', $this->number, $outputlangs); + $result=$docmodel->write_file($this, $conf->banque->dir_output.'/bordereau', $this->number, $outputlangs); if ($result > 0) { //$outputlangs->charset_output=$sav_charset_output; @@ -661,23 +665,38 @@ class RemiseCheque extends CommonObject } /** - * Check rejection management - * Reopen linked invoices and saves a new negative payment + * Check return management + * Reopen linked invoices and create a new negative payment. * - * @param int $bank_id Id of bank line concerned - * @param date $rejection_date Date to use on the negative payment - * @return int + * @param int $bank_id Id of bank transaction line concerned + * @param date $rejection_date Date to use on the negative payment + * @return int Id of negative payment line created */ - function reject_check($bank_id, $rejection_date) + function rejectCheck($bank_id, $rejection_date) { global $db, $user; $payment = new Paiement($db); $payment->fetch(0,0,$bank_id); + $bankline = new AccountLine($db); + $bankline->fetch($bank_id); + + /* Conciliation is allowed because when check is returned, a new line is created onto bank transaction log. + if ($bankline->rappro) + { + $this->error='ActionRefusedLineAlreadyConciliated'; + return -1; + }*/ + + $this->db->begin(); + + // Not conciliated, we can delete it + //$bankline->delete($user); // We delete + $bankaccount = $payment->fk_account; - // Get invoice list to reopen them + // Get invoices list to reopen them $sql = 'SELECT pf.fk_facture, pf.amount'; $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf'; $sql.= ' WHERE pf.fk_paiement = '.$payment->id; @@ -700,27 +719,45 @@ class RemiseCheque extends CommonObject $rejectedPayment->amounts[$obj->fk_facture] = price2num($obj->amount) * -1; } - if ($rejectedPayment->create($user) > 0) + $result = $rejectedPayment->create($user); + if ($result > 0) { - $result=$rejectedPayment->addPaymentToBank($user,'payment','(CheckRejected)',$bankaccount,'',''); + // We created a negative payment, we also add the line as bank transaction + $result=$rejectedPayment->addPaymentToBank($user,'payment','(CheckRejected)',$bankaccount,'',''); if ($result > 0) { - $payment->reject(); - return $rejectedPayment->id; + $result = $payment->reject(); + if ($result > 0) + { + $this->db->commit(); + return $rejectedPayment->id; + } + else + { + $this->db->rollback(); + return -1; + } } else { + $this->error = $rejectedPayment->error; + $this->errors = $rejectedPayment->errors; + $this->db->rollback(); return -1; } } else { + $this->error = $rejectedPayment->error; + $this->errors = $rejectedPayment->errors; + $this->db->rollback(); return -1; } } else { - $this->error=$this->db->error(); + $this->error=$this->db->lasterror(); + $this->db->rollback(); return -1; } } @@ -819,7 +856,6 @@ class RemiseCheque extends CommonObject $resql=$this->db->query($sql); if ($resql) { - $this->date_bordereau = $date; return 1; } else diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index 362493b7f19..ebe9f6e8461 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -47,7 +47,7 @@ $accountstatic=new Account($db); llxHeader('',$langs->trans("ChequesArea")); -print_fiche_titre($langs->trans("ChequesArea")); +print load_fiche_titre($langs->trans("ChequesArea")); //print '
'.dol_trunc($objp->emetteur,24).''.dol_trunc($objp->banque,24).''.price($objp->amount).''; - $accountlinestatic->rowid=$objp->rowid; - if ($accountlinestatic->rowid) - { - print $accountlinestatic->getNomUrl(1); - } - else - { - print ' '; - } - print ''; $paymentstatic->id=$objp->pid; $paymentstatic->ref=$objp->pid; @@ -696,14 +722,33 @@ else print ' '; } print ''; + $accountlinestatic->rowid=$objp->rowid; + if ($accountlinestatic->rowid) + { + print $accountlinestatic->getNomUrl(1); + } + else + { + print ' '; + } + print ''; if ($object->statut == 0) { - print 'rowid.'">'.img_delete().''; - print 'rowid.'">'.img_picto($langs->trans("RejectCheck"),'disable').''.img_picto($langs->trans('CheckRejected'),'statut8').'
'; //print '
'; diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 8f1e4cbb0ef..d44aef51dce 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -120,7 +120,7 @@ if ($resql) print ''; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bc.number","",$params,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"dp","",$params,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"dp","",$params,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$params,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("NbOfCheques"),$_SERVER["PHP_SELF"],"bc.nbcheque","",$params,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"bc.amount","",$params,'align="right"',$sortfield,$sortorder); @@ -164,7 +164,7 @@ if ($resql) print ''; // Date - print ''; + print ''; // TODO Use date hour // Bank print ''; - print ''; + print ''; print ''; diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index 142ea7b5a4a..8f23036f6af 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -88,7 +88,7 @@ $formother=new FormOther($db); llxHeader(); $titre=($year?$langs->trans("PaymentsReportsForYear",$year):$langs->trans("PaymentsReports")); -print_fiche_titre($titre,'','title_accountancy.png'); +print load_fiche_titre($titre,'','title_accountancy.png'); // Formulaire de generation print ''; diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 173226f6ab5..30a3d17ab3f 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -162,7 +162,7 @@ if ($_GET["action"] == 'create') $total = $charge->amount; - print_fiche_titre($langs->trans("DoPayment")); + print load_fiche_titre($langs->trans("DoPayment")); print "
\n"; if ($mesg) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 3f813e00938..38f83c5ac54 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -37,8 +37,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; */ class BonPrelevement extends CommonObject { - var $db; - var $date_echeance; var $raison_sociale; var $reference_remise; diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 64ec4ad1895..7e81e181d11 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -106,7 +106,7 @@ $h++; dol_fiche_head($head, $hselected, $langs->trans("StandingOrders"), 0, 'payment'); */ -print_fiche_titre($langs->trans("NewStandingOrder")); +print load_fiche_titre($langs->trans("NewStandingOrder")); dol_fiche_head(); @@ -183,7 +183,7 @@ if ($resql) $num = $db->num_rows($resql); $i = 0; - print_fiche_titre($langs->trans("InvoiceWaitingWithdraw").($num > 0?' ('.$num.')':''),'',''); + print load_fiche_titre($langs->trans("InvoiceWaitingWithdraw").($num > 0?' ('.$num.')':''),'',''); print '
'.dol_print_date($db->jdate($objp->dp),'day').''.dol_print_date($db->jdate($objp->dp),'day').''; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index e45d0936bcc..7e92a608c52 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -36,8 +36,6 @@ class Paiement extends CommonObject public $element='payment'; public $table_element='paiement'; - var $id; - var $ref; var $facid; var $datepaye; /** @@ -59,8 +57,6 @@ class Paiement extends CommonObject var $num_paiement; // Numero du CHQ, VIR, etc... var $bank_account; // Id compte bancaire du paiement var $bank_line; // Id de la ligne d'ecriture bancaire - var $fk_account; // Id of bank account - var $note; // fk_paiement dans llx_paiement est l'id du type de paiement (7 pour CHQ, ...) // fk_paiement dans llx_paiement_facture est le rowid du paiement @@ -697,9 +693,11 @@ class Paiement extends CommonObject } } - /* - * \brief Information sur l'objet - * \param id id du paiement dont il faut afficher les infos + /** + * Information sur l'objet + * + * @param int $id id du paiement dont il faut afficher les infos + * @return void */ function info($id) { diff --git a/htdocs/compta/paiement/index.php b/htdocs/compta/paiement/index.php index 89a57fdc79f..8575db70288 100644 --- a/htdocs/compta/paiement/index.php +++ b/htdocs/compta/paiement/index.php @@ -29,7 +29,7 @@ if (!$user->admin && $user->societe_id > 0) llxHeader(); -print_fiche_titre("Payments"); +print load_fiche_titre("Payments"); diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index d284a128631..c688ca780d4 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -28,6 +28,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $langs->load("bills"); $langs->load("compta"); @@ -36,6 +38,10 @@ $langs->load("compta"); $facid =GETPOST('facid','int'); $socid =GETPOST('socid','int'); $userid=GETPOST('userid','int'); +$day = GETPOST('day','int'); +$month = GETPOST('month','int'); +$year = GETPOST('year','int'); + if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'facture',$facid,''); @@ -66,6 +72,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_amount=""; $search_paymenttype=""; $search_company=""; + $day=''; + $year=''; + $month=''; } // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array @@ -81,6 +90,7 @@ $extrafields = new ExtraFields($db); llxHeader('', $langs->trans('ListPayment')); $form=new Form($db); +$formother=new FormOther($db); if (GETPOST("orphelins")) { @@ -141,6 +151,19 @@ else else $sql.= " AND f.fk_user_author = ".$userid; } // Search criteria + if ($month > 0) + { + if ($year > 0 && empty($day)) + $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'"; + else if ($year > 0 && ! empty($day)) + $sql.= " AND p.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; + else + $sql.= " AND date_format(p.datep, '%m') = '".$month."'"; + } + else if ($year > 0) + { + $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; + } if ($search_ref > 0) $sql .=" AND p.rowid=".$search_ref; if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account; if ($search_paymenttype != "") $sql .=" AND c.code='".$db->escape($search_paymenttype)."'"; @@ -194,7 +217,11 @@ if ($resql) print ''; print ''; print ' '; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + $formother->select_year($year?$year:-1,'year',1, 20, 5); + print ''; print ''; print '
'; print ''; @@ -248,7 +248,7 @@ else */ $limit=5; -print_fiche_titre($langs->trans("LastWithdrawalReceipts",$limit),'',''); +print load_fiche_titre($langs->trans("LastWithdrawalReceipts",$limit),'',''); $sql = "SELECT p.rowid, p.ref, p.amount, p.statut"; $sql.= ", p.datec"; diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index 0e9174ef034..83de06bc13c 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -120,7 +120,7 @@ if ($prev_id) $num = $db->num_rows($resql); $i = 0; - print_fiche_titre($langs->trans("StatisticsByLineStatus"),'',''); + print load_fiche_titre($langs->trans("StatisticsByLineStatus"),'',''); print"\n\n"; print '
'; diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 36e4ed71341..7c700dfeabb 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -64,7 +64,7 @@ if (prelevement_check_config() < 0) print ''; } -print_fiche_titre($langs->trans("CustomersStandingOrdersArea")); +print load_fiche_titre($langs->trans("CustomersStandingOrdersArea")); print '
'; diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index c3667f8b69f..5e20815469c 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -45,7 +45,7 @@ $result = restrictedArea($user, 'prelevement','','','bons'); llxHeader('',$langs->trans("WithdrawStatistics")); -print_fiche_titre($langs->trans("Statistics")); +print load_fiche_titre($langs->trans("Statistics")); // Define total and nbtotal $sql = "SELECT sum(pl.amount), count(pl.amount)"; @@ -73,7 +73,7 @@ if ($resql) */ print '
'; -print_titre($langs->trans("WithdrawStatistics")); +print load_fiche_titre($langs->trans("WithdrawStatistics")); $ligne=new LignePrelevement($db,$user); @@ -143,7 +143,7 @@ else * */ print '
'; -print_titre($langs->trans("WithdrawRejectStatistics")); +print load_fiche_titre($langs->trans("WithdrawRejectStatistics")); // Define total and nbtotal diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 19ac5705ef1..cfcd0a6f746 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -84,7 +84,7 @@ if ($socid > 0) if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { // Factures - print_fiche_titre($langs->trans("CustomerPreview")); + print load_fiche_titre($langs->trans("CustomerPreview")); print '
'; diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index d9ad2825c88..bd3b8cd2753 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -309,7 +309,7 @@ if ($modecompta == 'CREANCES-DETTES') } else { - $sql = "SELECT s.nom, s.rowid as socid, sum(pf.amount) as amount_ttc"; + $sql = "SELECT s.nom as name, s.rowid as socid, sum(pf.amount) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p"; $sql.= ", ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as f"; @@ -554,13 +554,20 @@ if ($mysoc->tva_assuj == 'franchise') // Non assujeti if ($conf->salaries->enabled) { - print ''; - $sql = "SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; + if ($modecompta == 'CREANCES-DETTES') { + $column = 'p.datev'; + } else { + $column = 'p.datep'; + } + + print ''; + $sql = "SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user"; $sql.= " WHERE p.entity = ".$conf->entity; if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; + $sql.= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm"; $sql.= " ORDER BY u.firstname"; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 94cac967a40..6c768821cc7 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -477,9 +477,16 @@ $reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$acti /* * Salaries */ + +if ($modecompta == 'CREANCES-DETTES') { + $column = 'p.datev'; +} else { + $column = 'p.datep'; +} + $subtotal_ht = 0; $subtotal_ttc = 0; -$sql = "SELECT p.label as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; +$sql = "SELECT p.label as nom, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; $sql.= " WHERE p.entity = ".$conf->entity; $sql.= " GROUP BY p.label, dm"; diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php index f96531b059c..04fc8db5b28 100644 --- a/htdocs/compta/salaries/card.php +++ b/htdocs/compta/salaries/card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2011-2015 Alexandre Spangaro * Copyright (C) 2014 Laurent Destailleur * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Charlie BENKE @@ -83,7 +83,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) $object->note=GETPOST("note"); $object->type_payment=GETPOST("paymenttype"); $object->num_payment=GETPOST("num_payment"); - $object->fk_user_creat=$user->id; + $object->fk_user_author=$user->id; // Set user current salary as ref salaray for the payment $fuser=new User($db); @@ -225,52 +225,52 @@ if ($action == 'create') print ''; print ''; - print_fiche_titre($langs->trans("NewSalaryPayment"),'', 'title_accountancy.png'); + print load_fiche_titre($langs->trans("NewSalaryPayment"),'', 'title_accountancy.png'); dol_fiche_head('', ''); print '
'.$langs->trans("Salaries").'
'.$langs->trans("Salaries").'
'; print ""; - print ''; - print ''; // Employee print ""; - print ''; // Label - print ''; + print ''; print ""; - print ''; - print ''; // Amount - print ''; + print ''; // Bank if (! empty($conf->banque->enabled)) { - print ''; } // Type payment - print '\n"; print ""; @@ -278,9 +278,10 @@ if ($action == 'create') if (! empty($conf->banque->enabled)) { // Number - print ''."\n"; + print ''; + print ''."\n"; } // Other attributes @@ -314,7 +315,6 @@ if ($id) dol_fiche_head($head, 'card', $langs->trans("SalaryPayment"), 0, 'payment'); - print '
'.$langs->trans("DatePayment").''; + print ''; print $form->select_date((empty($datep)?-1:$datep),"datep",'','','','add',1,1); print '
'.$langs->trans("DateValue").''; + print '
'; print $form->select_date((empty($datev)?-1:$datev),"datev",'','','','add',1,1); print '
'.$langs->trans("Employee").''; + print ''; print $form->select_dolusers(GETPOST('fk_user','int'),'fk_user',1); print '
'.$langs->trans("Label").'trans("SalaryPayment")).'">
trans("SalaryPayment")).'">
'.$langs->trans("DateStartPeriod").''; + print ''; print $form->select_date($datesp,"datesp",'','','','add'); print '
'.$langs->trans("DateEndPeriod").''; + print '
'; print $form->select_date($dateep,"dateep",'','','','add'); print '
'.$langs->trans("Amount").'
'.$langs->trans("Account").''; + print '
'; $form->select_comptes($_POST["accountid"],"accountid",0,'',1); // Affiche liste des comptes courant print '
'.$langs->trans("PaymentMode").''; + print '
'; $form->select_types_paiements(GETPOST("paymenttype"), "paymenttype"); print "
'.$langs->trans('Numero'); + print '
'; print ""; diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index cc0029620cb..a4bee09d7de 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2011-2015 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -34,9 +34,6 @@ class PaymentSalary extends CommonObject //public $element='payment_salary'; //!< Id that identify managed objects //public $table_element='payment_salary'; //!< Name of table without prefix where object is stored - var $id; - var $ref; - var $tms; var $fk_user; var $datep; @@ -47,9 +44,8 @@ class PaymentSalary extends CommonObject var $label; var $datesp; var $dateep; - var $note; var $fk_bank; - var $fk_user_creat; + var $fk_user_author; var $fk_user_modif; @@ -85,7 +81,7 @@ class PaymentSalary extends CommonObject $this->label=trim($this->label); $this->note=trim($this->note); $this->fk_bank=trim($this->fk_bank); - $this->fk_user_creat=trim($this->fk_user_creat); + $this->fk_user_author=trim($this->fk_user_author); $this->fk_user_modif=trim($this->fk_user_modif); // Check parameters @@ -112,7 +108,7 @@ class PaymentSalary extends CommonObject $sql.= " dateep=".$this->db->idate($this->dateep).","; $sql.= " note='".$this->db->escape($this->note)."',"; $sql.= " fk_bank=".($this->fk_bank > 0 ? "'".$this->fk_bank."'":"null").","; - $sql.= " fk_user_creat='".$this->fk_user_creat."',"; + $sql.= " fk_user_author='".$this->fk_user_author."',"; $sql.= " fk_user_modif='".$this->fk_user_modif."'"; $sql.= " WHERE rowid=".$this->id; @@ -171,7 +167,7 @@ class PaymentSalary extends CommonObject $sql.= " s.dateep,"; $sql.= " s.note,"; $sql.= " s.fk_bank,"; - $sql.= " s.fk_user_creat,"; + $sql.= " s.fk_user_author,"; $sql.= " s.fk_user_modif,"; $sql.= " b.fk_account,"; $sql.= " b.fk_type,"; @@ -203,7 +199,7 @@ class PaymentSalary extends CommonObject $this->dateep = $this->db->jdate($obj->dateep); $this->note = $obj->note; $this->fk_bank = $obj->fk_bank; - $this->fk_user_creat = $obj->fk_user_creat; + $this->fk_user_author = $obj->fk_user_author; $this->fk_user_modif = $obj->fk_user_modif; $this->fk_account = $obj->fk_account; $this->fk_type = $obj->fk_type; @@ -275,7 +271,7 @@ class PaymentSalary extends CommonObject $this->dateep=''; $this->note=''; $this->fk_bank=''; - $this->fk_user_creat=''; + $this->fk_user_author=''; $this->fk_user_modif=''; } @@ -290,13 +286,14 @@ class PaymentSalary extends CommonObject global $conf,$langs; $error=0; + $now=dol_now(); // Clean parameters $this->amount=price2num(trim($this->amount)); $this->label=trim($this->label); $this->note=trim($this->note); $this->fk_bank=trim($this->fk_bank); - $this->fk_user_creat=trim($this->fk_user_creat); + $this->fk_user_author=trim($this->fk_user_author); $this->fk_user_modif=trim($this->fk_user_modif); // Check parameters @@ -340,7 +337,8 @@ class PaymentSalary extends CommonObject $sql.= ", label"; $sql.= ", datesp"; $sql.= ", dateep"; - $sql.= ", fk_user_creat"; + $sql.= ", fk_user_author"; + $sql.= ", datec"; $sql.= ", fk_bank"; $sql.= ", entity"; $sql.= ") "; @@ -357,6 +355,7 @@ class PaymentSalary extends CommonObject $sql.= ", '".$this->db->idate($this->datesp)."'"; $sql.= ", '".$this->db->idate($this->dateep)."'"; $sql.= ", '".$user->id."'"; + $sql.= ", '".$this->db->idate($now)."'"; $sql.= ", NULL"; $sql.= ", ".$conf->entity; $sql.= ")"; @@ -511,4 +510,41 @@ class PaymentSalary extends CommonObject return $result; } + /** + * Information on record + * + * @param int $id Id of record + * @return void + */ + function info($id) + { + $sql = 'SELECT ps.rowid, ps.datec, ps.fk_user_author'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'payment_salary as ps'; + $sql.= ' WHERE ps.rowid = '.$id; + + dol_syslog(get_class($this).'::info', LOG_DEBUG); + $result = $this->db->query($sql); + + if ($result) + { + if ($this->db->num_rows($result)) + { + $obj = $this->db->fetch_object($result); + $this->id = $obj->rowid; + if ($obj->fk_user_author) + { + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_author); + $this->user_creation = $cuser; + } + $this->date_creation = $this->db->jdate($obj->datec); + } + $this->db->free($result); + } + else + { + dol_print_error($this->db); + } + } + } diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php index 773ec79f796..5926d42bb8e 100644 --- a/htdocs/compta/salaries/index.php +++ b/htdocs/compta/salaries/index.php @@ -191,17 +191,18 @@ if ($result) // Type print ''; // Amount - print ""; - print ""; + print ""; + print ""; print "\n"; $total = $total + $obj->amount; $i++; } + print ''; print '"; - print ""; + print ""; print "
'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'".price($obj->amount,0,$outputlangs,1,-1,-1,$conf->currency)." ".price($obj->amount)."
'.$langs->trans("Total").''.price($total,0,$outputlangs,1,-1,-1,$conf->currency)." 
"; diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index 7be1360287c..29606fa6a9a 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -232,7 +232,7 @@ llxHeader("",$langs->trans("SocialContribution"),$help_url); // Mode creation if ($action == 'create') { - print_fiche_titre($langs->trans("NewSocialContribution")); + print load_fiche_titre($langs->trans("NewSocialContribution")); $var=false; diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index dc70126ab9e..7712fd09029 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -39,8 +39,6 @@ class ChargeSociales extends CommonObject */ protected $table_ref_field = 'ref'; - var $id; - var $ref; var $date_ech; var $lib; var $type; diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index ade44bff415..e3bf17b3418 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -33,9 +33,6 @@ class PaymentSocialContribution extends CommonObject public $element='paiementcharge'; //!< Id that identify managed objects public $table_element='paiementcharge'; //!< Name of table without prefix where object is stored - var $id; - var $ref; - var $fk_charge; var $datec=''; var $tms=''; @@ -49,7 +46,6 @@ class PaymentSocialContribution extends CommonObject var $amounts=array(); // Array of amounts var $fk_typepaiement; var $num_paiement; - var $note; var $fk_bank; var $fk_user_creat; var $fk_user_modif; diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 3afbba0df79..639bf51fefd 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -136,7 +136,7 @@ if ($resql) if ($year) { - print_fiche_titre($langs->trans("SocialContributions"),($year?"".img_previous()." ".$langs->trans("Year")." $year ".img_next()."":"")); + print load_fiche_titre($langs->trans("SocialContributions"),($year?"".img_previous()." ".$langs->trans("Year")." $year ".img_next()."":"")); } else { diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index e5acabd4e19..688f88759c4 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -33,7 +33,9 @@ $langs->load("banks"); $langs->load("bills"); $id=GETPOST("id",'int'); -$action=GETPOST('action'); +$action=GETPOST("action","alpha"); +$refund=GETPOST("refund","int"); +if (empty($refund)) $refund=0; // Security check $socid = isset($_GET["socid"])?$_GET["socid"]:''; @@ -46,7 +48,6 @@ $tva = new Tva($db); $hookmanager->initHooks(array('taxvatcard','globalcard')); - /** * Actions */ @@ -69,7 +70,12 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) $tva->num_payment=GETPOST("num_payment"); $tva->datev=$datev; $tva->datep=$datep; - $tva->amount=GETPOST("amount"); + + $amount = GETPOST("amount"); + if ($refund == 1) { + $amount= -$amount; + } + $tva->amount= $amount; $tva->label=GETPOST("label"); $tva->note=GETPOST("note"); @@ -161,8 +167,8 @@ if ($action == 'delete') /* -* View -*/ + * View + */ llxHeader(); @@ -182,12 +188,46 @@ if ($id) // Formulaire saisie tva if ($action == 'create') { - print "\n"; + print load_fiche_titre($langs->trans("VAT") . ' - ' . $langs->trans("New")); + + if (! empty($conf->use_javascript_ajax)) + { + print "\n".''."\n"; + } + + print ''; print ''; print ''; - print_fiche_titre($langs->trans("NewVATPayment")); - + print '
'; + print '
'; + print $langs->trans("Type").':   '; + print '
'; + print ''; + print '   '; + print ''; + print '
'; + print "
\n"; + dol_fiche_head(); print ''; @@ -202,7 +242,12 @@ if ($action == 'create') print ''; // Label - print ''; + if ($refund == 1) { + $label = $langs->trans("VATRefund"); + } else { + $label = $langs->trans("VATPayment"); + } + print ''; // Amount print ''; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index a938087c689..d556a84a804 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur - * Copyright (C) 2011-2014 Alexandre Spangaro + * Copyright (C) 2011-2015 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,9 +35,6 @@ class Tva extends CommonObject //public $element='tva'; //!< Id that identify managed objects //public $table_element='tva'; //!< Name of table without prefix where object is stored - var $id; - var $ref; - var $tms; var $datep; var $datev; @@ -45,7 +42,6 @@ class Tva extends CommonObject var $type_payment; var $num_payment; var $label; - var $note; var $fk_bank; var $fk_user_creat; var $fk_user_modif; @@ -508,7 +504,7 @@ class Tva extends CommonObject $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")); return -3; } - if ($this->amount < 0 || $this->amount == '') + if ($this->amount == '') { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")); return -4; @@ -577,8 +573,12 @@ class Tva extends CommonObject $result=$acc->fetch($this->accountid); if ($result <= 0) dol_print_error($this->db); - $bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, -abs($this->amount), '', '', $user); - + if ($this->amount > 0) { + $bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, -abs($this->amount), '', '', $user); + } else { + $bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, abs($this->amount), '', '', $user); + } + // Update fk_bank into llx_tva. So we know vat line used to generate bank transaction if ($bank_line_id > 0) { diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 0625dd4978d..b2a2d6b2638 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -227,7 +227,7 @@ $vatsup=$langs->trans("VATPaid"); // VAT Received //print "
"; -//print_titre($vatcust); +//print load_fiche_titre($vatcust); print "
'.$langs->trans("Label").'trans("VATPayment")).'">
'.$langs->trans("Label").'
'.$langs->trans("Amount").'
"; print ""; @@ -306,7 +306,7 @@ if (is_array($coll_list)) { // VAT Paid //print "
"; -//print_titre($vatsup); +//print load_fiche_titre($vatsup); //print "
"; print ""; diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index c84c7d2b633..a5f45d0c72c 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -116,7 +116,7 @@ $tva = new Tva($db); $textprevyear="".img_previous().""; $textnextyear=" ".img_next().""; -print_fiche_titre($langs->trans("VAT"),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear"); +print load_fiche_titre($langs->trans("VAT"),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear"); print $langs->trans("VATReportBuildWithOptionDefinedInModule").'
'; print '('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')
'; @@ -124,12 +124,12 @@ print '
'; print '
'; print ''; print ''; print ''; print ''; - while ($i < $num) { + while ($i < $num) + { $objp = $this->db->fetch_object($resqlorderlist); - if ($objp->socid == $societe->id) { - $var = ! $var; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - } + + $var = ! $var; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; $i ++; } @@ -5055,10 +5063,7 @@ class Form $next_ref = $object->ref_next?''.(empty($conf->dol_use_jmobile)?'>':' ').'':''; //print "xx".$previous_ref."x".$next_ref; - //if ($previous_ref || $next_ref || $morehtml) { - //$ret.='
'; -print_titre($langs->trans("VATSummary")); +print load_fiche_titre($langs->trans("VATSummary")); // The report mode is the one defined by defaut in tax module setup //print $modetax; //print '('.$langs->trans("SeeVATReportInInputOutputMode",'','').')'; print ''; -print_titre($langs->trans("VATPaid")); +print load_fiche_titre($langs->trans("VATPaid")); print '
'; diff --git a/htdocs/compta/tva/quadri.php b/htdocs/compta/tva/quadri.php index 3918b56c3bf..a8434a70868 100644 --- a/htdocs/compta/tva/quadri.php +++ b/htdocs/compta/tva/quadri.php @@ -190,12 +190,12 @@ llxHeader(); $textprevyear="".img_previous().""; $textnextyear=" ".img_next().""; -print_fiche_titre($langs->trans("VAT"),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear"); +print load_fiche_titre($langs->trans("VAT"),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear"); echo ''; echo ''; echo ''; diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index f551e92cb9d..cedc38a2143 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -115,7 +115,7 @@ $product_static=new Product($db); $payment_static=new Paiement($db); $paymentfourn_static=new PaiementFourn($db); -//print_fiche_titre($langs->trans("VAT"),""); +//print load_fiche_titre($langs->trans("VAT"),""); //$fsearch.='
'; $fsearch.=' '; diff --git a/htdocs/compta/tva/quarter_report.php b/htdocs/compta/tva/quarter_report.php index 09a6622147e..e906b65ed4f 100644 --- a/htdocs/compta/tva/quarter_report.php +++ b/htdocs/compta/tva/quarter_report.php @@ -135,7 +135,7 @@ $product_static=new Product($db); $payment_static=new Paiement($db); $paymentfourn_static=new PaiementFourn($db); -//print_fiche_titre($langs->trans("VAT"),""); +//print load_fiche_titre($langs->trans("VAT"),""); //$fsearch.='
'; $fsearch.=' '; diff --git a/htdocs/compta/ventilation/card.php b/htdocs/compta/ventilation/card.php index 7201dfe9e29..463f8884242 100644 --- a/htdocs/compta/ventilation/card.php +++ b/htdocs/compta/ventilation/card.php @@ -112,7 +112,7 @@ if($_GET["id"]) } - print_fiche_titre("Ventilation"); + print load_fiche_titre("Ventilation"); print '
'; -print_fiche_titre($langs->trans("VATSummary")); +print load_fiche_titre($langs->trans("VATSummary")); echo '
'; diff --git a/htdocs/compta/ventilation/fournisseur/card.php b/htdocs/compta/ventilation/fournisseur/card.php index d62694512fc..9c69b613697 100644 --- a/htdocs/compta/ventilation/fournisseur/card.php +++ b/htdocs/compta/ventilation/fournisseur/card.php @@ -101,7 +101,7 @@ if($_GET["id"]) } - print_titre("Ventilation"); + print load_fiche_titre("Ventilation"); print '
'; print ''; diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index ad628fd6574..7e43270a32c 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -207,7 +207,7 @@ abstract class ActionsContactCardCommon { $this->object->fetch($_POST["contactid"]); - $this->object->oldcopy=dol_clone($this->object); + $this->object->oldcopy = clone $this->object; $this->assign_post(); diff --git a/htdocs/contact/canvas/default/actions_contactcard_default.class.php b/htdocs/contact/canvas/default/actions_contactcard_default.class.php index 3bfcf347c3f..30a52469da2 100644 --- a/htdocs/contact/canvas/default/actions_contactcard_default.class.php +++ b/htdocs/contact/canvas/default/actions_contactcard_default.class.php @@ -29,12 +29,6 @@ include_once DOL_DOCUMENT_ROOT.'/contact/canvas/actions_contactcard_common.class */ class ActionsContactCardDefault extends ActionsContactCardCommon { - var $db; - var $dirmodule; - var $targetmodule; - var $canvas; - var $card; - /** * Constructor * diff --git a/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php index 70d6b41bf35..3fce45b848f 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php @@ -20,7 +20,7 @@ control->tpl['title']); +print load_fiche_titre($this->control->tpl['title']); dol_htmloutput_errors((is_numeric($object->error)?'':$object->error),$object->errors); diff --git a/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php index 3be1d16bc8d..c275902d384 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php @@ -23,7 +23,7 @@ $contact = $GLOBALS['objcanvas']->control->object; control->tpl['title']); +print load_fiche_titre($this->control->tpl['title']); dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']); diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 77c3b7a318c..92d3913814f 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -289,7 +289,7 @@ if (empty($reshook)) $object->fetch($contactid); - $object->oldcopy=dol_clone($object); + $object->oldcopy = clone$object; $object->old_lastname = GETPOST("old_lastname"); $object->old_firstname = GETPOST("old_firstname"); @@ -443,7 +443,7 @@ else $title = $addcontact = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); $linkback=''; - print_fiche_titre($title,$linkback,'title_companies.png'); + print load_fiche_titre($title,$linkback,'title_companies.png'); // Affiche les erreurs dol_htmloutput_errors(is_numeric($error)?'':$error,$errors); @@ -626,7 +626,7 @@ else // Add personnal information - print_fiche_titre('
'.$langs->trans("PersonalInformations").'
','',''); + print load_fiche_titre('
'.$langs->trans("PersonalInformations").'
','',''); print '
Facture
'; @@ -646,7 +646,7 @@ else print ''; + print ''; } else { @@ -1151,7 +1151,7 @@ else print '
: '; if ($object->birthday_alert) { - print '
'; print $langs->trans("ExportCardToFormat").''; - print ''; + print ''; print img_picto($langs->trans("VCard"),'vcard.png').' '; print $langs->trans("VCard"); print ''; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 0d9f4116026..9673e1923ac 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -41,11 +41,7 @@ class Contact extends CommonObject public $table_element='socpeople'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - var $id; - var $ref_ext; var $civility_id; // In fact we store civility_code - var $lastname; - var $firstname; var $address; var $zip; var $town; @@ -69,10 +65,6 @@ class Contact extends CommonObject var $state_code; // Code of department var $state; // Label of department - var $country_id; // Id of country - var $country_code; // Code of country - var $country; // Label of country - var $poste; // Position var $socid; // fk_soc @@ -91,13 +83,6 @@ class Contact extends CommonObject var $birthday; var $default_lang; - var $note_public; // Public note - /** - * @deprecated - * @see note_public, note_private - */ - var $note; - var $note_private; // Private note var $no_email; // 1=Don't send e-mail to this contact, 0=do var $ref_facturation; // Nb de reference facture pour lequel il est contact @@ -107,7 +92,6 @@ class Contact extends CommonObject var $user_id; var $user_login; - var $import_key; var $oldcopy; // To contains a clone of this when we need to save old properties of object @@ -168,9 +152,9 @@ class Contact extends CommonObject $sql.= " ".($user->id > 0 ? "'".$user->id."'":"null").","; $sql.= " ".$this->priv.","; $sql.= " ".$this->statut.","; - $sql.= " ".(! empty($this->canvas)?"'".$this->canvas."'":"null").","; + $sql.= " ".(! empty($this->canvas)?"'".$this->db->escape($this->canvas)."'":"null").","; $sql.= " ".$conf->entity.","; - $sql.= "'".$this->db->escape($this->ref_ext)."',"; + $sql.= "'".$this->db->escape($this->ref_ext)."',"; $sql.= " ".(! empty($this->import_key)?"'".$this->import_key."'":"null"); $sql.= ")"; @@ -516,9 +500,16 @@ class Contact extends CommonObject */ function fetch($id, $user=0, $ref_ext='') { - dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); global $langs; + dol_syslog(get_class($this)."::fetch id=".$id, LOG_DEBUG); + + if (empty($id) && empty($ref_ext)) + { + $this->error='BadParameter'; + return -1; + } + $langs->load("companies"); $sql = "SELECT c.rowid, c.fk_soc, c.ref_ext, c.civility as civility_id, c.lastname, c.firstname,"; @@ -541,7 +532,6 @@ class Contact extends CommonObject if ($id) $sql.= " WHERE c.rowid = ". $id; elseif ($ref_ext) $sql .= " WHERE c.ref_ext = '".$this->db->escape($ref_ext)."'"; - dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index 187dea70def..9a8fde8e14f 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -156,7 +156,7 @@ if (! empty($conf->global->LDAP_CONTACT_ACTIVE) && $conf->global->LDAP_CONTACT_A // Affichage attributs LDAP -print_titre($langs->trans("LDAPInformationsForThisContact")); +print load_fiche_titre($langs->trans("LDAPInformationsForThisContact")); print ''; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 85fdbc2870f..cf65c1c5456 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -269,7 +269,7 @@ if ($result) print ''; print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index 5d71ba88f26..5229a0e8416 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -36,11 +36,12 @@ $id = GETPOST('id', 'int'); // Security check $result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); + $result=$contact->fetch($id); -if (! $result) +if ($result <= 0) { dol_print_error($contact->error); - exit; + exit; } $physicalperson=1; @@ -64,8 +65,8 @@ $v->setPhoneNumber($contact->phone_pro, "PREF;WORK;VOICE"); $v->setPhoneNumber($contact->phone_mobile, "CELL;VOICE"); $v->setPhoneNumber($contact->fax, "WORK;FAX"); -$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country_id:''), "WORK;POSTAL"); -$v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country_id:''), "WORK"); +$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country:''), "WORK;POSTAL"); +$v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country:''), "WORK"); $v->setEmail($contact->email,'internet,pref'); $v->setNote($contact->note); @@ -77,7 +78,7 @@ if ($company->id) $v->setURL($company->url, "WORK"); if (! $contact->phone_pro) $v->setPhoneNumber($company->phone, "WORK;VOICE"); if (! $contact->fax) $v->setPhoneNumber($company->fax, "WORK;FAX"); - if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country_code, "WORK;POSTAL"); + if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country, "WORK;POSTAL"); if ($company->email != $contact->email) $v->setEmail($company->email,'internet'); // Si contact lie a un tiers non de type "particulier" if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->name); diff --git a/htdocs/contrat/admin/contract_extrafields.php b/htdocs/contrat/admin/contract_extrafields.php index 29e060551de..9711379f458 100644 --- a/htdocs/contrat/admin/contract_extrafields.php +++ b/htdocs/contrat/admin/contract_extrafields.php @@ -67,7 +67,7 @@ $textobject = $langs->transnoentitiesnoconv('Contracts'); llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("ContractsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ContractsSetup"),$linkback,'title_setup'); print '
'; $head=contract_admin_prepare_head(); @@ -97,7 +97,7 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print "
"; - print_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } @@ -110,7 +110,7 @@ if ($action == 'create') if ($action == 'edit' && ! empty($attrname)) { print "
"; - print_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } diff --git a/htdocs/contrat/admin/contractdet_extrafields.php b/htdocs/contrat/admin/contractdet_extrafields.php index 283a400bc80..8014334c008 100644 --- a/htdocs/contrat/admin/contractdet_extrafields.php +++ b/htdocs/contrat/admin/contractdet_extrafields.php @@ -67,7 +67,7 @@ $textobject = $langs->transnoentitiesnoconv('Contracts'); llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("ContractsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ContractsSetup"),$linkback,'title_setup'); print '
'; $head=contract_admin_prepare_head(); @@ -97,7 +97,7 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print "
"; - print_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } @@ -110,7 +110,7 @@ if ($action == 'create') if ($action == 'edit' && ! empty($attrname)) { print "
"; - print_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 4005cb9abdf..5615eaf76a4 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -3,12 +3,12 @@ * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2010-2015 Juanjo Menent * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Ferran Marcet * Copyright (C) 2014 Marcos García - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -90,38 +90,26 @@ $extrafieldsline = new ExtraFields($db); $extralabelslines=$extrafieldsline->fetch_name_optionals_label($object->table_element_line); $permissionnote=$user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php +$permissiondellink=$user->rights->contrat->creer; // Used by the include of actions_dellink.inc.php /* * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once - -if ($action == 'confirm_active' && $confirm == 'yes' && $user->rights->contrat->activer) +$parameters = array('socid' => $socid); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +if (empty($reshook)) { - $result = $object->active_line($user, GETPOST('ligne'), GETPOST('date'), GETPOST('dateend'), GETPOST('comment')); - - if ($result > 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else { - setEventMessage($object->error,'errors'); - } -} - -else if ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->contrat->activer) -{ - if (! GETPOST('dateend')) + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once + + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + + if ($action == 'confirm_active' && $confirm == 'yes' && $user->rights->contrat->activer) { - $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),'errors'); - } - if (! $error) - { - $result = $object->close_line($user, GETPOST('ligne'), GETPOST('dateend'), urldecode(GETPOST('comment'))); + $result = $object->active_line($user, GETPOST('ligne'), GETPOST('date'), GETPOST('dateend'), GETPOST('comment')); + if ($result > 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); @@ -131,602 +119,604 @@ else if ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->c setEventMessage($object->error,'errors'); } } -} - -// Si ajout champ produit predefini -if (GETPOST('mode')=='predefined') -{ - $date_start=''; - $date_end=''; - if (GETPOST('date_startmonth') && GETPOST('date_startday') && GETPOST('date_startyear')) - { - $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); - } - if (GETPOST('date_endmonth') && GETPOST('date_endday') && GETPOST('date_endyear')) - { - $date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); - } -} - -// Si ajout champ produit libre -if (GETPOST('mode')=='libre') -{ - $date_start_sl=''; - $date_end_sl=''; - if (GETPOST('date_start_slmonth') && GETPOST('date_start_slday') && GETPOST('date_start_slyear')) - { - $date_start_sl=dol_mktime(GETPOST('date_start_slhour'), GETPOST('date_start_slmin'), 0, GETPOST('date_start_slmonth'), GETPOST('date_start_slday'), GETPOST('date_start_slyear')); - } - if (GETPOST('date_end_slmonth') && GETPOST('date_end_slday') && GETPOST('date_end_slyear')) - { - $date_end_sl=dol_mktime(GETPOST('date_end_slhour'), GETPOST('date_end_slmin'), 0, GETPOST('date_end_slmonth'), GETPOST('date_end_slday'), GETPOST('date_end_slyear')); - } -} - -// Param dates -$date_contrat=''; -$date_start_update=''; -$date_end_update=''; -$date_start_real_update=''; -$date_end_real_update=''; -if (GETPOST('date_start_updatemonth') && GETPOST('date_start_updateday') && GETPOST('date_start_updateyear')) -{ - $date_start_update=dol_mktime(GETPOST('date_start_updatehour'), GETPOST('date_start_updatemin'), 0, GETPOST('date_start_updatemonth'), GETPOST('date_start_updateday'), GETPOST('date_start_updateyear')); -} -if (GETPOST('date_end_updatemonth') && GETPOST('date_end_updateday') && GETPOST('date_end_updateyear')) -{ - $date_end_update=dol_mktime(GETPOST('date_end_updatehour'), GETPOST('date_end_updatemin'), 0, GETPOST('date_end_updatemonth'), GETPOST('date_end_updateday'), GETPOST('date_end_updateyear')); -} -if (GETPOST('date_start_real_updatemonth') && GETPOST('date_start_real_updateday') && GETPOST('date_start_real_updateyear')) -{ - $date_start_real_update=dol_mktime(GETPOST('date_start_real_updatehour'), GETPOST('date_start_real_updatemin'), 0, GETPOST('date_start_real_updatemonth'), GETPOST('date_start_real_updateday'), GETPOST('date_start_real_updateyear')); -} -if (GETPOST('date_end_real_updatemonth') && GETPOST('date_end_real_updateday') && GETPOST('date_end_real_updateyear')) -{ - $date_end_real_update=dol_mktime(GETPOST('date_end_real_updatehour'), GETPOST('date_end_real_updatemin'), 0, GETPOST('date_end_real_updatemonth'), GETPOST('date_end_real_updateday'), GETPOST('date_end_real_updateyear')); -} -if (GETPOST('remonth') && GETPOST('reday') && GETPOST('reyear')) -{ - $datecontrat = dol_mktime(GETPOST('rehour'), GETPOST('remin'), 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); -} - -// Add contract -if ($action == 'add' && $user->rights->contrat->creer) -{ - // Check - if (empty($datecontrat)) + + else if ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->contrat->activer) { - $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors'); - $action='create'; + if (! GETPOST('dateend')) + { + $error++; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),'errors'); + } + if (! $error) + { + $result = $object->close_line($user, GETPOST('ligne'), GETPOST('dateend'), urldecode(GETPOST('comment'))); + if ($result > 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else + { + setEventMessage($object->error,'errors'); + } + } } - - if ($socid<1) + + // Si ajout champ produit predefini + if (GETPOST('mode')=='predefined') { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Customer")),'errors'); - $action='create'; - $error++; - } - - // Fill array 'array_options' with data from add form - $ret = $extrafields->setOptionalsFromPost($extralabels, $object); - if ($ret < 0) { - $error ++; - $action = 'create'; - } - - if (! $error) - { - $object->socid = $socid; - $object->date_contrat = $datecontrat; - - $object->commercial_suivi_id = GETPOST('commercial_suivi_id','int'); - $object->commercial_signature_id = GETPOST('commercial_signature_id','int'); - - $object->note_private = GETPOST('note_private','alpha'); - $object->note_public = GETPOST('note_public','alpha'); - $object->fk_project = GETPOST('projectid','int'); - $object->remise_percent = GETPOST('remise_percent','alpha'); - $object->ref = GETPOST('ref','alpha'); - $object->ref_supplier = GETPOST('ref_supplier','alpha'); - - // If creation from another object of another module (Example: origin=propal, originid=1) - if ($_POST['origin'] && $_POST['originid']) + $date_start=''; + $date_end=''; + if (GETPOST('date_startmonth') && GETPOST('date_startday') && GETPOST('date_startyear')) { - // Parse element/subelement (ex: project_task) - $element = $subelement = $_POST['origin']; - if (preg_match('/^([^_]+)_([^_]+)/i',$_POST['origin'],$regs)) - { - $element = $regs[1]; - $subelement = $regs[2]; - } - - // For compatibility - if ($element == 'order') { $element = $subelement = 'commande'; } - if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } - - $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']); - } - - $id = $object->create($user); - if ($id < 0) { - setEventMessage($object->error,'errors'); - } - - if ($id > 0) - { - dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); - - $classname = ucfirst($subelement); - $srcobject = new $classname($db); - - dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); - $result=$srcobject->fetch($object->origin_id); - if ($result > 0) - { - $srcobject->fetch_thirdparty(); - $lines = $srcobject->lines; - if (empty($lines) && method_exists($srcobject,'fetch_lines')) - { - $srcobject->fetch_lines(); - $lines = $srcobject->lines; - } - - $fk_parent_line=0; - $num=count($lines); - - for ($i=0;$i<$num;$i++) - { - $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0); - - if ($product_type == 1 || (! empty($conf->global->CONTRACT_SUPPORT_PRODUCTS) && in_array($product_type, array(0,1)))) { // TODO Exclude also deee - // service prédéfini - if ($lines[$i]->fk_product > 0) - { - $product_static = new Product($db); - - // Define output language - if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); + } + if (GETPOST('date_endmonth') && GETPOST('date_endday') && GETPOST('date_endyear')) + { + $date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); + } + } + + // Si ajout champ produit libre + if (GETPOST('mode')=='libre') + { + $date_start_sl=''; + $date_end_sl=''; + if (GETPOST('date_start_slmonth') && GETPOST('date_start_slday') && GETPOST('date_start_slyear')) + { + $date_start_sl=dol_mktime(GETPOST('date_start_slhour'), GETPOST('date_start_slmin'), 0, GETPOST('date_start_slmonth'), GETPOST('date_start_slday'), GETPOST('date_start_slyear')); + } + if (GETPOST('date_end_slmonth') && GETPOST('date_end_slday') && GETPOST('date_end_slyear')) + { + $date_end_sl=dol_mktime(GETPOST('date_end_slhour'), GETPOST('date_end_slmin'), 0, GETPOST('date_end_slmonth'), GETPOST('date_end_slday'), GETPOST('date_end_slyear')); + } + } + + // Param dates + $date_contrat=''; + $date_start_update=''; + $date_end_update=''; + $date_start_real_update=''; + $date_end_real_update=''; + if (GETPOST('date_start_updatemonth') && GETPOST('date_start_updateday') && GETPOST('date_start_updateyear')) + { + $date_start_update=dol_mktime(GETPOST('date_start_updatehour'), GETPOST('date_start_updatemin'), 0, GETPOST('date_start_updatemonth'), GETPOST('date_start_updateday'), GETPOST('date_start_updateyear')); + } + if (GETPOST('date_end_updatemonth') && GETPOST('date_end_updateday') && GETPOST('date_end_updateyear')) + { + $date_end_update=dol_mktime(GETPOST('date_end_updatehour'), GETPOST('date_end_updatemin'), 0, GETPOST('date_end_updatemonth'), GETPOST('date_end_updateday'), GETPOST('date_end_updateyear')); + } + if (GETPOST('date_start_real_updatemonth') && GETPOST('date_start_real_updateday') && GETPOST('date_start_real_updateyear')) + { + $date_start_real_update=dol_mktime(GETPOST('date_start_real_updatehour'), GETPOST('date_start_real_updatemin'), 0, GETPOST('date_start_real_updatemonth'), GETPOST('date_start_real_updateday'), GETPOST('date_start_real_updateyear')); + } + if (GETPOST('date_end_real_updatemonth') && GETPOST('date_end_real_updateday') && GETPOST('date_end_real_updateyear')) + { + $date_end_real_update=dol_mktime(GETPOST('date_end_real_updatehour'), GETPOST('date_end_real_updatemin'), 0, GETPOST('date_end_real_updatemonth'), GETPOST('date_end_real_updateday'), GETPOST('date_end_real_updateyear')); + } + if (GETPOST('remonth') && GETPOST('reday') && GETPOST('reyear')) + { + $datecontrat = dol_mktime(GETPOST('rehour'), GETPOST('remin'), 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); + } + + // Add contract + if ($action == 'add' && $user->rights->contrat->creer) + { + // Check + if (empty($datecontrat)) + { + $error++; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors'); + $action='create'; + } + + if ($socid<1) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Customer")),'errors'); + $action='create'; + $error++; + } + + // Fill array 'array_options' with data from add form + $ret = $extrafields->setOptionalsFromPost($extralabels, $object); + if ($ret < 0) { + $error ++; + $action = 'create'; + } + + if (! $error) + { + $object->socid = $socid; + $object->date_contrat = $datecontrat; + + $object->commercial_suivi_id = GETPOST('commercial_suivi_id','int'); + $object->commercial_signature_id = GETPOST('commercial_signature_id','int'); + + $object->note_private = GETPOST('note_private','alpha'); + $object->note_public = GETPOST('note_public','alpha'); + $object->fk_project = GETPOST('projectid','int'); + $object->remise_percent = GETPOST('remise_percent','alpha'); + $object->ref = GETPOST('ref','alpha'); + $object->ref_supplier = GETPOST('ref_supplier','alpha'); + + // If creation from another object of another module (Example: origin=propal, originid=1) + if ($_POST['origin'] && $_POST['originid']) + { + // Parse element/subelement (ex: project_task) + $element = $subelement = $_POST['origin']; + if (preg_match('/^([^_]+)_([^_]+)/i',$_POST['origin'],$regs)) + { + $element = $regs[1]; + $subelement = $regs[2]; + } + + // For compatibility + if ($element == 'order') { $element = $subelement = 'commande'; } + if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } + + $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']); + } + + $id = $object->create($user); + if ($id < 0) { + setEventMessage($object->error,'errors'); + } + + if ($id > 0) + { + dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); + + $classname = ucfirst($subelement); + $srcobject = new $classname($db); + + dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); + $result=$srcobject->fetch($object->origin_id); + if ($result > 0) + { + $srcobject->fetch_thirdparty(); + $lines = $srcobject->lines; + if (empty($lines) && method_exists($srcobject,'fetch_lines')) + { + $srcobject->fetch_lines(); + $lines = $srcobject->lines; + } + + $fk_parent_line=0; + $num=count($lines); + + for ($i=0;$i<$num;$i++) + { + $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0); + + if ($product_type == 1 || (! empty($conf->global->CONTRACT_SUPPORT_PRODUCTS) && in_array($product_type, array(0,1)))) { // TODO Exclude also deee + // service prédéfini + if ($lines[$i]->fk_product > 0) { - $prod = new Product($db); - $prod->id=$lines[$i]->fk_product; - $prod->getMultiLangs(); - - $outputlangs = $langs; - $newlang=''; - if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); - if (empty($newlang)) $newlang=$srcobject->thirdparty->default_lang; - if (! empty($newlang)) + $product_static = new Product($db); + + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); + $prod = new Product($db); + $prod->id=$lines[$i]->fk_product; + $prod->getMultiLangs(); + + $outputlangs = $langs; + $newlang=''; + if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); + if (empty($newlang)) $newlang=$srcobject->thirdparty->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["libelle"])) ? $prod->multilangs[$outputlangs->defaultlang]["libelle"] : $lines[$i]->product_label; } - - $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["libelle"])) ? $prod->multilangs[$outputlangs->defaultlang]["libelle"] : $lines[$i]->product_label; + else + { + $label = $lines[$i]->product_label; + } + + if ($conf->global->PRODUIT_DESC_IN_FORM) + $desc .= ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):''; } - else - { - $label = $lines[$i]->product_label; - } - - if ($conf->global->PRODUIT_DESC_IN_FORM) - $desc .= ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):''; + else { + $desc = dol_htmlentitiesbr($lines[$i]->desc); + } + + $result = $object->addline( + $desc, + $lines[$i]->subprice, + $lines[$i]->qty, + $lines[$i]->tva_tx, + $lines[$i]->localtax1_tx, + $lines[$i]->localtax2_tx, + $lines[$i]->fk_product, + $lines[$i]->remise_percent, + $lines[$i]->date_start, + $lines[$i]->date_end, + 'HT', + 0, + $lines[$i]->info_bits, + $lines[$i]->fk_fournprice, + $lines[$i]->pa_ht, + array(), + $lines[$i]->fk_unit + ); + + if ($result < 0) + { + $error++; + break; + } + } - else { - $desc = dol_htmlentitiesbr($lines[$i]->desc); - } - - $result = $object->addline( - $desc, - $lines[$i]->subprice, - $lines[$i]->qty, - $lines[$i]->tva_tx, - $lines[$i]->localtax1_tx, - $lines[$i]->localtax2_tx, - $lines[$i]->fk_product, - $lines[$i]->remise_percent, - $lines[$i]->date_start, - $lines[$i]->date_end, - 'HT', - 0, - $lines[$i]->info_bits, - $lines[$i]->fk_fournprice, - $lines[$i]->pa_ht, - array(), - $lines[$i]->fk_unit - ); - - if ($result < 0) - { - $error++; - break; - } - + } + } + else + { + setEventMessage($srcobject->error,'errors'); + $error++; + } + } + else + { + setEventMessage($object->error,'errors'); + $error++; + } + } + else + { + $result = $object->create($user); + if ($result > 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else { + setEventMessage($object->error,'errors'); + } + $action='create'; + } + } + } + + else if ($action == 'classin' && $user->rights->contrat->creer) + { + $object->setProject(GETPOST('projectid')); + } + + // Add a new line + else if ($action == 'addline' && $user->rights->contrat->creer) + { + // Set if we used free entry or predefined product + $predef=''; + $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); + if (GETPOST('prod_entry_mode') == 'free') + { + $idprod=0; + $price_ht = GETPOST('price_ht'); + $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); + } + else + { + $idprod=GETPOST('idprod', 'int'); + $price_ht = ''; + $tva_tx = ''; + } + + $qty = GETPOST('qty'.$predef); + $remise_percent=GETPOST('remise_percent'.$predef); + + if ($qty == '') + { + setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Qty")),'errors'); + $error++; + } + if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) + { + setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")),'errors'); + $error++; + } + + // Extrafields + $extrafieldsline = new ExtraFields($db); + $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); + $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + // Unset extrafield + if (is_array($extralabelsline)) { + // Get extra fields + foreach ($extralabelsline as $key => $value) { + unset($_POST["options_" . $key]); + } + } + + if (! $error) + { + // Clean parameters + $date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); + $date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); + $price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT'); + + // Ecrase $pu par celui du produit + // Ecrase $desc par celui du produit + // Ecrase $txtva par celui du produit + // Ecrase $base_price_type par celui du produit + if ($idprod > 0) + { + $prod = new Product($db); + $prod->fetch($idprod); + + $tva_tx = get_default_tva($mysoc,$object->thirdparty,$prod->id); + $tva_npr = get_default_npr($mysoc,$object->thirdparty,$prod->id); + $pu_ht = $prod->price; + $pu_ttc = $prod->price_ttc; + $price_min = $prod->price_min; + $price_base_type = $prod->price_base_type; + + // On defini prix unitaire + if ($conf->global->PRODUIT_MULTIPRICES && $object->thirdparty->price_level) + { + $pu_ht = $prod->multiprices[$object->thirdparty->price_level]; + $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level]; + $price_min = $prod->multiprices_min[$object->thirdparty->price_level]; + $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level]; + } + elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) + { + require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; + + $prodcustprice = new Productcustomerprice($db); + + $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id); + + $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + if ($result) { + if (count($prodcustprice->lines) > 0) { + $pu_ht = price($prodcustprice->lines [0]->price); + $pu_ttc = price($prodcustprice->lines [0]->price_ttc); + $price_base_type = $prodcustprice->lines [0]->price_base_type; + $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; } + } + } + + // On reevalue prix selon taux tva car taux tva transaction peut etre different + // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). + if ($tva_tx != $prod->tva_tx) + { + if ($price_base_type != 'HT') + { + $pu_ht = price2num($pu_ttc / (1 + ($tva_tx/100)), 'MU'); + } + else + { + $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); } } - else - { - setEventMessage($srcobject->error,'errors'); - $error++; - } + + $desc=$prod->description; + $desc=dol_concatdesc($desc,$product_desc); + $fk_unit = $prod->fk_unit; + } + else + { + $pu_ht=GETPOST('price_ht'); + $price_base_type = 'HT'; + $tva_tx=GETPOST('tva_tx')?str_replace('*','',GETPOST('tva_tx')):0; // tva_tx field may be disabled, so we use vat rate 0 + $tva_npr=preg_match('/\*/',GETPOST('tva_tx'))?1:0; + $desc=$product_desc; + $fk_unit= GETPOST('units', 'alpha'); + } + + $localtax1_tx=get_localtax($tva_tx,1,$object->thirdparty); + $localtax2_tx=get_localtax($tva_tx,2,$object->thirdparty); + + // ajout prix achat + $fk_fournprice = $_POST['fournprice']; + if ( ! empty($_POST['buying_price']) ) + $pa_ht = $_POST['buying_price']; + else + $pa_ht = null; + + $info_bits=0; + if ($tva_npr) $info_bits |= 0x01; + + if($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min))) + { + $object->error = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)); + $result = -1 ; + } + else + { + // Insert line + $result = $object->addline( + $desc, + $pu_ht, + $qty, + $tva_tx, + $localtax1_tx, + $localtax2_tx, + $idprod, + $remise_percent, + $date_start, + $date_end, + $price_base_type, + $pu_ttc, + $info_bits, + $fk_fournprice, + $pa_ht, + $array_options, + $fk_unit + ); + } + + if ($result > 0) + { + // Define output language + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; + if (! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + + $ret = $object->fetch($id); // Reload to get new records + + $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + unset($_POST ['prod_entry_mode']); + + 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['date_starthour']); + unset($_POST['date_startmin']); + unset($_POST['date_startsec']); + unset($_POST['date_startday']); + unset($_POST['date_startmonth']); + unset($_POST['date_startyear']); + unset($_POST['date_endhour']); + unset($_POST['date_endmin']); + unset($_POST['date_endsec']); + unset($_POST['date_endday']); + unset($_POST['date_endmonth']); + unset($_POST['date_endyear']); } else { - setEventMessage($object->error,'errors'); - $error++; + setEventMessage($object->error,'errors'); + } + } + } + + else if ($action == 'updateligne' && $user->rights->contrat->creer && ! GETPOST('cancel')) + { + $objectline = new ContratLigne($db); + if ($objectline->fetch(GETPOST('elrowid'))) + { + $db->begin(); + + if ($date_start_real_update == '') $date_start_real_update=$objectline->date_ouverture; + if ($date_end_real_update == '') $date_end_real_update=$objectline->date_cloture; + + $localtax1_tx=get_localtax(GETPOST('eltva_tx'),1,$object->thirdparty); + $localtax2_tx=get_localtax(GETPOST('eltva_tx'),2,$object->thirdparty); + + // ajout prix d'achat + $fk_fournprice = $_POST['fournprice']; + if ( ! empty($_POST['buying_price']) ) + $pa_ht = $_POST['buying_price']; + else + $pa_ht = null; + + $fk_unit = GETPOST('unit', 'alpha'); + + $objectline->description=GETPOST('product_desc'); + $objectline->price_ht=GETPOST('elprice'); + $objectline->subprice=GETPOST('elprice'); + $objectline->qty=GETPOST('elqty'); + $objectline->remise_percent=GETPOST('elremise_percent'); + $objectline->tva_tx=GETPOST('eltva_tx')?GETPOST('eltva_tx'):0; // Field may be disabled, so we use vat rate 0 + $objectline->localtax1_tx=$localtax1_tx; + $objectline->localtax2_tx=$localtax2_tx; + $objectline->date_ouverture_prevue=$date_start_update; + $objectline->date_ouverture=$date_start_real_update; + $objectline->date_fin_validite=$date_end_update; + $objectline->date_cloture=$date_end_real_update; + $objectline->fk_user_cloture=$user->id; + $objectline->fk_fournprice=$fk_fournprice; + $objectline->pa_ht=$pa_ht; + + if ($fk_unit > 0) { + $objectline->fk_unit = GETPOST('unit'); + } else { + $objectline->fk_unit = null; + } + + // Extrafields + $extrafieldsline = new ExtraFields($db); + $extralabelsline = $extrafieldsline->fetch_name_optionals_label($objectline->table_element); + $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $objectline->array_options=$array_options; + + // TODO verifier price_min si fk_product et multiprix + + $result=$objectline->update($user); + if ($result > 0) + { + $db->commit(); + } + else + { + setEventMessage($objectline->error,'errors'); + $db->rollback(); } } else { - $result = $object->create($user); - if ($result > 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else { - setEventMessage($object->error,'errors'); - } - $action='create'; - } - } -} - -else if ($action == 'classin' && $user->rights->contrat->creer) -{ - $object->setProject(GETPOST('projectid')); -} - -// Add a new line -else if ($action == 'addline' && $user->rights->contrat->creer) -{ - // Set if we used free entry or predefined product - $predef=''; - $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); - if (GETPOST('prod_entry_mode') == 'free') - { - $idprod=0; - $price_ht = GETPOST('price_ht'); - $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); - } - else - { - $idprod=GETPOST('idprod', 'int'); - $price_ht = ''; - $tva_tx = ''; - } - - $qty = GETPOST('qty'.$predef); - $remise_percent=GETPOST('remise_percent'.$predef); - - if ($qty == '') - { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Qty")),'errors'); - $error++; - } - if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) - { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")),'errors'); - $error++; - } - - // Extrafields - $extrafieldsline = new ExtraFields($db); - $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); - // Unset extrafield - if (is_array($extralabelsline)) { - // Get extra fields - foreach ($extralabelsline as $key => $value) { - unset($_POST["options_" . $key]); - } - } - - if (! $error) - { - // Clean parameters - $date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); - $date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); - $price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT'); - - // Ecrase $pu par celui du produit - // Ecrase $desc par celui du produit - // Ecrase $txtva par celui du produit - // Ecrase $base_price_type par celui du produit - if ($idprod > 0) - { - $prod = new Product($db); - $prod->fetch($idprod); - - $tva_tx = get_default_tva($mysoc,$object->thirdparty,$prod->id); - $tva_npr = get_default_npr($mysoc,$object->thirdparty,$prod->id); - $pu_ht = $prod->price; - $pu_ttc = $prod->price_ttc; - $price_min = $prod->price_min; - $price_base_type = $prod->price_base_type; - - // On defini prix unitaire - if ($conf->global->PRODUIT_MULTIPRICES && $object->thirdparty->price_level) - { - $pu_ht = $prod->multiprices[$object->thirdparty->price_level]; - $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level]; - $price_min = $prod->multiprices_min[$object->thirdparty->price_level]; - $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level]; - } - elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) - { - require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; - - $prodcustprice = new Productcustomerprice($db); - - $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id); - - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); - if ($result) { - if (count($prodcustprice->lines) > 0) { - $pu_ht = price($prodcustprice->lines [0]->price); - $pu_ttc = price($prodcustprice->lines [0]->price_ttc); - $price_base_type = $prodcustprice->lines [0]->price_base_type; - $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; - } - } - } - - // On reevalue prix selon taux tva car taux tva transaction peut etre different - // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). - if ($tva_tx != $prod->tva_tx) - { - if ($price_base_type != 'HT') - { - $pu_ht = price2num($pu_ttc / (1 + ($tva_tx/100)), 'MU'); - } - else - { - $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); - } - } - - $desc=$prod->description; - $desc=dol_concatdesc($desc,$product_desc); - $fk_unit = $prod->fk_unit; - } - else - { - $pu_ht=GETPOST('price_ht'); - $price_base_type = 'HT'; - $tva_tx=GETPOST('tva_tx')?str_replace('*','',GETPOST('tva_tx')):0; // tva_tx field may be disabled, so we use vat rate 0 - $tva_npr=preg_match('/\*/',GETPOST('tva_tx'))?1:0; - $desc=$product_desc; - $fk_unit= GETPOST('units', 'alpha'); - } - - $localtax1_tx=get_localtax($tva_tx,1,$object->thirdparty); - $localtax2_tx=get_localtax($tva_tx,2,$object->thirdparty); - - // ajout prix achat - $fk_fournprice = $_POST['fournprice']; - if ( ! empty($_POST['buying_price']) ) - $pa_ht = $_POST['buying_price']; - else - $pa_ht = null; - - $info_bits=0; - if ($tva_npr) $info_bits |= 0x01; - - if($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min))) - { - $object->error = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)); - $result = -1 ; - } - else - { - // Insert line - $result = $object->addline( - $desc, - $pu_ht, - $qty, - $tva_tx, - $localtax1_tx, - $localtax2_tx, - $idprod, - $remise_percent, - $date_start, - $date_end, - $price_base_type, - $pu_ttc, - $info_bits, - $fk_fournprice, - $pa_ht, - $array_options, - $fk_unit - ); - } - - if ($result > 0) - { - // Define output language - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - - $ret = $object->fetch($id); // Reload to get new records - - $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - unset($_POST ['prod_entry_mode']); - - 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['date_starthour']); - unset($_POST['date_startmin']); - unset($_POST['date_startsec']); - unset($_POST['date_startday']); - unset($_POST['date_startmonth']); - unset($_POST['date_startyear']); - unset($_POST['date_endhour']); - unset($_POST['date_endmin']); - unset($_POST['date_endsec']); - unset($_POST['date_endday']); - unset($_POST['date_endmonth']); - unset($_POST['date_endyear']); - } - else - { - setEventMessage($object->error,'errors'); - } - } -} - -else if ($action == 'updateligne' && $user->rights->contrat->creer && ! GETPOST('cancel')) -{ - $objectline = new ContratLigne($db); - if ($objectline->fetch(GETPOST('elrowid'))) - { - $db->begin(); - - if ($date_start_real_update == '') $date_start_real_update=$objectline->date_ouverture; - if ($date_end_real_update == '') $date_end_real_update=$objectline->date_cloture; - - $localtax1_tx=get_localtax(GETPOST('eltva_tx'),1,$object->thirdparty); - $localtax2_tx=get_localtax(GETPOST('eltva_tx'),2,$object->thirdparty); - - // ajout prix d'achat - $fk_fournprice = $_POST['fournprice']; - if ( ! empty($_POST['buying_price']) ) - $pa_ht = $_POST['buying_price']; - else - $pa_ht = null; - - $fk_unit = GETPOST('unit', 'alpha'); - - $objectline->description=GETPOST('product_desc'); - $objectline->price_ht=GETPOST('elprice'); - $objectline->subprice=GETPOST('elprice'); - $objectline->qty=GETPOST('elqty'); - $objectline->remise_percent=GETPOST('elremise_percent'); - $objectline->tva_tx=GETPOST('eltva_tx')?GETPOST('eltva_tx'):0; // Field may be disabled, so we use vat rate 0 - $objectline->localtax1_tx=$localtax1_tx; - $objectline->localtax2_tx=$localtax2_tx; - $objectline->date_ouverture_prevue=$date_start_update; - $objectline->date_ouverture=$date_start_real_update; - $objectline->date_fin_validite=$date_end_update; - $objectline->date_cloture=$date_end_real_update; - $objectline->fk_user_cloture=$user->id; - $objectline->fk_fournprice=$fk_fournprice; - $objectline->pa_ht=$pa_ht; - - if ($fk_unit > 0) { - $objectline->fk_unit = GETPOST('unit'); - } else { - $objectline->fk_unit = null; + setEventMessage($objectline->error,'errors'); } - - // Extrafields - $extrafieldsline = new ExtraFields($db); - $extralabelsline = $extrafieldsline->fetch_name_optionals_label($objectline->table_element); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); - $objectline->array_options=$array_options; - - // TODO verifier price_min si fk_product et multiprix - - $result=$objectline->update($user); - if ($result > 0) - { - $db->commit(); - } - else - { - setEventMessage($objectline->error,'errors'); - $db->rollback(); - } - } - else - { - setEventMessage($objectline->error,'errors'); - } -} - -else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->contrat->creer) -{ - $result = $object->deleteline(GETPOST('lineid'),$user); - - if ($result >= 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else - { - setEventMessage($object->error,'errors'); - } -} - -else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer) -{ - $result = $object->validate($user); -} - -// Close all lines -else if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer) -{ - $object->cloture($user); -} - -else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer) -{ - $result=$object->delete($user); - if ($result >= 0) - { - header("Location: index.php"); - return; } - else + + else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->contrat->creer) { - setEventMessage($object->error,'errors'); + $result = $object->deleteline(GETPOST('lineid'),$user); + + if ($result >= 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else + { + setEventMessage($object->error,'errors'); + } } -} - -else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contrat->creer) -{ - if (GETPOST('newcid') > 0) + + else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer) { - $contractline = new ContratLigne($db); - $result=$contractline->fetch(GETPOST('lineid')); - $contractline->fk_contrat = GETPOST('newcid'); - $result=$contractline->update($user,1); + $result = $object->validate($user); + } + + // Close all lines + else if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer) + { + $object->cloture($user); + } + + else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer) + { + $result=$object->delete($user); if ($result >= 0) { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + header("Location: index.php"); return; } else @@ -734,149 +724,181 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra setEventMessage($object->error,'errors'); } } - else + + else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contrat->creer) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefNewContract")),'errors'); - } -} else if ($action == 'update_extras') { - // Fill array 'array_options' with data from update form - $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); - if ($ret < 0) - $error ++; - - if (! $error) { - - $result = $object->insertExtraFields(); - if ($result < 0) { - $error ++; - } - } else if ($reshook < 0) - $error ++; - - if ($error) { - $action = 'edit_extras'; - setEventMessage($object->error,'errors'); - } -} elseif ($action=='setref_supplier') { - - $cancelbutton = GETPOST('cancel'); - - if (!$cancelbutton) { - - $result = $object->fetch($id); - if ($result < 0) { - setEventMessage($object->errors, 'errors'); - } - $object->ref_supplier = GETPOST('ref_supplier', 'alpha'); - - $result = $object->update($user); - if ($result < 0) { - setEventMessage($object->errors, 'errors'); - $action = 'editref_supplier'; - } else { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - } -} elseif ($action=='setref') { - $object->ref=GETPOST('ref','alpha'); - - $result = $object->update($user); - if ($result < 0) { - setEventMessage($object->errors,'errors'); - $action='editref'; - } else { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } -} - -// Generation doc (depuis lien ou depuis cartouche doc) -else if ($action == 'builddoc' && $user->rights->contrat->creer) { - if (GETPOST('model')) { - $object->setDocModel($user, GETPOST('model')); - } - - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) { - $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret = $object->fetch($id); // Reload to get new records - $result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result <= 0) - { - setEventMessages($object->error, $object->errors, 'errors'); - $action=''; - } -} - -// Remove file in doc form -else if ($action == 'remove_file' && $user->rights->contrat->creer) { - if ($object->id > 0) { - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - - $langs->load("other"); - $upload_dir = $conf->contrat->dir_output; - $file = $upload_dir . '/' . GETPOST('file'); - $ret = dol_delete_file($file, 0, 0, 0, $object); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('file'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors'); - } -} - -if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat->creer) -{ - if ($action == 'addcontact') - { - $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); - $result = $object->add_contact($contactid, GETPOST('type'), GETPOST('source')); - - if ($result >= 0) + if (GETPOST('newcid') > 0) { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else - { - if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') + $contractline = new ContratLigne($db); + $result=$contractline->fetch(GETPOST('lineid')); + $contractline->fk_contrat = GETPOST('newcid'); + $result=$contractline->update($user,1); + if ($result >= 0) { - $langs->load("errors"); - setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"),'errors'); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + return; } else { setEventMessage($object->error,'errors'); } } - } - - // bascule du statut d'un contact - else if ($action == 'swapstatut') - { - $result=$object->swapContactStatus(GETPOST('ligne')); - } - - // Efface un contact - else if ($action == 'deletecontact') - { - $result = $object->delete_contact(GETPOST('lineid')); - - if ($result >= 0) + else { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefNewContract")),'errors'); } - else { + } else if ($action == 'update_extras') { + // Fill array 'array_options' with data from update form + $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); + if ($ret < 0) + $error ++; + + if (! $error) { + + $result = $object->insertExtraFields(); + if ($result < 0) { + $error ++; + } + } else if ($reshook < 0) + $error ++; + + if ($error) { + $action = 'edit_extras'; setEventMessage($object->error,'errors'); } + } elseif ($action=='setref_supplier') { + $cancelbutton = GETPOST('cancel'); + + if (!$cancelbutton) { + + $result = $object->fetch($id); + if ($result < 0) { + setEventMessage($object->errors, 'errors'); + } + + $result = $object->setValueFrom('ref_supplier',GETPOST('ref_supplier','alpha')); + if ($result < 0) { + setEventMessage($object->errors, 'errors'); + $action = 'editref_supplier'; + } else { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + } + else { + header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); + exit; + } + } elseif ($action=='setref') { + $cancelbutton = GETPOST('cancel'); + + if (!$cancelbutton) { + $result = $object->fetch($id); + if ($result < 0) { + setEventMessage($object->errors, 'errors'); + } + + $result = $object->setValueFrom('ref',GETPOST('ref','alpha'));; + if ($result < 0) { + setEventMessage($object->errors, 'errors'); + $action = 'editref'; + } else { + header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); + exit; + } + } + else { + header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); + exit; + } + } + + // Generation doc (depuis lien ou depuis cartouche doc) + else if ($action == 'builddoc' && $user->rights->contrat->creer) { + if (GETPOST('model')) { + $object->setDocModel($user, GETPOST('model')); + } + + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) { + $outputlangs = new Translate("", $conf); + $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret = $object->fetch($id); // Reload to get new records + $result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result <= 0) + { + setEventMessages($object->error, $object->errors, 'errors'); + $action=''; + } + } + + // Remove file in doc form + else if ($action == 'remove_file' && $user->rights->contrat->creer) { + if ($object->id > 0) { + require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + + $langs->load("other"); + $upload_dir = $conf->contrat->dir_output; + $file = $upload_dir . '/' . GETPOST('file'); + $ret = dol_delete_file($file, 0, 0, 0, $object); + if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('file'))); + else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors'); + } + } + + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat->creer) + { + if ($action == 'addcontact') + { + $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); + $result = $object->add_contact($contactid, GETPOST('type'), GETPOST('source')); + + if ($result >= 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else + { + if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') + { + $langs->load("errors"); + setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"),'errors'); + } + else + { + setEventMessage($object->error,'errors'); + } + } + } + + // bascule du statut d'un contact + else if ($action == 'swapstatut') + { + $result=$object->swapContactStatus(GETPOST('ligne')); + } + + // Efface un contact + else if ($action == 'deletecontact') + { + $result = $object->delete_contact(GETPOST('lineid')); + + if ($result >= 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else { + setEventMessage($object->error,'errors'); + } + } } } - /* * View */ @@ -908,7 +930,7 @@ if ($result > 0) *********************************************************************/ if ($action == 'create') { - print_fiche_titre($langs->trans('AddContract'),'','title_commercial.png'); + print load_fiche_titre($langs->trans('AddContract'),'','title_commercial.png'); $soc = new Societe($db); if ($socid>0) $soc->fetch($socid); @@ -1577,7 +1599,7 @@ else 'text' => $langs->trans("ConfirmMoveToAnotherContractQuestion"), array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid)); - $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("MoveToAnotherContract"),$langs->trans("ConfirmMoveToAnotherContract"),"confirm_move",$formquestion); + $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("MoveToAnotherContract"),$langs->trans("ConfirmMoveToAnotherContract"),"confirm_move",$formquestion); print '
'; } @@ -1589,7 +1611,7 @@ else $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); $comment = GETPOST('comment'); - $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment),$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dol_print_date($dateactstart,"%A %d %B %Y")),"confirm_active", '', 0, 1); + $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment),$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dol_print_date($dateactstart,"%A %d %B %Y")),"confirm_active", '', 0, 1); print '
'; } @@ -1601,7 +1623,7 @@ else $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); $comment = GETPOST('comment'); - $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")), "confirm_closeline", '', 0, 1); + $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")), "confirm_closeline", '', 0, 1); print '
'; } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 9d21b143a2d..6fa4e5c46a8 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2008 Raphael Bertrand - * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2010-2015 Juanjo Menent * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos García @@ -50,25 +50,6 @@ class Contrat extends CommonObject */ protected $table_ref_field = 'ref'; - /** - * Id of the contract - * @var int - */ - var $id; - - /** - * Reference of the contract - * @var string - */ - var $ref; - - /** - * External reference of the contract. - * Used by 3rd party services - * @var string - */ - var $ref_ext; - /** * Supplier reference of the contract * @var string @@ -140,26 +121,12 @@ class Contrat extends CommonObject var $commercial_signature_id; var $commercial_suivi_id; - /** - * @var string Private note - */ - var $note_private; - - /** - * @var string Public note - */ - var $note_public; - - var $modelpdf; - /** * @deprecated Use fk_project instead * @see fk_project */ var $fk_projet; - public $fk_project; - var $extraparams=array(); /** @@ -1147,7 +1114,7 @@ class Contrat extends CommonObject if (isset($this->note_private)) $this->note_private=trim($this->note_private); if (isset($this->note_public)) $this->note_public=trim($this->note_public); if (isset($this->import_key)) $this->import_key=trim($this->import_key); - if (isset($this->extraparams)) $this->extraparams=trim($this->extraparams); + //if (isset($this->extraparams)) $this->extraparams=trim($this->extraparams); @@ -1174,8 +1141,8 @@ class Contrat extends CommonObject $sql.= " fk_user_cloture=".(isset($this->fk_user_cloture)?$this->fk_user_cloture:"null").","; $sql.= " note_private=".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null").","; $sql.= " note_public=".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null").","; - $sql.= " import_key=".(isset($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null").","; - $sql.= " extraparams=".(isset($this->extraparams)?"'".$this->db->escape($this->extraparams)."'":"null").""; + $sql.= " import_key=".(isset($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null").""; + //$sql.= " extraparams=".(isset($this->extraparams)?"'".$this->db->escape($this->extraparams)."'":"null").""; $sql.= " WHERE rowid=".$this->id; @@ -1343,8 +1310,6 @@ class Contrat extends CommonObject $sql.= ", ".($fk_unit?"'".$this->db->escape($fk_unit)."'":"null"); $sql.= ")"; - dol_syslog(get_class($this)."::addline", LOG_DEBUG); - $resql=$this->db->query($sql); if ($resql) { @@ -2627,4 +2592,74 @@ class ContratLigne extends CommonObjectLine } } + + /** + * Inserts a contrat line into database + * + * @param int $notrigger Set to 1 if you don't want triggers to be fired + * @return int <0 if KO, >0 if OK + */ + public function insert($notrigger = 0) + { + global $user; + + // Insertion dans la base + $sql = "INSERT INTO ".MAIN_DB_PREFIX."contratdet"; + $sql.= " (fk_contrat, label, description, fk_product, qty, tva_tx,"; + $sql.= " localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, remise_percent, subprice,"; + $sql.= " total_ht, total_tva, total_localtax1, total_localtax2, total_ttc,"; + $sql.= " info_bits,"; + $sql.= " price_ht, remise, fk_product_fournisseur_price, buy_price_ht"; + if ($this->date_ouverture_prevue > 0) { $sql.= ",date_ouverture_prevue"; } + if ($this->date_fin_validite > 0) { $sql.= ",date_fin_validite"; } + $sql.= ") VALUES ($this->fk_contrat, '', '" . $this->db->escape($this->description) . "',"; + $sql.= ($this->fk_product>0 ? $this->fk_product : "null").","; + $sql.= " '".$this->qty."',"; + $sql.= " '".$this->tva_tx."',"; + $sql.= " '".$this->localtax1_tx."',"; + $sql.= " '".$this->localtax2_tx."',"; + $sql.= " '".$this->localtax1_type."',"; + $sql.= " '".$this->localtax2_type."',"; + $sql.= " ".price2num($this->remise_percent).",".price2num($this->subprice).","; + $sql.= " ".price2num($this->total_ht).",".price2num($this->total_tva).",".price2num($this->total_localtax1).",".price2num($this->total_localtax2).",".price2num($this->total_ttc).","; + $sql.= " '".$this->info_bits."',"; + $sql.= " ".price2num($this->price_ht).",".price2num($this->remise).","; + if ($this->fk_fournprice > 0) $sql.= ' '.$this->fk_fournprice.','; + else $sql.= ' null,'; + if ($this->pa_ht > 0) $sql.= ' '.price2num($this->pa_ht); + else $sql.= ' null'; + if ($this->date_ouverture_prevue > 0) { $sql.= ",'".$this->db->idate($this->date_ouverture_prevue)."'"; } + if ($this->date_fin_validite > 0) { $sql.= ",'".$this->db->idate($this->date_fin_validite)."'"; } + $sql.= ")"; + + dol_syslog(get_class($this)."::insert", LOG_DEBUG); + + $resql=$this->db->query($sql); + if ($resql) + { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'contratdet'); + + // FIXME Missing insert of extrafields + + if (!$notrigger) + { + // Call trigger + $result = $this->call_trigger('LINECONTRACT_CREATE', $user); + if ($result < 0) { + $this->db->rollback(); + return -1; + } + // End call triggers + } + + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + $this->error=$this->db->error()." sql=".$sql; + return -1; + } + } } diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 56cdbe90ca3..3a7b5667db5 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -64,7 +64,7 @@ $now = dol_now(); llxHeader(); -print_fiche_titre($langs->trans("ContractsArea"),'','title_commercial.png'); +print load_fiche_titre($langs->trans("ContractsArea"),'','title_commercial.png'); //print ''; diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index eedb0183759..cd07db385aa 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -153,7 +153,9 @@ if ($resql) if ($mode == "4" && $filter == "expired") $title=$langs->trans("ListOfExpiredServices"); if ($mode == "5") $title=$langs->trans("ListOfClosedServices"); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num,$totalnboflines,'title_commercial.png'); - + + print ''; + print ''; print '
'; print ''; @@ -169,9 +171,6 @@ if ($resql) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"], "cd.statut,c.statut",$param,"","align=\"right\"",$sortfield,$sortorder); print "\n"; - print ''; - print ''; - print ''; print '\n"; - print ''; $contractstatic=new Contrat($db); $productstatic=new Product($db); @@ -278,7 +276,7 @@ if ($resql) } $db->free($resql); - print "
'; print ''; @@ -203,7 +202,6 @@ if ($resql) print ''; print ''; print "
"; + print '
'; } else diff --git a/htdocs/contrat/tpl/linkedobjectblock.tpl.php b/htdocs/contrat/tpl/linkedobjectblock.tpl.php index f7f840dce13..412d07cb726 100644 --- a/htdocs/contrat/tpl/linkedobjectblock.tpl.php +++ b/htdocs/contrat/tpl/linkedobjectblock.tpl.php @@ -26,7 +26,7 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; $langs->load("contracts"); echo '
'; -print_titre($langs->trans('RelatedContracts')); +print load_fiche_titre($langs->trans('RelatedContracts')); ?> @@ -34,19 +34,21 @@ print_titre($langs->trans('RelatedContracts')); + $objectlink) { - $object->fetch_lines(); + $objectlink->fetch_lines(); $var=!$var; ?> > - - + + - + + diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php new file mode 100644 index 00000000000..27e5d8f602b --- /dev/null +++ b/htdocs/core/actions_builddoc.inc.php @@ -0,0 +1,108 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/core/actions_builddoc.inc.php + * \brief Code for actions on building or deleting documents + */ + + +// $action must be defined +// $id must be defined +// $object must be defined and must have a method generateDocument. +// $permissioncreate must be defined +// $upload_dir must be defined (example $conf->projet->dir_output . "/";) +// $hidedetails, $hidedesc and $hideref may have been set or not. + + +// Build doc +if ($action == 'builddoc' && $permissioncreate) +{ + if (is_numeric(GETPOST('model'))) + { + $error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Model")); + } + else + { + // Reload to get all modified line records and be ready for hooks + $ret = $object->fetch($id); + $ret = $object->fetch_thirdparty(); + /*if (empty($object->id) || ! $object->id > 0) + { + dol_print_error('Object must have been loaded by a fetch'); + exit; + }*/ + + // Save last template used to generate document + if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha')); + + // Special case for invoices + if (property_exists($object, 'fk_bank')) + { + if (GETPOST('fk_bank')) { // this field may come from an external module + $object->fk_bank = GETPOST('fk_bank'); + } else { + $object->fk_bank = $object->fk_account; + } + } + + $outputlangs = $langs; + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($object->client->default_lang)) $newlang=$object->client->default_lang; // for proposal, order, invoice, ... + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($object->default_lang)) $newlang=$object->default_lang; // for thirdparty + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + // To be sure vars is defined + if (empty($hidedetails)) $hidedetails=0; + if (empty($hidedesc)) $hidedesc=0; + if (empty($hideref)) $hideref=0; + + $result= $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result <= 0) + { + setEventMessages($object->error, $object->errors, 'errors'); + $action=''; + } + } +} + +// Delete file in doc form +if ($action == 'remove_file' && $permissioncreate) +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + if (empty($object->id) || ! $object->id > 0) + { + // Reload to get all modified line records and be ready for hooks + $ret = $object->fetch($id); + $ret = $object->fetch_thirdparty(); + } + + $langs->load("other"); + $filetodelete=GETPOST('file','alpha'); + $file = $upload_dir . '/' . $filetodelete; + $ret=dol_delete_file($file,0,0,0,$object); + if ($ret) setEventMessage($langs->trans("FileWasRemoved", $filetodelete)); + else setEventMessage($langs->trans("ErrorFailToDeleteFile", $filetodelete), 'errors'); +} + diff --git a/htdocs/core/actions_dellink.inc.php b/htdocs/core/actions_dellink.inc.php new file mode 100644 index 00000000000..45fb8c5f9ec --- /dev/null +++ b/htdocs/core/actions_dellink.inc.php @@ -0,0 +1,39 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/core/actions_dellink.inc.php + * \brief Code for actions on deleting link between elements + */ + + +// $action must be defined +// $object must be defined +// $permissiondellink must be defined +// $uploaddir (example $conf->projet->dir_output . "/";) + +$dellinkid = GETPOST('dellinkid','int'); + +// Set public note +if ($action == 'dellink' && ! empty($permissiondellink) && ! GETPOST('cancel') && $dellinkid > 0) +{ + $result=$object->deleteObjectLinked(0, '', 0, '', $dellinkid); + if ($result < 0) setEventMessages($object->error,$object->errors,'errors'); +} + + diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index d27e6e59fb4..67458fd401d 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -47,7 +47,7 @@ if (GETPOST('addfile')) /* * Remove file in email form */ -if (! empty($_POST['removedfile'])) +if (! empty($_POST['removedfile']) && empty($_POST['removAll'])) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -60,11 +60,41 @@ if (! empty($_POST['removedfile'])) $action='presend'; } +/* + * Remove all files in email form + */ + +if(! empty($_POST['removAll'])) +{ + $listofpaths=array(); + $listofnames=array(); + $listofmimes=array(); + if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]); + if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]); + if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]); + + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + + foreach($listofpaths as $key => $value) + { + $pathtodelete = $value; + $filetodelete = $listofnames[$key]; + $result = dol_delete_file($pathtodelete,1); // Delete uploded Files + + $langs->load("other"); + setEventMessage($langs->trans("FileWasRemoved",$filetodelete)); + + $formmail->remove_attached_files($key); // Update Session + } +} + /* * Send mail */ -if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_POST['cancel'] && !$_POST['modelselected']) +if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_POST['removAll'] && ! $_POST['removedfile'] && ! $_POST['cancel'] && !$_POST['modelselected']) { + if($conf->dolimail->enabled) $langs->load("dolimail@dolimail"); $langs->load('mails'); $subject='';$actionmsg='';$actionmsg2=''; @@ -81,7 +111,37 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO else if ($object->element == 'societe') { $thirdparty=$object; - $sendtosocid=$thirdparty->id; + if ($thirdparty->id > 0) $sendtosocid=$thirdparty->id; + elseif($conf->dolimail->enabled) + { + $dolimail = new Dolimail($db); + $possibleaccounts=$dolimail->get_societe_by_email($_POST['sendto'],"1"); + $possibleuser=$dolimail->get_from_user_by_mail($_POST['sendto'],"1"); // suche in llx_societe and socpeople + if (!$possibleaccounts && !$possibleuser) + { + setEventMessage($langs->trans('ErrorFailedToFindSocieteRecord',$_POST['sendto']),'errors'); + } + elseif (count($possibleaccounts)>1) + { + $sendtosocid=$possibleaccounts[1]['id']; + $result=$object->fetch($sendtosocid); + + setEventMessage($langs->trans('ErrorFoundMoreThanOneRecordWithEmail',$_POST['sendto'],$object->name)); + } + else + { + if($possibleaccounts){ + $sendtosocid=$possibleaccounts[1]['id']; + $result=$object->fetch($sendtosocid); + }elseif($possibleuser){ + $sendtosocid=$possibleuser[0]['id']; + + $result=$uobject->fetch($sendtosocid); + $object=$uobject; + } + + } + } } else dol_print_error('','Use actions_sendmails.in.php for a type that is not supported'); @@ -163,6 +223,46 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $trackid = GETPOST('trackid','aZ'); + if($conf->dolimail->enabled) + { + $mailfromid = explode ("#", $_POST['frommail'],3); + if (count($mailfromid)==0) $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>'; + else + { + $mbid = $mailfromid[1]; + + /*IMAP Postbox*/ + $mailboxconfig = new IMAP($db); + $mailboxconfig->fetch($mbid); + if ($mailboxconfig->mailbox_imap_host) $ref=$mailboxconfig->get_ref(); + + $mailboxconfig->folder_id=$mailboxconfig->mailbox_imap_outbox; + $mailboxconfig->userfolder_fetch(); + + if ($mailboxconfig->mailbox_save_sent_mails == 1) + { + + $folder=str_replace($ref, '', $mailboxconfig->folder_cache_key); + if (!$folder) $folder = "Sent"; + + $mailboxconfig->mbox = imap_open($mailboxconfig->get_connector_url().$folder, $mailboxconfig->mailbox_imap_login, $mailboxconfig->mailbox_imap_password); + if (FALSE === $mailboxconfig->mbox) + { + $info = FALSE; + $err = $langs->trans('Error3_Imap_Connection_Error'); + setEventMessage($err,$mailboxconfig->element,'errors'); + } + else + { + $mailboxconfig->mailboxid=$_POST['frommail']; + $mailboxconfig->foldername=$folder; + $from = $mailfromid[0] . $mailfromid[2]; + $imap=1; + } + + } + } + } // Send mail require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid); @@ -176,7 +276,26 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO if ($result) { $error=0; - + if($conf->dolimail->enabled) + { + $mid = (GETPOST('mid','int') ? GETPOST('mid','int') : 0); + if ($mid) + { + // set imap flag answered if it is a answered mail + + $dolimail=new DoliMail($db); + $dolimail->id = $mid; + $res=$dolimail->set_prop($user, 'answered',1); + } + if ($imap==1) + { + // write mail to IMAP Server + $movemail = $mailboxconfig->putMail($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$folder,$deliveryreceipt,$mailfile); + if ($movemail) setEventMessage($langs->trans("MailMovedToImapFolder",$folder),'mesgs'); + else setEventMessage($langs->trans("MailMovedToImapFolder_Warning",$folder),'warnings'); + } + } + // Initialisation donnees $object->socid = $sendtosocid; // To link to a company $object->sendtoid = $sendtoid; // To link to a contact/address @@ -205,24 +324,27 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO // This avoid sending mail twice if going out and then back to page $mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); setEventMessage($mesg); - header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.$object->id); + if($conf->dolimail->enabled) header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.$object->id.'&'.($paramname2?$paramname2:'mid').'='.$parm2val); + else header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.$object->id); exit; } } else { $langs->load("other"); + $mesg='
'; if ($mailfile->error) { - $mesg=''; $mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto); $mesg.='
'.$mailfile->error; - setEventMessage($mesg,'errors'); } else { - setEventMessage('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', 'warnings'); + $mesg.='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; } + $mesg.='
'; + + setEventMessage($mesg,'warnings'); $action = 'presend'; } } diff --git a/htdocs/core/ajax/box.php b/htdocs/core/ajax/box.php index 2d14a319a80..63f96a0c513 100644 --- a/htdocs/core/ajax/box.php +++ b/htdocs/core/ajax/box.php @@ -27,6 +27,7 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; diff --git a/htdocs/core/ajax/security.php b/htdocs/core/ajax/security.php index 5bdd45c75d4..28a53a87679 100644 --- a/htdocs/core/ajax/security.php +++ b/htdocs/core/ajax/security.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2011-2015 Regis Houssin * * 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 @@ -17,7 +17,8 @@ /** * \file htdocs/core/ajax/security.php - * \brief File for return security data + * \brief This ajax component is used to generated has keys for security purposes + * like key to use into URL to protect them. */ if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal @@ -26,6 +27,7 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); require '../../main.inc.php'; @@ -33,10 +35,6 @@ require '../../main.inc.php'; * View */ -// Ajout directives pour resoudre bug IE -//header('Cache-Control: Public, must-revalidate'); -//header('Pragma: public'); - //top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header. top_httphead(); @@ -48,7 +46,7 @@ if (isset($_GET['action']) && ! empty($_GET['action'])) if ($_GET['action'] == 'getrandompassword' && $user->admin) { require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; - $generic = $_GET['generic']; + $generic = $_GET['generic'] ? true : false; echo getRandomPassword($generic); } } diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php new file mode 100644 index 00000000000..1783c4794b5 --- /dev/null +++ b/htdocs/core/ajax/selectsearchbox.php @@ -0,0 +1,48 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/ajax/selectsearchbox.php + * \ingroup core + * \brief This script returns content of possible search + */ + + +// This script is called with a POST method. +// Directory to scan (full path) is inside POST['dir']. + +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); // Disables token renewal +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); + +$res=@include '../../main.inc.php'; +include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; + + +$search_boxvalue=GETPOST('q'); + +$arrayresult=array('a'=>'aaaa', 'b'=>'bbbb'); + +if ($conf->projet->enabled) +{ + $arrayresult['searchintoproject']=$langs->trans("SearchIntoProject", $search_boxvalue); +} +print json_encode($arrayresult); + +if (is_object($db)) $db->close(); diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 4695be5eaa0..18a09af6ace 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -82,7 +82,8 @@ class box_contacts extends ModeleBoxes $societestatic=new Societe($db); $line = 0; - while ($line < $num) { + while ($line < $num) + { $objp = $db->fetch_object($result); $datec=$db->jdate($objp->datec); $datem=$db->jdate($objp->tms); @@ -92,7 +93,6 @@ class box_contacts extends ModeleBoxes $contactstatic->firstname=$objp->firstname; $contactstatic->civility_id=$objp->civility_id; $contactstatic->statut=$objp->status; - $societestatic->id = $objp->fk_soc; $societestatic->code_client = $objp->code_client; $societestatic->name = $objp->socname; @@ -105,7 +105,7 @@ class box_contacts extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'align="left"', - 'text' => $societestatic->getNomUrl(1), + 'text' => ($objp->fk_soc > 0 ? $societestatic->getNomUrl(1) : ''), 'asis' => 1, ); diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index d04c3e48a3b..f50bff34a86 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -108,12 +108,18 @@ class box_factures extends ModeleBoxes $facturestatic->total_ht = $objp->total_ht; $facturestatic->total_tva = $objp->total_tva; $facturestatic->total_ttc = $objp->total_ttc; + $facturestatic->statut = $objp->fk_statut; + $facturestatic->date_lim_reglement = $db->jdate($objp->datelimite); + $societestatic->id = $objp->socid; $societestatic->name = $objp->name; $societestatic->code_client = $objp->code_client; + $late = ''; - if ($objp->paye == 0 && ($objp->fk_statut != 2 && $objp->fk_statut != 3) && $datelimite < ($now - $conf->facture->client->warning_delay)) { $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));} + if ($facturestatic->hasDelay()) { + $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day'))); + } $this->info_box_contents[$line][] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 2f31fa61f78..7c90bb69683 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -93,7 +93,6 @@ class box_factures_fourn extends ModeleBoxes if ($result) { $num = $db->num_rows($result); - $now=dol_now(); $line = 0; $l_due_date = $langs->trans('Late').' ('.$langs->trans('DateEcheance').': %s)'; @@ -108,6 +107,8 @@ class box_factures_fourn extends ModeleBoxes $facturestatic->total_ht = $objp->total_ht; $facturestatic->total_tva = $objp->total_tva; $facturestatic->total_ttc = $objp->total_ttc; + $facturestatic->date_echeance = $datelimite; + $facturestatic->statut = $objp->fk_statut; $thirdpartytmp->id = $objp->socid; $thirdpartytmp->name = $objp->name; $thirdpartytmp->fournisseur = 1; @@ -115,7 +116,10 @@ class box_factures_fourn extends ModeleBoxes $thirdpartytmp->logo = $objp->logo; $late = ''; - if ($objp->paye == 0 && $datelimite && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day'))); + + if ($facturestatic->hasDelay()) { + $late=img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day'))); + } $this->info_box_contents[$line][] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index ecea4a27fd1..9bf302b2e18 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -86,11 +86,12 @@ class box_factures_fourn_imp extends ModeleBoxes if ($result) { $num = $db->num_rows($result); - $now=dol_now(); $line = 0; $l_due_date = $langs->trans('Late').' ('.$langs->trans('DateEcheance').': %s)'; + $facturestatic = new FactureFournisseur($db); + while ($line < $num) { $objp = $db->fetch_object($result); @@ -99,9 +100,13 @@ class box_factures_fourn_imp extends ModeleBoxes $thirdpartytmp->name = $objp->name; $thirdpartytmp->code_client = $objp->code_client; $thirdpartytmp->logo = $objp->logo; + $facturestatic->date_echeance = $datelimite; + $facturestatic->statut = $objp->fk_statut; $late=''; - if ($datelimite && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day'))); + if ($facturestatic->hasDelay()) { + $late=img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day'))); + } $tooltip = $langs->trans('SupplierInvoice') . ': ' . ($objp->ref?$objp->ref:$objp->facid) . '
' . $langs->trans('RefSupplier') . ': ' . $objp->ref_supplier; $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 42e889138cc..63ce986e181 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -108,6 +108,8 @@ class box_factures_imp extends ModeleBoxes $facturestatic->total_ht = $objp->total_ht; $facturestatic->total_tva = $objp->total_tva; $facturestatic->total_ttc = $objp->total_ttc; + $facturestatic->statut = $objp->fk_statut; + $facturestatic->date_lim_reglement = $db->jdate($objp->datelimite); $societestatic->id = $objp->socid; $societestatic->name = $objp->name; $societestatic->client = 1; @@ -115,7 +117,9 @@ class box_factures_imp extends ModeleBoxes $societestatic->logo = $objp->logo; $late=''; - if ($datelimite < ($now - $conf->facture->client->warning_delay)) $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day'))); + if ($facturestatic->hasDelay()) { + $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day'))); + } $this->info_box_contents[$line][] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index b3f2144b28b..3895a27a9f1 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -155,7 +155,6 @@ class box_prospect extends ModeleBoxes ); } } else { - dol_syslog("box_prospect::loadBox not allowed de read this box content",LOG_ERR); $this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed"), diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index bcddc7f00e6..d6a65884ffb 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -82,7 +82,7 @@ class box_task extends ModeleBoxes $sql = "SELECT pt.fk_statut, count(pt.rowid) as nb, sum(ptt.task_duration) as durationtot, sum(pt.planned_workload) as plannedtot"; $sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet_task_time as ptt"; - $sql.= " WHERE DATE_FORMAT(pt.datec,'%Y') = ".date("Y")." "; + $sql.= " WHERE DATE_FORMAT(pt.datec,'%Y') = '".date("Y")."' "; $sql.= " AND pt.rowid = ptt.fk_task"; $sql.= " GROUP BY pt.fk_statut "; $sql.= " ORDER BY pt.fk_statut DESC"; @@ -122,7 +122,8 @@ class box_task extends ModeleBoxes // Add the sum à the bottom of the boxes - $this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" ', 'text' => $langs->trans("Total")." ".$textHead); + $this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left"', 'text' => $langs->trans("Total")." ".$textHead); + $this->info_box_contents[$i][1] = array('td' => '', 'text' => ""); $this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks")); $this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5)); $this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5)); diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 2c58848fe4f..b3da46ff366 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -375,19 +375,19 @@ class CMailFile if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { - - dol_include_once('/core/class/hookmanager.class.php'); - $hookmanager=new HookManager($db); - $hookmanager->initHooks(array('maildao')); - $reshook=$hookmanager->executeHooks('doactions',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - if (!empty($reshook)) - { + dol_include_once('/core/class/hookmanager.class.php'); + $hookmanager = new HookManager($db); + $hookmanager->initHooks(array( + 'maildao' + )); + $reshook = $hookmanager->executeHooks('doactions', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if (! empty($reshook)) + { + $this->error = "Error in hook maildao doactions " . $reshook; + dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_ERR); - $this->error="Error in hook maildao doactions ".$reshook; - dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); - - return $reshook; - } + return $reshook; + } // Action according to choosed sending method if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5bc08cab739..fbef4168743 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -53,6 +53,11 @@ abstract class CommonObject */ public $error; + /** + * @var string[] Array of error strings + */ + public $errors=array(); + /** * @var string Key value used to track if data is coming from import wizard */ @@ -82,11 +87,6 @@ abstract class CommonObject // Following vars are used by some objects only. We keep this property here in CommonObject to be able to provide common method using them. - /** - * @var string[] Array of error strings - */ - public $errors=array(); - /** * @var string[] Can be used to pass information when only object is provided to method */ @@ -131,6 +131,7 @@ abstract class CommonObject public $thirdparty; /** * @deprecated + * @var Societe A related customer * @see thirdparty */ public $client; @@ -283,27 +284,27 @@ abstract class CommonObject public $note; /** - * @var float + * @var float Total amount before taxes * @see update_price() */ public $total_ht; /** - * @var float + * @var float Total VAT amount * @see update_price() */ public $total_tva; /** - * @var float + * @var float Total local tax 1 amount * @see update_price() */ public $total_localtax1; /** - * @var float + * @var float Total local tax 2 amount * @see update_price() */ public $total_localtax2; /** - * @var float + * @var float Total amount with taxes * @see update_price() */ public $total_ttc; @@ -389,7 +390,7 @@ abstract class CommonObject * * @param Translate $langs Language object for translation of civility * @param int $option 0=No option, 1=Add civility - * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname + * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname, 2=Firstname * @param int $maxlen Maximum length * @return string String with full name */ @@ -452,13 +453,15 @@ abstract class CommonObject // Check parameters if ($fk_socpeople <= 0) { - $this->error=$langs->trans("ErrorWrongValueForParameter","1"); + $langs->load("errors"); + $this->error=$langs->trans("ErrorWrongValueForParameterX","1"); dol_syslog(get_class($this)."::add_contact ".$this->error,LOG_ERR); return -1; } if (! $type_contact) { - $this->error=$langs->trans("ErrorWrongValueForParameter","2"); + $langs->load("errors"); + $this->error=$langs->trans("ErrorWrongValueForParameterX","2"); dol_syslog(get_class($this)."::add_contact ".$this->error,LOG_ERR); return -2; } @@ -486,7 +489,7 @@ abstract class CommonObject } $datecreate = dol_now(); - + $this->db->begin(); // Insertion dans la base @@ -504,7 +507,11 @@ abstract class CommonObject if (! $notrigger) { $result=$this->call_trigger(strtoupper($this->element).'_ADD_CONTACT', $user); - if ($result < 0) { $this->db->rollback(); return -1; } + if ($result < 0) + { + $this->db->rollback(); + return -1; + } } $this->db->commit(); @@ -2159,14 +2166,14 @@ abstract class CommonObject $sourcetype = (! empty($sourcetype) ? $sourcetype : $this->element); $targettype = (! empty($targettype) ? $targettype : $this->element); - if (empty($sourceid) && empty($targetid)) + /*if (empty($sourceid) && empty($targetid)) { dol_syslog('Bad usage of function. No source nor target id defined (nor as parameter nor as object id)', LOG_ERR); return -1; - } + }*/ // Links between objects are stored in table element_element - $sql = 'SELECT fk_source, sourcetype, fk_target, targettype'; + $sql = 'SELECT rowid, fk_source, sourcetype, fk_target, targettype'; $sql.= ' FROM '.MAIN_DB_PREFIX.'element_element'; $sql.= " WHERE "; if ($justsource || $justtarget) @@ -2201,11 +2208,11 @@ abstract class CommonObject $obj = $this->db->fetch_object($resql); if ($obj->fk_source == $sourceid) { - $this->linkedObjectsIds[$obj->targettype][]=$obj->fk_target; + $this->linkedObjectsIds[$obj->targettype][$obj->rowid]=$obj->fk_target; } if ($obj->fk_target == $targetid) { - $this->linkedObjectsIds[$obj->sourcetype][]=$obj->fk_source; + $this->linkedObjectsIds[$obj->sourcetype][$obj->rowid]=$obj->fk_source; } $i++; } @@ -2260,16 +2267,15 @@ abstract class CommonObject $classfile = 'fournisseur.commande'; $classname = 'CommandeFournisseur'; } + // Here $module, $classfile and $classname are set if ($conf->$module->enabled && (($element != $this->element) || $alsosametype)) { dol_include_once('/'.$classpath.'/'.$classfile.'.class.php'); - $num=count($objectids); - - for ($i=0;$i<$num;$i++) + foreach($objectids as $i => $objectid); // $i is rowid into llx_element_element { $object = new $classname($this->db); - $ret = $object->fetch($objectids[$i]); + $ret = $object->fetch($objectid); if ($ret >= 0) { $this->linkedObjects[$objecttype][$i] = $object; @@ -2338,10 +2344,11 @@ abstract class CommonObject * @param string $sourcetype Object source type * @param int $targetid Object target id * @param string $targettype Object target type - * @return int >0 if OK, <0 if KO + * @param int $rowid Row id of line to delete. If defined, other parameters are not used. + * @return int >0 if OK, <0 if KO * @see add_object_linked, updateObjectLinked, fetchObjectLinked */ - function deleteObjectLinked($sourceid=null, $sourcetype='', $targetid=null, $targettype='') + function deleteObjectLinked($sourceid=null, $sourcetype='', $targetid=null, $targettype='', $rowid='') { $deletesource=false; $deletetarget=false; @@ -2356,21 +2363,28 @@ abstract class CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_element"; $sql.= " WHERE"; - if ($deletesource) + if ($rowid > 0) { - $sql.= " fk_source = ".$sourceid." AND sourcetype = '".$sourcetype."'"; - $sql.= " AND fk_target = ".$this->id." AND targettype = '".$this->element."'"; - } - else if ($deletetarget) - { - $sql.= " fk_target = ".$targetid." AND targettype = '".$targettype."'"; - $sql.= " AND fk_source = ".$this->id." AND sourcetype = '".$this->element."'"; + $sql.=" rowid = ".$rowid; } else { - $sql.= " (fk_source = ".$this->id." AND sourcetype = '".$this->element."')"; - $sql.= " OR"; - $sql.= " (fk_target = ".$this->id." AND targettype = '".$this->element."')"; + if ($deletesource) + { + $sql.= " fk_source = ".$sourceid." AND sourcetype = '".$sourcetype."'"; + $sql.= " AND fk_target = ".$this->id." AND targettype = '".$this->element."'"; + } + else if ($deletetarget) + { + $sql.= " fk_target = ".$targetid." AND targettype = '".$targettype."'"; + $sql.= " AND fk_source = ".$this->id." AND sourcetype = '".$this->element."'"; + } + else + { + $sql.= " (fk_source = ".$this->id." AND sourcetype = '".$this->element."')"; + $sql.= " OR"; + $sql.= " (fk_target = ".$this->id." AND targettype = '".$this->element."')"; + } } dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG); @@ -2381,6 +2395,7 @@ abstract class CommonObject else { $this->error=$this->db->lasterror(); + $this->errors[]=$this->error; return -1; } } @@ -2792,10 +2807,11 @@ abstract class CommonObject // -------------------- /** - * Show linked object block. + * Show linked object block. * - * @return int <0 if KO, >0 if OK - * @deprecated 3.8 Use instead $form->shoLinkedObjectBlock($object) + * @return int <0 if KO, >0 if OK + * @deprecated 3.8 Use instead $form->showLinkedObjectBlock($object) + * @see Form::showLinkedObjectBlock */ function showLinkedObjectBlock() { @@ -3269,12 +3285,12 @@ abstract class CommonObject * Need $this->element & $this->id * * @param int $resource_id Resource id - * @param string $resource_element Resource element + * @param string $resource_type 'resource' * @param int $busy Busy or not * @param int $mandatory Mandatory or not * @return int <=0 if KO, >0 if OK */ - function add_element_resource($resource_id,$resource_element,$busy=0,$mandatory=0) + function add_element_resource($resource_id, $resource_type, $busy=0, $mandatory=0) { $this->db->begin(); @@ -3287,7 +3303,7 @@ abstract class CommonObject $sql.= ", mandatory"; $sql.= ") VALUES ("; $sql.= $resource_id; - $sql.= ", '".$resource_element."'"; + $sql.= ", '".$resource_type."'"; $sql.= ", '".$this->id."'"; $sql.= ", '".$this->element."'"; $sql.= ", '".$busy."'"; @@ -3424,7 +3440,6 @@ abstract class CommonObject require_once $file; $obj = new $classname($this->db); - //$obj->message = $message; // If generator is ODT, we must have srctemplatepath defined, if not we set it. if ($obj->type == 'odt' && empty($srctemplatepath)) @@ -3462,11 +3477,20 @@ abstract class CommonObject if (empty($srctemplatepath)) { - $this->error='ErrorGenerationAskedForOdtTemplateWithNoSrcFileFound'; + $this->error='ErrorGenerationAskedForOdtTemplateWithSrcFileNotDefined'; return -1; } } + if ($obj->type == 'odt' && ! empty($srctemplatepath)) + { + if (! dol_is_file($srctemplatepath)) + { + $this->error='ErrorGenerationAskedForOdtTemplateWithSrcFileNotFound'; + return -1; + } + } + // We save charset_output to restore it because write_file can change it if needed for // output format that does not support UTF8. $sav_charset_output=$outputlangs->charset_output; @@ -3527,7 +3551,47 @@ abstract class CommonObject /* Functions common to commonobject and commonobjectline */ + /* For default values */ + /** + * Return the default value to use for a field when showing the create form of object. + * Return values in this order: + * 1) If parameter is available into POST, we return it first. + * 2) If not but an alternate value was provided as parameter of function, we return it. + * 3) If not but a constant $conf->global->OBJECTELEMENT_FIELDNAME is set, we return it (It is better to use the dedicated table). + * 4) Return value found into database (TODO No yet implemented) + * + * @param string $fieldname Name of field + * @param string $alternatevalue Alternate value to use + * @return string Default value + **/ + function getDefaultCreateValueFor($fieldname, $alternatevalue=null) + { + global $conf, $_POST; + + // If param is has been posted with use this value first. + if (isset($_POST[$fieldname])) return GETPOST($fieldname, 2); + + if (isset($alternatevalue)) return $alternatevalue; + + $newelement=$this->element; + if ($newelement == 'facture') $newelement='invoice'; + if ($newelement == 'commande') $newelement='order'; + if (empty($newelement)) + { + dol_syslog("Ask a default value using common method getDefaultCreateValueForField on an object with no property ->element defined. Return empty string.", LOG_WARNING); + return ''; + } + + $keyforfieldname=strtoupper($newelement.'_DEFAULT_'.$fieldname); + //var_dump($keyforfieldname); + if (isset($conf->global->$keyforfieldname)) return $conf->global->$keyforfieldname; + + // TODO Ad here a scan into table llx_overwrite_default with a filter on $this->element and $fieldname + + } + + /* For triggers */ @@ -3580,6 +3644,11 @@ abstract class CommonObject { if (empty($rowid)) $rowid=$this->id; + //To avoid SQL errors. Probably not the better solution though + if (!$this->table_element) { + return 0; + } + if (! is_array($optionsArray)) { // optionsArray not already loaded, so we load it @@ -3786,7 +3855,7 @@ abstract class CommonObject */ function showOptionals($extrafields, $mode='view', $params=null, $keyprefix='') { - global $_POST, $conf; + global $_POST, $conf, $langs; $out = ''; @@ -3844,7 +3913,7 @@ abstract class CommonObject if($extrafields->attribute_required[$key]) $label = ''.$label.''; - $out .= '
'; + $out .= ''; $out .=''; switch($mode) { diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index ef854a2452e..5bcbab5934a 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -43,9 +43,6 @@ abstract class CommonObjectLine extends CommonObject */ public $rowid; - //! Database handler - public $db; - /** * Product/service unit code ('km', 'm', 'p', ...) * @var string diff --git a/htdocs/core/class/commonorder.class.php b/htdocs/core/class/commonorder.class.php index 5309b5524ee..74d14af0819 100644 --- a/htdocs/core/class/commonorder.class.php +++ b/htdocs/core/class/commonorder.class.php @@ -137,36 +137,6 @@ abstract class CommonOrderLine extends CommonObjectLine public $localtax1_type; public $localtax2_type; - /** - * Total amount before taxes - * @var float - */ - public $total_ht; - - /** - * Total VAT amount - * @var float - */ - public $total_tva; - - /** - * Total local tax 1 amount - * @var float - */ - public $total_localtax1; - - /** - * Total local tax 2 amount - * @var float - */ - public $total_localtax2; - - /** - * Total amount with taxes - * @var float - */ - public $total_ttc; - /** * Liste d'options cumulables: * Bit 0: 0 si TVA normal - 1 si TVA NPR diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 13d2881563f..b3e5b843c28 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -110,6 +110,7 @@ class Conf $this->bank = new stdClass(); $this->notification = new stdClass(); $this->mailing = new stdClass(); + $this->expensereport = new stdClass(); } @@ -345,6 +346,9 @@ class Conf // Module contrat $this->contrat->dir_output=$rootfordata."/contracts"; $this->contrat->dir_temp =$rootfordata."/contracts/temp"; + // Module bank + $this->bank->dir_output=$rootfordata."/bank"; + $this->bank->dir_temp =$rootfordata."/bank/temp"; // Set some default values @@ -474,6 +478,7 @@ class Conf $this->adherent->cotisation = new stdClass(); $this->bank->rappro = new stdClass(); $this->bank->cheque = new stdClass(); + $this->expensereport->payment = new stdClass(); $this->actions->warning_delay=(isset($this->global->MAIN_DELAY_ACTIONS_TODO)?$this->global->MAIN_DELAY_ACTIONS_TODO:7)*24*60*60; $this->commande->client->warning_delay=(isset($this->global->MAIN_DELAY_ORDERS_TO_PROCESS)?$this->global->MAIN_DELAY_ORDERS_TO_PROCESS:2)*24*60*60; $this->commande->fournisseur->warning_delay=(isset($this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS)?$this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS:7)*24*60*60; @@ -486,6 +491,7 @@ class Conf $this->adherent->cotisation->warning_delay=(isset($this->global->MAIN_DELAY_MEMBERS)?$this->global->MAIN_DELAY_MEMBERS:0)*24*60*60; $this->bank->rappro->warning_delay=(isset($this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE)?$this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE:0)*24*60*60; $this->bank->cheque->warning_delay=(isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT)?$this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT:0)*24*60*60; + $this->expensereport->payment->warning_delay=(isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY)?$this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY:0)*24*60*60; // For modules that want to disable top or left menu if (! empty($this->global->MAIN_HIDE_TOP_MENU)) $this->dol_hide_topmenu=$this->global->MAIN_HIDE_TOP_MENU; diff --git a/htdocs/core/class/cookie.class.php b/htdocs/core/class/cookie.class.php index ba519fab365..1d28861a44e 100644 --- a/htdocs/core/class/cookie.class.php +++ b/htdocs/core/class/cookie.class.php @@ -43,9 +43,10 @@ class DolCookie var $cookie; /** - * Constructor + * Constructor * - * @param string $key Personnal key + * @param string $key Personnal key + * @deprecated */ function __construct($key = '') { diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index db303ee7d1b..60d24558d86 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -52,7 +52,7 @@ class DolEditor * @param string $content Content of WYSIWIG field * @param int $width Width in pixel of edit area (auto by default) * @param int $height Height in pixel of edit area (200px by default) - * @param string $toolbarname Name of bar set to use ('Full', 'dolibarr_notes[_encoded]', 'dolibarr_details[_encoded]', 'dolibarr_mailings[_encoded]', ') + * @param string $toolbarname Name of bar set to use ('Full', 'dolibarr_notes[_encoded]', 'dolibarr_details[_encoded]'=the less featured, 'dolibarr_mailings[_encoded]', ') * @param string $toolbarlocation Where bar is stored : * 'In' each window has its own toolbar * 'Out:name' share toolbar into the div called 'name' @@ -168,8 +168,11 @@ class DolEditor { if (! defined('REQUIRE_CKEDITOR')) define('REQUIRE_CKEDITOR','1'); - //$skin='kama'; - $skin='moono'; // default with cdeditor 4 + if (! empty($conf->global->FCKEDITOR_SKIN)) { + $skin = $conf->global->FCKEDITOR_SKIN; + } else { + $skin = 'moono'; // default with ckeditor 4 : moono + } $htmlencode_force=preg_match('/_encoded$/',$this->toolbarname)?'true':'false'; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 34abeeb8c6e..0807bbcec75 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -567,7 +567,7 @@ class ExtraFields /** * Load array this->attribute_xxx like attribute_label, attribute_type, ... * - * @param string $elementtype Type of element ('adherent', 'commande', thirdparty', 'facture', 'propal', 'product', ...) + * @param string $elementtype Type of element ('adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...) * @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED * @return array Array of attributes for all extra fields */ @@ -631,13 +631,15 @@ class ExtraFields /** * Return HTML string to put an input field into a page * - * @param string $key Key of attribute - * @param string $value Value to show (for date type it must be in timestamp format) - * @param string $moreparam To add more parametes on html input tag - * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) - * @return string + * @param string $key Key of attribute + * @param string $value Value to show (for date type it must be in timestamp format) + * @param string $moreparam To add more parametes on html input tag + * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) + * @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names) + * @param int $showsize Value for size attribute + * @return string */ - function showInputField($key,$value,$moreparam='',$keyprefix='') + function showInputField($key,$value,$moreparam='',$keyprefix='',$keysuffix='',$showsize=0) { global $conf,$langs; @@ -651,24 +653,27 @@ class ExtraFields $perms=$this->attribute_perms[$key]; $list=$this->attribute_list[$key]; - if ($type == 'date') + if (empty($showsize)) { - $showsize=10; + if ($type == 'date') + { + $showsize=10; + } + elseif ($type == 'datetime') + { + $showsize=19; + } + elseif (in_array($type,array('int','double'))) + { + $showsize=10; + } + else + { + $showsize=round($size); + if ($showsize > 48) $showsize=48; + } } - elseif ($type == 'datetime') - { - $showsize=19; - } - elseif (in_array($type,array('int','double'))) - { - $showsize=10; - } - else - { - $showsize=round($size); - if ($showsize > 48) $showsize=48; - } - + if (in_array($type,array('date','datetime'))) { $tmp=explode(',',$size); @@ -684,22 +689,22 @@ class ExtraFields if (! is_object($form)) $form=new Form($this->db); // TODO Must also support $moreparam - $out = $form->select_date($value, 'options_'.$key.$keyprefix, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1); + $out = $form->select_date($value, $keysuffix.'options_'.$key.$keyprefix, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1); } elseif (in_array($type,array('int'))) { $tmp=explode(',',$size); $newsize=$tmp[0]; - $out=''; + $out=''; } elseif ($type == 'varchar') { - $out=''; + $out=''; } elseif ($type == 'text') { require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('options_'.$key.$keyprefix,$value,'',200,'dolibarr_notes','In',false,false,! empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE,5,100); + $doleditor=new DolEditor($keysuffix.'options_'.$key.$keyprefix,$value,'',200,'dolibarr_notes','In',false,false,! empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE,5,100); $out=$doleditor->Create(1); } elseif ($type == 'boolean') @@ -710,26 +715,26 @@ class ExtraFields } else { $checked=' value="1" '; } - $out=''; + $out=''; } elseif ($type == 'mail') { - $out=''; + $out=''; } elseif ($type == 'phone') { - $out=''; + $out=''; } elseif ($type == 'price') { - $out=' '.$langs->getCurrencySymbol($conf->currency); + $out=' '.$langs->getCurrencySymbol($conf->currency); } elseif ($type == 'double') { if (!empty($value)) { $value=price($value); } - $out=' '; + $out=' '; } elseif ($type == 'select') { @@ -737,10 +742,10 @@ class ExtraFields if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $out.= ajax_combobox('options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT); + $out.= ajax_combobox($keysuffix.'options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT); } - $out.=''; $out.=''; foreach ($param['options'] as $key=>$val ) { @@ -758,10 +763,10 @@ class ExtraFields if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $out.= ajax_combobox('options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT); + $out.= ajax_combobox($keysuffix.'options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT); } - $out.=''; if (is_array($param['options'])) { $param_list=array_keys($param['options']); @@ -907,7 +912,7 @@ class ExtraFields foreach ($param['options'] as $keyopt=>$val ) { - $out.='$val ) { - $out.=''; @@ -1018,7 +1023,7 @@ class ExtraFields $labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' '; } } - $out .= 'rowid . '"'; $out .= 'checked'; @@ -1037,7 +1042,7 @@ class ExtraFields $labeltoshow = '(not defined)'; if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) { - $out .= 'rowid . '"'; $out .= 'checked'; @@ -1050,7 +1055,7 @@ class ExtraFields $parent = $parentName . ':' . $obj->{$parentField}; } - $out .= 'rowid . '"'; $out .= ((is_array($value_arr) && in_array($obj->rowid, $value_arr)) ? ' checked ' : ''); @@ -1080,7 +1085,7 @@ class ExtraFields dol_include_once($InfoFieldList[1]); $object = new $InfoFieldList[0]($this->db); $object->fetch($value); - $out=''; + $out=''; } /* Add comments @@ -1324,6 +1329,10 @@ class ExtraFields $value=$object->getNomUrl(3); } } + elseif ($type == 'text') + { + $value=dol_htmlentitiesbr($value); + } else { $showsize=round($size); @@ -1413,14 +1422,16 @@ class ExtraFields return 0; } } + /** * return array_options array for object by extrafields value (using for data send by forms) * - * @param array $extralabels $array of extrafields - * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) - * @return int 1 if array_options set / 0 if no value + * @param array $extralabels $array of extrafields + * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) + * @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names) + * @return int 1 if array_options set / 0 if no value */ - function getOptionalsFromPost($extralabels,$keyprefix='') + function getOptionalsFromPost($extralabels,$keyprefix='',$keysuffix='') { global $_POST; @@ -1435,24 +1446,24 @@ class ExtraFields if (in_array($key_type,array('date','datetime'))) { // Clean parameters - $value_key=dol_mktime($_POST["options_".$key.$keyprefix."hour"], $_POST["options_".$key.$keyprefix."min"], 0, $_POST["options_".$key.$keyprefix."month"], $_POST["options_".$key.$keyprefix."day"], $_POST["options_".$key.$keyprefix."year"]); + $value_key=dol_mktime($_POST[$keysuffix."options_".$key.$keyprefix."hour"], $_POST[$keysuffix."options_".$key.$keyprefix."min"], 0, $_POST[$keysuffix."options_".$key.$keyprefix."month"], $_POST[$keysuffix."options_".$key.$keyprefix."day"], $_POST[$keysuffix."options_".$key.$keyprefix."year"]); } else if (in_array($key_type,array('checkbox'))) { - $value_arr=GETPOST("options_".$key.$keyprefix); + $value_arr=GETPOST($keysuffix."options_".$key.$keyprefix); $value_key=implode($value_arr,','); } else if (in_array($key_type,array('price','double'))) { - $value_arr=GETPOST("options_".$key.$keyprefix); + $value_arr=GETPOST($keysuffix."options_".$key.$keyprefix); $value_key=price2num($value_arr); } else { - $value_key=GETPOST("options_".$key.$keyprefix); + $value_key=GETPOST($keysuffix."options_".$key.$keyprefix); } - $array_options["options_".$key]=$value_key; // No keyprefix here. keyprefix is used only for read. + $array_options[$keysuffix."options_".$key]=$value_key; // No keyprefix here. keyprefix is used only for read. } return $array_options; diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index cdb7f66ac5f..a38b034747b 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -125,7 +125,7 @@ class FileUpload if (!empty($parent->socid)) { $parent->fetch_thirdparty(); } - $object->$parentObject = dol_clone($parent); + $object->$parentObject = clone $parent; } else { $object->fetch_thirdparty(); } diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index d20dbf2d4f3..7d4dff8de44 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -34,7 +34,6 @@ class Fiscalyear extends CommonObject public $fk_element = ''; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - var $id; var $rowid; var $label; @@ -324,4 +323,4 @@ class Fiscalyear extends CommonObject } } -} \ No newline at end of file +} diff --git a/htdocs/core/class/genericobject.class.php b/htdocs/core/class/genericobject.class.php index c198525a07b..32960664c17 100644 --- a/htdocs/core/class/genericobject.class.php +++ b/htdocs/core/class/genericobject.class.php @@ -30,8 +30,6 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; class GenericObject extends CommonObject { - var $db; - /** * Constructor * diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index d1c5547cccc..a497b3cb7e2 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -95,6 +95,7 @@ class HookManager $pathroot = ''; // Include actions class overwriting hooks + dol_syslog('Loading hook:' . $actionfile, LOG_INFO); $resaction=dol_include_once($path.$actionfile); if ($resaction) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c7b7374a8f9..40d68bec667 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -364,7 +364,8 @@ class Form } /** - * Show a text and picto with tooltip on text or picto + * Show a text and picto with tooltip on text or picto. + * Can be called by an instancied $form->textwithtooltip or by a static call Form::textwithtooltip * * @param string $text Text to show * @param string $htmltext HTML content of tooltip. Must be HTML/UTF8 encoded. @@ -2072,10 +2073,12 @@ class Form if ($filterkey && $filterkey != '') $label=preg_replace('/('.preg_quote($filterkey).')/i','$1',$label,1); $opt.=$objp->ref; - if (! empty($objp->idprodfournprice)) $opt.=' ('.$objp->ref_fourn.')'; + if (! empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) + $opt.=' ('.$objp->ref_fourn.')'; $opt.=' - '; $outval.=$objRef; - if (! empty($objp->idprodfournprice)) $outval.=' ('.$objRefFourn.')'; + if (! empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) + $outval.=' ('.$objRefFourn.')'; $outval.=' - '; $opt.=dol_trunc($label, 72).' - '; $outval.=dol_trunc($label, 72).' - '; @@ -3013,6 +3016,8 @@ class Form global $langs; $langs->load("categories"); + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $cat = new Categorie($this->db); $cate_arbo = $cat->get_full_arbo($type,$excludeafterid); @@ -3232,7 +3237,7 @@ class Form $formconfirm.= ($question ? '
': ''); $formconfirm.= '
'."\n"; - $formconfirm.= "\n\n"; + $formconfirm.= "\n\n"; $formconfirm.= ''; - $formconfirm.= "\n"; + $formconfirm.= "\n"; } else { - $formconfirm.= "\n\n"; + $formconfirm.= "\n\n"; $formconfirm.= '
'."\n"; $formconfirm.= ''."\n"; @@ -3340,7 +3345,7 @@ class Form $formconfirm.= "\n"; $formconfirm.= '
'; - $formconfirm.= "\n"; + $formconfirm.= "\n"; } return $formconfirm; @@ -3576,7 +3581,7 @@ class Form print ''; print '
trans("Date"); ?>   trans("Status"); ?>
getNomUrl(1); ?>date_contrat,'day'); ?>getNomUrl(1); ?>date_contrat,'day'); ?>  getLibStatut(6); ?>getLibStatut(6); ?>">transnoentitiesnoconv("RemoveLink")); ?>
'.$label.''.$langs->trans($label).'
'; print ''; print ''; print '
'; - print $this->select_users($selected,$htmlname,1,$exclude,0,$include); + print $this->select_dolusers($selected,$htmlname,1,$exclude,0,$include); print '
'; @@ -4404,7 +4409,7 @@ class Form * @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect * @param array $array Array with key+value * @param string|string[] $id Preselected key or preselected keys for multiselect - * @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or ' '). + * @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or ' '), <0 to add an empty value with key that is this value. * @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value" * @param int $value_as_key 1 to use value as key * @param string $moreparam Add more parameters onto the select tag @@ -4453,7 +4458,7 @@ class Form { $textforempty=' '; if (! empty($conf->use_javascript_ajax)) $textforempty=' '; // If we use ajaxcombo, we need   here to avoid to have an empty element that is too small. - $out.=''."\n"; + $out.=''."\n"; // id is -2 because -1 is already "do not contact" } if (is_array($array)) @@ -4497,70 +4502,71 @@ class Form * Return a HTML select string, built from an array of key+value but content returned into select come from an Ajax call of an URL. * Note: Do not apply langs->trans function on returned content, content may be entity encoded twice. * - * @param string $htmlname Name of html select area - * @param string $url Url - * @param string $id Preselected key - * @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or ' '). - * @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value" - * @param int $value_as_key 1 to use value as key - * @param string $moreparam Add more parameters onto the select tag - * @param int $translate Translate and encode value - * @param int $maxlen Length maximum for labels - * @param int $disabled Html select box is disabled - * @param int $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' = Do not sort - * @param string $morecss Add more class to css styles - * @param int $addjscombo Add js combo - * @return string HTML select string. + * @param string $htmlname Name of html select area + * @param string $url Url + * @param string $id Preselected key + * @param string $moreparam Add more parameters onto the select tag + * @param string $moreparamtourl Add more parameters onto the Ajax called URL + * @param int $disabled Html select box is disabled + * @param int $minimumInputLength Minimum Input Length + * @param string $morecss Add more class to css styles + * @return string HTML select string. */ - static function selectArrayAjax($htmlname, $url, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0) + static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='') { $out = ''; - // Add code for jquery to use select2 - if ($addjscombo && empty($conf->dol_use_jmobile)) - { - $tmpplugin='select2'; - $out.=' - '; - } - else - { - // TODO get all values from $url into $array + $tmpplugin='select2'; + $out.=' + '; - $out.=self::selectarray('.'.$htmlname, $array, $id, $show_empty, $key_in_label, $value_as_key, '', $translate, $maxlen, $disabled, $sort, '', 0); + $out.=''; + return $out; } @@ -4664,13 +4670,15 @@ class Form * * @param int $id Id of object * @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact'). Old mode (0, 1, 2, ...) is deprecated. - * @param int $rendermode 0=Default, use multiselect. 1=Emulate multiselect + * @param int $rendermode 0=Default, use multiselect. 1=Emulate multiselect (recommended) * @return mixed Array of category objects or < 0 if KO */ function showCategories($id, $type, $rendermode=0) { global $db; + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $cat = new Categorie($db); $categories = $cat->containing($id, $type); @@ -4679,10 +4687,10 @@ class Form $toprint = array(); foreach($categories as $c) { - $ways = $c->print_all_ways(); + $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text foreach($ways as $way) { - $toprint[] = '
  • '.img_object('','category').' '.$way.'
  • '; + $toprint[] = '
  • color?' style="background: #'.$c->color.'"':'').'>'.img_object('','category').' '.$way.'
  • '; } } return '
      '.implode(' ', $toprint).'
    '; @@ -4900,20 +4908,20 @@ class Form print '
    ' . $langs->trans("AmountHTShort") . '' . $langs->trans("Company") . '
    '; - print ''; - print '' . $objp->ref . '' . $objp->ref_supplier . '' . price($objp->total_ht) . '' . $objp->name . '
    '; + print ''; + print '' . $objp->ref . '' . $objp->ref_supplier . '' . price($objp->total_ht) . '' . $objp->name . '
    '; // Link -print ''; print '
    '; - $ret.='
    '; - //} + $ret.='
    '; $ret.=dol_htmlentities($object->$fieldref); if ($morehtmlref) diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 9322680a682..60fbdc0c467 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -179,7 +179,7 @@ class FormActions elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter'); else $title=$langs->trans("Actions"); - print_titre($title); + print load_fiche_titre($title,'',''); $total = 0; $var=true; print ''; @@ -196,10 +196,7 @@ class FormActions foreach($listofactions as $action) { - $savlabel=$action->label; - $action->label=$action->ref; - $ref=$action->getNomUrl(1); - $action->label=$savlabel; + $ref=$action->getNomUrl(1,-1); $label=$action->getNomUrl(0,38); $var=!$var; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index f20acde69b7..000a2a35c13 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -75,7 +75,8 @@ class FormFile global $conf,$langs, $hookmanager; $hookmanager->initHooks(array('formfile')); - if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') return 0; + + if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $useajax=0; if ((! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) && $useajax) || ($useajax==2)) { @@ -86,13 +87,13 @@ class FormFile return $this->_formAjaxFileUpload($object); } else - { + { $maxlength=$size; $out = "\n\n\n"; if (empty($title)) $title=$langs->trans("AttachANewFile"); - if ($title != 'none') print_titre($title); + if ($title != 'none') $out.=load_fiche_titre($title, null, null); $out .= ''; $out .= ''; @@ -178,7 +179,7 @@ class FormFile $out .= '
    '; $out .= ''; $out .= ''; - print ''; + print ''; if (! $variantexxx) print ''; - print ''; + print ''; if (! $variante) print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/core/lib/salaries.lib.php b/htdocs/core/lib/salaries.lib.php index 7c104b4da82..6b25de4b656 100644 --- a/htdocs/core/lib/salaries.lib.php +++ b/htdocs/core/lib/salaries.lib.php @@ -51,12 +51,10 @@ function salaries_prepare_head($object) { $head[$h][2] = 'documents'; $h++; - /* $head[$h][0] = DOL_URL_ROOT.'/compta/salaries/info.php?id='.$object->id; $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; $h++; - */ complete_head_from_modules($conf,$langs,$object,$head,$h,'salaries', 'remove'); diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 78f8309a05b..0e7f74b32f7 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -90,7 +90,7 @@ function dol_hash($chain,$type=0) else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') return sha1($chain); else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') return sha1(md5($chain)); - // No enconding defined + // No particular enconding defined, use default return md5($chain); } diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 04e0fb133f6..3297047bef5 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -439,7 +439,7 @@ function encodedecode_dbpassconf($level=0) /** * Return a generated password using default module * - * @param boolean $generic true=Create generic password (use default crypt function), false=Use the configured password generation module + * @param boolean $generic true=Create generic password (use md5, sha1 depending on setup), false=Use the configured password generation module * @return string New value for password */ function getRandomPassword($generic=false) diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 1c0c589870e..50e3b1e97be 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -184,8 +184,8 @@ function show_list_sending_receive($origin,$origin_id,$filter='') if ($num) { - if ($filter) print_titre($langs->trans("OtherSendingsForSameOrder")); - else print_titre($langs->trans("SendingsAndReceivingForSameOrder")); + if ($filter) print load_fiche_titre($langs->trans("OtherSendingsForSameOrder")); + else print load_fiche_titre($langs->trans("SendingsAndReceivingForSameOrder")); print '
    '; - $out .= $langs->trans("Link") . ': '; + $out .= $langs->trans("URLToLink") . ': '; $out .= ''; $out .= '   ' . $langs->trans("Label") . ': '; $out .= ''; @@ -200,7 +201,9 @@ class FormFile if (empty($res)) { + print '
    '; print $out; + print '
    '; } print $hookmanager->resPrint; @@ -787,7 +790,7 @@ class FormFile $param = (isset($object->id)?'&id='.$object->id:'').$param; // Show list of existing files - if (empty($useinecm)) print_titre($title?$title:$langs->trans("AttachedFiles")); + if (empty($useinecm)) print load_fiche_titre($title?$title:$langs->trans("AttachedFiles")); if (empty($url)) $url=$_SERVER["PHP_SELF"]; print ''; print ''; @@ -948,7 +951,7 @@ class FormFile dol_syslog(get_class($this).'::list_of_autoecmfiles upload_dir='.$upload_dir.' modulepart='.$modulepart); // Show list of documents - if (empty($useinecm)) print_titre($langs->trans("AttachedFiles")); + if (empty($useinecm)) print load_fiche_titre($langs->trans("AttachedFiles")); if (empty($url)) $url=$_SERVER["PHP_SELF"]; print '
    '; print ''; @@ -1080,7 +1083,9 @@ class FormFile } } - if ($result > 0) { $found=1; $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]=dol_clone($object_instance); } // Save object into a cache + if ($result > 0) { // Save object into a cache + $found=1; $this->cache_objects[$modulepart.'_'.$id.'_'.$ref] = clone $object_instance; + } if ($result == 0) { $found=1; $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]='notfound'; unset($filearray[$key]); } } @@ -1189,7 +1194,7 @@ class FormFile $param .= (isset($object->id)?'&id=' . $object->id : ''); // Show list of associated links - print_titre($langs->trans("LinkedFiles")); + print load_fiche_titre($langs->trans("LinkedFiles")); print ''; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 8310db730ab..08474776512 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -225,6 +225,7 @@ class FormMail extends Form /** * Get the form to input an email * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files + * this->param: Contains more parameteres like email templates info * * @param string $addfileaction Name of action when posting file attachments * @param string $removefileaction Name of action when removing file attachments @@ -252,7 +253,7 @@ class FormMail extends Form return $hookmanager->resPrint; } else - { + { $out=''; // Define list of attached files @@ -281,14 +282,16 @@ class FormMail extends Form $model_id=$this->param["models_id"]; } $arraydefaultmessage=$this->getEMailTemplate($this->db, $this->param["models"], $user, $outputlangs, $model_id); + //var_dump($arraydefaultmessage); - $out.= "\n\n"; + $out.= "\n\n"; if ($this->withform == 1) { - $out.= ''."\n"; + $out.= ''."\n"; $out.= ''; $out.= ''; $out.= ''; + $out.= ''; } foreach ($this->param as $key=>$value) { @@ -310,7 +313,7 @@ class FormMail extends Form if (count($modelmail_array)>0) { $out.= '
    '."\n"; - $out.= $langs->trans('SelectMailModel').':'.$this->selectarray('modelmailselected', $modelmail_array,$model_id); + $out.= $langs->trans('SelectMailModel').': '.$this->selectarray('modelmailselected', $modelmail_array, 0, 1); if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); $out.= '   '; $out.= ''; @@ -330,7 +333,7 @@ class FormMail extends Form { $help.=$key.' -> '.$langs->trans($val).'
    '; } - $out.= $form->textwithpicto($langs->trans("EMailTestSubstitutionReplacedByGenericValues"),$help); + $out.= $form->textwithpicto($langs->trans("EMailTestSubstitutionReplacedByGenericValues"), $help); $out.= "
    \n"; } @@ -569,7 +572,7 @@ class FormMail extends Form } else { - $out.= ''; + $out.= ''; } $out.= "\n"; } @@ -717,7 +720,7 @@ class FormMail extends Form if ($this->withform == 1) $out.= ''."\n"; - // Disable enter key if option MAIN_MAILFORM_DISABLE_ENTER is set + // Disable enter key if option MAIN_MAILFORM_DISABLE_ENTERKEY is set if (! empty($conf->global->MAIN_MAILFORM_DISABLE_ENTERKEY)) { $out.= ''; } - $out.= "\n"; + $out.= "\n"; return $out; } diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 8e9ca33b2a0..437637c3bdf 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -303,13 +303,14 @@ class FormOther * Return select list for categories (to use in form search selectors) * * @param int $type Type of categories (0=product, 1=suppliers, 2=customers, 3=members) - * @param integer $selected Preselected value - * @param string $htmlname Name of combo list + * @param integer $selected Preselected value + * @param string $htmlname Name of combo list * @param int $nocateg Show also an entry "Not categorized" + * @param int $showempty Add also an empty line * @return string Html combo list code * @see select_all_categories */ - function select_categories($type,$selected=0,$htmlname='search_categ',$nocateg=0) + function select_categories($type,$selected=0,$htmlname='search_categ',$nocateg=0,$showempty=1) { global $conf, $langs; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; @@ -331,7 +332,7 @@ class FormOther // Print a select with each of them $moreforfilter.=''; if ($showempty) $sellist.= ''; + if ($showallnone) $sellist.= ''; + if ($showallnone) $sellist.= ''; while ($i < $num) { $obj = $this->db->fetch_object($resql); diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 98250ab0db1..400eb934e26 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -156,10 +156,17 @@ class Ldap if (count($this->server) == 0 || empty($this->server[0])) { $this->error='LDAP setup (file conf.php) is not complete'; - $return=-1; dol_syslog(get_class($this)."::connect_bind ".$this->error, LOG_WARNING); + return -1; } + if (! function_exists('ldap_connect')) + { + $this->error='Your PHP need extension ldap'; + dol_syslog(get_class($this)."::connect_bind ".$this->error, LOG_WARNING); + return -1; + } + // Loop on each ldap server foreach ($this->server as $key => $host) { diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 0cdc6a8c4a8..2dd34896602 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -31,7 +31,6 @@ class Link extends CommonObject public $element = 'link'; public $table_element = 'links'; - public $id; public $entity; public $datea; public $url; diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 2c21cb3c512..cb370e31d96 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -511,7 +511,7 @@ class Menubase $sql.= " ORDER BY m.position, m.rowid"; //print $sql; -//$tmp1=dol_microtime_float(); +//$tmp1=microtime(true); //print '>>> 1 0
    '; dol_syslog(get_class($this)."::menuLoad mymainmenu=".$mymainmenu." myleftmenu=".$myleftmenu." type_user=".$type_user." menu_handler=".$menu_handler." tabMenu size=".count($tabMenu)."", LOG_DEBUG); $resql = $this->db->query($sql); @@ -575,7 +575,7 @@ class Menubase $title = $langs->trans($menu['titre']); } } -//$tmp4=dol_microtime_float(); +//$tmp4=microtime(true); //print '>>> 3 '.($tmp4 - $tmp3).'
    '; // We complete tabMenu diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 5cc62c56bc6..51d9dd621dc 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -522,7 +522,7 @@ class SMTPs * @param mixed $_strConfigPath path to config file or VOID * @return void */ - function setConfig ( $_strConfigPath = null ) + function setConfig($_strConfigPath = null) { /** * Returns constructed SELECT Object string or boolean upon failure @@ -736,7 +736,7 @@ class SMTPs * @param string $_strTransEncode Content-Transfer-Encoding * @return void */ - function setTransEncode ( $_strTransEncode ) + function setTransEncode($_strTransEncode) { if (array_search($_strTransEncode, $this->_smtpsTransEncodeTypes)) $this->_smtpsTransEncode = $_strTransEncode; @@ -830,7 +830,7 @@ class SMTPs * @return void * */ - function _buildAddrList( $_type, $_addrList ) + function _buildAddrList($_type, $_addrList) { // Pull existing list $aryHost = $this->_msgRecipients; diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 9a459f33e41..1dc405ecbad 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -56,7 +56,7 @@ abstract class Stats include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; } - $newpathofdestfile=$conf->user->dir_temp.'/'.get_class($this).'_'.__FUNCTION__.'_'.(empty($this->cachefilesuffix)?'':$this->cachefilesuffix.'_').$langs->defaultlang.'_user'.$user->id.'.cache'; + $newpathofdestfile=$conf->user->dir_temp.'/'.get_class($this).'_'.__FUNCTION__.'_'.(empty($this->cachefilesuffix)?'':$this->cachefilesuffix.'_').$langs->defaultlang.'_entity.'.$conf->entity.'_user'.$user->id.'.cache'; $newmask='0644'; $nowgmt = dol_now(); @@ -150,7 +150,7 @@ abstract class Stats include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; } - $newpathofdestfile=$conf->user->dir_temp.'/'.get_class($this).'_'.__FUNCTION__.'_'.(empty($this->cachefilesuffix)?'':$this->cachefilesuffix.'_').$langs->defaultlang.'_user'.$user->id.'.cache'; + $newpathofdestfile=$conf->user->dir_temp.'/'.get_class($this).'_'.__FUNCTION__.'_'.(empty($this->cachefilesuffix)?'':$this->cachefilesuffix.'_').$langs->defaultlang.'_entity.'.$conf->entity.'_user'.$user->id.'.cache'; $newmask='0644'; $nowgmt = dol_now(); @@ -276,7 +276,7 @@ abstract class Stats include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; } - $newpathofdestfile=$conf->user->dir_temp.'/'.get_class($this).'_'.__FUNCTION__.'_'.(empty($this->cachefilesuffix)?'':$this->cachefilesuffix.'_').$langs->defaultlang.'_user'.$user->id.'.cache'; + $newpathofdestfile=$conf->user->dir_temp.'/'.get_class($this).'_'.__FUNCTION__.'_'.(empty($this->cachefilesuffix)?'':$this->cachefilesuffix.'_').$langs->defaultlang.'_entity.'.$conf->entity.'_user'.$user->id.'.cache'; $newmask='0644'; $nowgmt = dol_now(); @@ -383,8 +383,11 @@ abstract class Stats $row = $this->db->fetch_object($resql); $result[$i]['year'] = $row->year; $result[$i]['nb'] = $row->nb; + if($i>0 && $row->nb) $result[$i-1]['nb_diff'] = ($result[$i-1]['nb'] - $row->nb) / $row->nb * 100; $result[$i]['total'] = $row->total; + if($i>0 && $row->total) $result[$i-1]['total_diff'] = ($result[$i-1]['total'] - $row->total) / $row->total * 100; $result[$i]['avg'] = $row->avg; + if($i>0 && $row->avg) $result[$i-1]['avg_diff'] = ($result[$i-1]['avg'] - $row->avg) / $row->avg * 100; $i++; } $this->db->free($resql); diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 37846bf2421..27bcb64da3c 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -29,17 +29,17 @@ */ class Translate { - var $dir; // Directories that contains /langs subdirectory + var $dir; // Directories that contains /langs subdirectory - var $defaultlang; // Current language for current user - var $direction = 'ltr'; // Left to right or Right to left - var $charset_output='UTF-8'; // Codage used by "trans" method outputs + var $defaultlang; // Current language for current user + var $direction = 'ltr'; // Left to right or Right to left + var $charset_output='UTF-8'; // Codage used by "trans" method outputs - var $tab_translate=array(); // Array of all translations key=>value - private $_tab_loaded=array(); // Array to store result after loading each language file + var $tab_translate=array(); // Array of all translations key=>value + private $_tab_loaded=array(); // Array to store result after loading each language file - var $cache_labels=array(); // Cache for labels return by getLabelFromKey method - var $cache_currencies=array(); // Cache to store currency symbols + var $cache_labels=array(); // Cache for labels return by getLabelFromKey method + var $cache_currencies=array(); // Cache to store currency symbols @@ -144,7 +144,6 @@ class Translate * If data for file already loaded, do nothing. * All data in translation array are stored in UTF-8 format. * tab_loaded is completed with $domain key. - * Warning: MAIN_USE_CUSTOM_TRANSLATION is an old deprecated feature. Do not use it. It will revert * rule "we keep first entry found with we keep last entry found" so it is probably not what you want to do. * * Value for hash are: 1:Loaded from disk, 2:Not found, 3:Loaded from cache @@ -158,9 +157,11 @@ class Translate * @param int $forcelangdir To force a different lang directory * @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK */ - function Load($domain,$alt=0,$stopafterdirection=0,$forcelangdir='') + function load($domain,$alt=0,$stopafterdirection=0,$forcelangdir='') { - global $conf; + global $conf,$db; + + if (count($this->tab_translate) == 0) $this->loadFromDatabase($db); // Nothing was loaded yet, so we load database. // Check parameters if (empty($domain)) @@ -234,12 +235,13 @@ class Translate if ($usecachekey) { //dol_syslog('Translate::Load we will cache result into usecachekey '.$usecachekey); - + //global $aaa; $aaa+=1; + //print $aaa." ".$usecachekey."\n"; require_once DOL_DOCUMENT_ROOT .'/core/lib/memory.lib.php'; $tmparray=dol_getcache($usecachekey); if (is_array($tmparray) && count($tmparray)) { - $this->tab_translate=array_merge($tmparray,$this->tab_translate); // Already found values tab_translate overwrites duplicates + $this->tab_translate+=$tmparray; // Faster than array_merge($tmparray,$this->tab_translate). Note: If a valuer already exists into tab_translate, value into tmparaay is not added. //print $newdomain."\n"; //var_dump($this->tab_translate); if ($alt == 2) $fileread=1; @@ -260,7 +262,7 @@ class Translate $tab=explode('=',$line,2); $key=trim($tab[0]); //print "Domain=$domain, found a string for $tab[0] with value $tab[1]
    "; - if ((! empty($conf->global->MAIN_USE_CUSTOM_TRANSLATION) || empty($this->tab_translate[$key])) && isset($tab[1])) // If translation was already found, we must not continue, even if MAIN_FORCELANGDIR is set (MAIN_FORCELANGDIR is to replace lang dir, not to overwrite entries) + if (empty($this->tab_translate[$key]) && isset($tab[1])) // If translation was already found, we must not continue, even if MAIN_FORCELANGDIR is set (MAIN_FORCELANGDIR is to replace lang dir, not to overwrite entries) { $value=trim(preg_replace('/\\n/',"\n",$tab[1])); @@ -296,7 +298,7 @@ class Translate } } - if (empty($conf->global->MAIN_FORCELANGDIR) && empty($conf->global->MAIN_USE_CUSTOM_TRANSLATION)) break; // Break loop on each root dir. If a module has forced dir, we do not stop loop. + if (empty($conf->global->MAIN_FORCELANGDIR)) break; // Break loop on each root dir. If a module has forced dir, we do not stop loop. } } } @@ -329,13 +331,181 @@ class Translate if (empty($this->_tab_loaded[$newdomain])) $this->_tab_loaded[$newdomain]=2; // Marque ce fichier comme non trouve } - // Check to be sure that SeparatorDecimal differs from SeparatorThousand + // This part is deprecated and replaced with table llx_overwrite_trans + // Kept for backward compatibility. + $overwritekey='MAIN_OVERWRITE_TRANS_'.$this->defaultlang; + if (! empty($conf->global->$overwritekey)) // Overwrite translation with key1:newstring1,key2:newstring2 + { + // Overwrite translation with param MAIN_OVERWRITE_TRANS_xx_XX + $tmparray=explode(',', $conf->global->$overwritekey); + foreach($tmparray as $tmp) + { + $tmparray2=explode(':',$tmp); + if (! empty($tmparray2[1])) $this->tab_translate[$tmparray2[0]]=$tmparray2[1]; + } + } + + + + // Check to be sure that SeparatorDecimal differs from SeparatorThousand if (! empty($this->tab_translate["SeparatorDecimal"]) && ! empty($this->tab_translate["SeparatorThousand"]) && $this->tab_translate["SeparatorDecimal"] == $this->tab_translate["SeparatorThousand"]) $this->tab_translate["SeparatorThousand"]=''; return 1; } + /** + * Load translation key-value from database into a memory array. + * If data already loaded, do nothing. + * All data in translation array are stored in UTF-8 format. + * tab_loaded is completed with $domain key. + * rule "we keep first entry found with we keep last entry found" so it is probably not what you want to do. + * + * Value for hash are: 1:Loaded from disk, 2:Not found, 3:Loaded from cache + * + * @param Database $db Database handler + * @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK + */ + function loadFromDatabase($db) + { + global $conf; + + $domain='database'; + + if ($this->defaultlang == 'none_NONE') return 0; // Special language code to not translate keys + + // Check parameters + if (empty($db)) return 0; // Database handler can't be used + + //dol_syslog("Translate::Load Start domain=".$domain." alt=".$alt." forcelangdir=".$forcelangdir." this->defaultlang=".$this->defaultlang); + + $newdomain = $domain; + $modulename = ''; + + // Check cache + if (! empty($this->_tab_loaded[$newdomain])) // File already loaded for this domain + { + //dol_syslog("Translate::Load already loaded for newdomain=".$newdomain); + return 0; + } + + $this->_tab_loaded[$newdomain] = 1; // We want to be sure this function is called once only. + + $fileread=0; + $langofdir=(empty($forcelangdir)?$this->defaultlang:$forcelangdir); + + // Redefine alt + $alt=2; + + if (empty($langofdir)) // This may occurs when load is called without setting the language and without providing a value for forcelangdir + { + dol_syslog("Error: ".get_class($this)."::Load was called but language was not set yet with langs->setDefaultLang(). Nothing will be loaded.", LOG_WARNING); + return -1; + } + + // TODO Move cache read out of loop on dirs or at least filelangexists + $found=false; + + // Enable caching of lang file in memory (not by default) + $usecachekey=''; + // Using a memcached server + if (! empty($conf->memcached->enabled) && ! empty($conf->global->MEMCACHED_SERVER)) + { + $usecachekey=$newdomain.'_'.$langofdir.'_'.md5($file_lang); // Should not contains special chars + } + // Using cache with shmop. Speed gain: 40ms - Memory overusage: 200ko (Size of session cache file) + else if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) + { + $usecachekey=$newdomain; + } + + if ($usecachekey) + { + //dol_syslog('Translate::Load we will cache result into usecachekey '.$usecachekey); + //global $aaa; $aaa+=1; + //print $aaa." ".$usecachekey."\n"; + require_once DOL_DOCUMENT_ROOT .'/core/lib/memory.lib.php'; + $tmparray=dol_getcache($usecachekey); + if (is_array($tmparray) && count($tmparray)) + { + $this->tab_translate+=$tmparray; // Faster than array_merge($tmparray,$this->tab_translate). Note: If a valuer already exists into tab_translate, value into tmparaay is not added. + //print $newdomain."\n"; + //var_dump($this->tab_translate); + if ($alt == 2) $fileread=1; + $found=true; // Found in dolibarr PHP cache + } + } + + if (! $found) + { + // Overwrite translation with database read + $sql="SELECT transkey, transvalue FROM ".MAIN_DB_PREFIX."overwrite_trans where lang='".$this->defaultlang."'"; + $resql=$db->query($sql); + + if ($resql) + { + $num = $db->num_rows($resql); + if ($num) + { + if ($usecachekey) $tabtranslatedomain=array(); // To save lang content in cache + + $i = 0; + while ($i < $num) // Ex: Need 225ms for all fgets on all lang file for Third party page. Same speed than file_get_contents + { + $obj=$db->fetch_object($resql); + + $key=$obj->transkey; + $value=$obj->transvalue; + + //print "Domain=$domain, found a string for $tab[0] with value $tab[1]
    "; + if (empty($this->tab_translate[$key])) // If translation was already found, we must not continue, even if MAIN_FORCELANGDIR is set (MAIN_FORCELANGDIR is to replace lang dir, not to overwrite entries) + { + $value=trim(preg_replace('/\\n/',"\n",$value)); + + $this->tab_translate[$key]=$value; + if ($usecachekey) $tabtranslatedomain[$key]=$value; // To save lang content in cache + } + + $i++; + } + + $fileread=1; + + // TODO Move cache write out of loop on dirs + // To save lang content for usecachekey into cache + if ($usecachekey && count($tabtranslatedomain)) + { + $ressetcache=dol_setcache($usecachekey,$tabtranslatedomain); + if ($ressetcache < 0) + { + $error='Failed to set cache for usecachekey='.$usecachekey.' result='.$ressetcache; + dol_syslog($error, LOG_ERR); + } + } + } + } + else + { + dol_print_error($db); + } + } + + if ($alt == 2) + { + if ($fileread) $this->_tab_loaded[$newdomain]=1; // Set domain file as loaded + + if (empty($this->_tab_loaded[$newdomain])) $this->_tab_loaded[$newdomain]=2; // Marque ce cas comme non trouve (no lines found for language) + } + + // Check to be sure that SeparatorDecimal differs from SeparatorThousand + if (! empty($this->tab_translate["SeparatorDecimal"]) && ! empty($this->tab_translate["SeparatorThousand"]) + && $this->tab_translate["SeparatorDecimal"] == $this->tab_translate["SeparatorThousand"]) $this->tab_translate["SeparatorThousand"]=''; + + return 1; + } + + + /** * Return translated value of key for special keys ("Currency...", "Civility...", ...). * Search in lang file, then into database. Key must be any complete entry into lang file: CurrencyEUR, ... @@ -409,20 +579,12 @@ class Translate { $str=$this->tab_translate[$key]; - // Overwrite translation (TODO Move this at a higher level when we load tab_translate to avoid doing it for each trans call) - $overwritekey='MAIN_OVERWRITE_TRANS_'.$this->defaultlang; - if (! empty($conf->global->$overwritekey)) // Overwrite translation with key1:newstring1,key2:newstring2 + if (! preg_match('/^Format/',$key)) { - $tmparray=explode(',', $conf->global->$overwritekey); - foreach($tmparray as $tmp) - { - $tmparray2=explode(':',$tmp); - if ($tmparray2[0]==$key) { $str=$tmparray2[1]; break; } - } + //print $str; + $str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings. } - if (! preg_match('/^Format/',$key)) $str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings. - if ($maxsize) $str=dol_trunc($str,$maxsize); // We replace some HTML tags by __xx__ to avoid having them encoded by htmlentities @@ -497,7 +659,11 @@ class Translate } } - if (! preg_match('/^Format/',$key)) $str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings. + if (! preg_match('/^Format/',$key)) + { + //print $str; + $str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings. + } return $str; } @@ -819,3 +985,8 @@ class Translate } } + +function warning_handler($errno, $errstr, $errfile, $errline, array $errcontext) { + global $str; + print 'str='.$str; +} diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index bca6d0798b8..cc373acc163 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -253,6 +253,8 @@ class DoliDBMysql extends DoliDB */ function query($query,$usesavepoint=0,$type='auto') { + global $conf; + $query = trim($query); if (! in_array($query,array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG); @@ -277,7 +279,8 @@ class DoliDBMysql extends DoliDB $this->lasterror = $this->error(); $this->lasterrno = $this->errno(); - dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterrno." ".$this->lasterror, LOG_ERR); + if ($conf->global->SYSLOG_LEVEL < LOG_DEBUG) dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR); // Log of request was not yet done previously + dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterrno." ".$this->lasterror, LOG_ERR); } $this->lastquery=$query; $this->_results = $ret; diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index d714a277ae0..068cd410326 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT .'/core/db/DoliDB.class.php'; */ class DoliDBMysqli extends DoliDB { + /** @var mysqli Database object */ + public $db; //! Database type public $type='mysqli'; //! Database label @@ -81,29 +83,26 @@ class DoliDBMysqli extends DoliDB $this->connected = false; $this->ok = false; $this->error=$langs->trans("ErrorWrongHostParameter"); - dol_syslog(get_class($this)."::DoliDBMysqli : Erreur Connect, wrong host parameters",LOG_ERR); + dol_syslog(get_class($this)."::DoliDBMysqli : Connect error, wrong host parameters",LOG_ERR); return $this->ok; } - // Essai connexion serveur - // We do not try to connect to database, only to server. Connect to database is done later in constrcutor - $this->db = $this->connect($host, $user, $pass, '', $port); + // Try server connection + // We do not try to connect to database, only to server. Connect to database is done later in constrcutor + $this->db = $this->connect($host, $user, $pass, '', $port); - if ($this->db) - { - $this->connected = true; - $this->ok = true; - } - else - { - // host, login ou password incorrect - $this->connected = false; - $this->ok = false; - $this->error=mysqli_connect_error(); - dol_syslog(get_class($this)."::DoliDBMysqli : Erreur Connect mysqli_connect_error=".$this->error,LOG_ERR); - } + if ($this->db->connect_errno) { + $this->connected = false; + $this->ok = false; + $this->error = $this->db->connect_error; + dol_syslog(get_class($this) . "::DoliDBMysqli Connect error: " . $this->error, LOG_ERR); + return $this->ok; + } else { + $this->connected = true; + $this->ok = true; + } - // Si connexion serveur ok et si connexion base demandee, on essaie connexion base + // If server connection is ok, we try to connect to the database if ($this->connected && $name) { if ($this->select_db($name)) @@ -116,7 +115,7 @@ class DoliDBMysqli extends DoliDB $clientmustbe=''; if (preg_match('/UTF-8/i',$conf->file->character_set_client)) $clientmustbe='utf8'; if (preg_match('/ISO-8859-1/i',$conf->file->character_set_client)) $clientmustbe='latin1'; - if (mysqli_character_set_name($this->db) != $clientmustbe) + if ($this->db->character_set_name() != $clientmustbe) { $this->query("SET NAMES '".$clientmustbe."'", $this->db); //$this->query("SET CHARACTER SET ". $this->forcecharset); @@ -128,7 +127,7 @@ class DoliDBMysqli extends DoliDB $this->database_name = ''; $this->ok = false; $this->error=$this->error(); - dol_syslog(get_class($this)."::DoliDBMysqli : Erreur Select_db ".$this->error,LOG_ERR); + dol_syslog(get_class($this)."::DoliDBMysqli : Select_db error ".$this->error,LOG_ERR); } } else @@ -142,7 +141,7 @@ class DoliDBMysqli extends DoliDB $clientmustbe=''; if (preg_match('/UTF-8/i',$conf->file->character_set_client)) $clientmustbe='utf8'; if (preg_match('/ISO-8859-1/i',$conf->file->character_set_client)) $clientmustbe='latin1'; - if (mysqli_character_set_name($this->db) != $clientmustbe) + if ($this->db->character_set_name() != $clientmustbe) { $this->query("SET NAMES '".$clientmustbe."'", $this->db); //$this->query("SET CHARACTER SET ". $this->forcecharset); @@ -175,36 +174,27 @@ class DoliDBMysqli extends DoliDB function select_db($database) { dol_syslog(get_class($this)."::select_db database=".$database, LOG_DEBUG); - return mysqli_select_db($this->db,$database); + return $this->db->select_db($database); } - /** - * Connexion to server + /** + * Connect to server * - * @param string $host database server host - * @param string $login login - * @param string $passwd password - * @param string $name name of database (not used for mysql, used for pgsql) - * @param integer $port Port of database server - * @return mysqli Database access handler - * @see close - */ - function connect($host, $login, $passwd, $name, $port=0) - { - dol_syslog(get_class($this)."::connect host=$host, port=$port, login=$login, passwd=--hidden--, name=$name",LOG_DEBUG); + * @param string $host database server host + * @param string $login login + * @param string $passwd password + * @param string $name name of database (not used for mysql, used for pgsql) + * @param integer $port Port of database server + * @return mysqli Database access object + * @see close + */ + function connect($host, $login, $passwd, $name, $port = 0) + { + dol_syslog(get_class($this) . "::connect host=$host, port=$port, login=$login, passwd=--hidden--, name=$name", LOG_DEBUG); - $newhost=$host; - $newport=$port; - - // With mysqli, port must be in connect parameters - if (! $newport) $newport=3306; - - $this->db = @mysqli_connect($newhost, $login, $passwd, $name, $newport); - - //print "Resultat fonction connect: ".$this->db; - return $this->db; - } + return new mysqli($host, $login, $passwd, $name, $port); + } /** * Return version of database server @@ -213,7 +203,7 @@ class DoliDBMysqli extends DoliDB */ function getVersion() { - return mysqli_get_server_info($this->db); + return $this->db->get_server_info(); } /** @@ -221,10 +211,10 @@ class DoliDBMysqli extends DoliDB * * @return string Version string */ - function getDriverInfo() - { - return mysqli_get_client_info($this->db); - } + function getDriverInfo() + { + return $this->db->get_client_info(); + } /** @@ -239,7 +229,7 @@ class DoliDBMysqli extends DoliDB { if ($this->transaction_opened > 0) dol_syslog(get_class($this)."::close Closing a connection with an opened transaction depth=".$this->transaction_opened,LOG_ERR); $this->connected=false; - return mysqli_close($this->db); + return $this->db->close(); } return false; } @@ -255,6 +245,8 @@ class DoliDBMysqli extends DoliDB */ function query($query,$usesavepoint=0,$type='auto') { + global $conf; + $query = trim($query); if (! in_array($query,array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG); @@ -262,11 +254,11 @@ class DoliDBMysqli extends DoliDB if (! $this->database_name) { // Ordre SQL ne necessitant pas de connexion a une base (exemple: CREATE DATABASE) - $ret = mysqli_query($this->db,$query); + $ret = $this->db->query($query); } else { - $ret = mysqli_query($this->db,$query); + $ret = $this->db->query($query); } if (! preg_match("/^COMMIT/i",$query) && ! preg_match("/^ROLLBACK/i",$query)) @@ -278,6 +270,7 @@ class DoliDBMysqli extends DoliDB $this->lasterror = $this->error(); $this->lasterrno = $this->errno(); + if ($conf->global->SYSLOG_LEVEL < LOG_DEBUG) dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR); // Log of request was not yet done previously dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterrno." ".$this->lasterror, LOG_ERR); } $this->lastquery=$query; @@ -297,7 +290,7 @@ class DoliDBMysqli extends DoliDB { // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion if (! is_object($resultset)) { $resultset=$this->_results; } - return mysqli_fetch_object($resultset); + return $resultset->fetch_object(); } @@ -311,7 +304,7 @@ class DoliDBMysqli extends DoliDB { // If resultset not provided, we take the last used by connexion if (! is_object($resultset)) { $resultset=$this->_results; } - return mysqli_fetch_array($resultset); + return $resultset->fetch_array(); } /** @@ -326,7 +319,7 @@ class DoliDBMysqli extends DoliDB if (! is_bool($resultset)) { if (! is_object($resultset)) { $resultset=$this->_results; } - return mysqli_fetch_row($resultset); + return $resultset->fetch_row(); } else { @@ -346,7 +339,7 @@ class DoliDBMysqli extends DoliDB { // If resultset not provided, we take the last used by connexion if (! is_object($resultset)) { $resultset=$this->_results; } - return mysqli_num_rows($resultset); + return $resultset->num_rows; } /** @@ -362,7 +355,7 @@ class DoliDBMysqli extends DoliDB if (! is_object($resultset)) { $resultset=$this->_results; } // mysql necessite un link de base pour cette fonction contrairement // a pqsql qui prend un resultset - return mysqli_affected_rows($this->db); + return $this->db->affected_rows; } @@ -377,7 +370,7 @@ class DoliDBMysqli extends DoliDB // If resultset not provided, we take the last used by connexion if (! is_object($resultset)) { $resultset=$this->_results; } // Si resultset en est un, on libere la memoire - if (is_object($resultset)) mysqli_free_result($resultset); + if (is_object($resultset)) $resultset->free_result(); } /** @@ -433,10 +426,10 @@ class DoliDBMysqli extends DoliDB 1451 => 'DB_ERROR_CHILD_EXISTS' ); - if (isset($errorcode_map[mysqli_errno($this->db)])) { - return $errorcode_map[mysqli_errno($this->db)]; + if (isset($errorcode_map[$this->db->errno])) { + return $errorcode_map[$this->db->errno]; } - $errno=mysqli_errno($this->db); + $errno=$this->db->errno; return ($errno?'DB_ERROR_'.$errno:'0'); } } @@ -453,7 +446,7 @@ class DoliDBMysqli extends DoliDB return 'Not connected. Check setup parameters in conf/conf.php file and your mysql client and server versions'; } else { - return mysqli_error($this->db); + return $this->db->error; } } @@ -466,7 +459,7 @@ class DoliDBMysqli extends DoliDB */ function last_insert_id($tab,$fieldid='rowid') { - return mysqli_insert_id($this->db); + return $this->db->insert_id; } /** diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 0466c2ad96b..048ef2d450d 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -410,6 +410,7 @@ class DoliDBPgsql extends DoliDB $this->database_name = $name; pg_set_error_verbosity($this->db, PGSQL_ERRORS_VERBOSE); // Set verbosity to max } + pg_query($this->db, "set datestyle = 'ISO, YMD';"); return $this->db; } @@ -509,11 +510,11 @@ class DoliDBPgsql extends DoliDB $this->lastqueryerror = $query; $this->lasterror = $this->error(); $this->lasterrno = $this->errno(); - } - dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR); - dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterror." (".$this->lasterrno.")", LOG_ERR); - dol_syslog(get_class($this)."::query SQL error usesavepoint = ".$usesavepoint, LOG_ERR); + if ($conf->global->SYSLOG_LEVEL < LOG_DEBUG) dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR); // Log of request was not yet done previously + dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterror." (".$this->lasterrno.")", LOG_ERR); + dol_syslog(get_class($this)."::query SQL Error usesavepoint = ".$usesavepoint, LOG_ERR); + } if ($usesavepoint && $this->transaction_opened) // Warning, after that errno will be erased { diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 196dcfe0997..6e6da6bd686 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -47,12 +47,12 @@ function admin_accounting_prepare_head(AccountingAccount $object=null) // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin'); - $head[$h][0] = dol_buildpath('/accountancy/admin/journaux.php', 1); + $head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/journal.php'; $head[$h][1] = $langs->trans("Journaux"); $head[$h][2] = 'journal'; $h ++; - $head[$h][0] = dol_buildpath('/accountancy/admin/export.php', 1); + $head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/export.php'; $head[$h][1] = $langs->trans("Export"); $head[$h][2] = 'export'; $h ++; @@ -75,7 +75,7 @@ function accounting_prepare_head(AccountingAccount $object) $h = 0; $head = array (); - $head[$h][0] = dol_buildpath('/accountancy/admin/card.php', 1) . '?id=' . $object->id; + $head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/card.php?id=' . $object->id; $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'card'; $h ++; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 2eb0fbb77ba..9490f3a7b7d 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1,7 +1,8 @@ - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2012 J. Fernando Lagrange +/* Copyright (C) 2008-2011 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2012 J. Fernando Lagrange + * Copyright (C) 2015 Raphaël Doursenaud * * 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 @@ -23,6 +24,7 @@ * \brief Library of admin functions */ +require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; /** * Renvoi une version en chaine depuis une version en tableau @@ -40,7 +42,8 @@ function versiontostring($versionarray) } /** - * Compare 2 versions (stored into 2 arrays) + * Compare 2 versions (stored into 2 arrays). + * For example, to check if Dolibarr version is lower than (x,y,z), do "if versioncompare(versiondolibarrarray(), array(x.y.z)) <= 0" * * @param array $versionarray1 Array of version (vermajor,verminor,patch) * @param array $versionarray2 Array of version (vermajor,verminor,patch) @@ -675,29 +678,7 @@ function activateModule($value,$withdeps=1) $ret=''; $modName = $value; $modFile = $modName . ".class.php"; - - // Loop on each directory to fill $modulesdir - $modulesdir = array(); - foreach ($conf->file->dol_document_root as $type => $dirroot) - { - $modulesdir[] = $dirroot."/core/modules/"; - - $handle=@opendir(dol_osencode($dirroot)); - if (is_resource($handle)) - { - while (($file = readdir($handle))!==false) - { - if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') - { - if (is_dir($dirroot . '/' . $file . '/core/modules/')) - { - $modulesdir[] = $dirroot . '/' . $file . '/core/modules/'; - } - } - } - closedir($handle); - } - } + $modulesdir = dolGetModulesDirs(); // Loop on each directory $found=false; @@ -794,29 +775,7 @@ function unActivateModule($value, $requiredby=1) $ret=''; $modName = $value; $modFile = $modName . ".class.php"; - - // Loop on each directory to fill $modulesdir - $modulesdir = array(); - foreach ($conf->file->dol_document_root as $type => $dirroot) - { - $modulesdir[] = $dirroot."/core/modules/"; - - $handle=@opendir(dol_osencode($dirroot)); - if (is_resource($handle)) - { - while (($file = readdir($handle))!==false) - { - if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') - { - if (is_dir($dirroot . '/' . $file . '/core/modules/')) - { - $modulesdir[] = $dirroot . '/' . $file . '/core/modules/'; - } - } - } - closedir($handle); - } - } + $modulesdir = dolGetModulesDirs(); // Loop on each directory $found=false; @@ -837,13 +796,13 @@ function unActivateModule($value, $requiredby=1) } else { - // TODO Replace this afte DolibarrModules is moved as abstract class with a try catch to show module is bugged + // TODO Replace this after DolibarrModules is moved as abstract class with a try catch to show module is bugged $genericMod = new DolibarrModules($db); $genericMod->name=preg_replace('/^mod/i','',$modName); $genericMod->rights_class=strtolower(preg_replace('/^mod/i','',$modName)); $genericMod->const_name='MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',$modName)); dol_syslog("modules::unActivateModule Failed to find module file, we use generic function with name " . $modName); - $genericMod->_remove(); + $genericMod->_remove(''); } // Desactivation des modules qui dependent de lui @@ -852,6 +811,7 @@ function unActivateModule($value, $requiredby=1) $countrb=count($objMod->requiredby); for ($i = 0; $i < $countrb; $i++) { + //var_dump($objMod->requiredby[$i]); unActivateModule($objMod->requiredby[$i]); } } @@ -882,36 +842,10 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql global $db, $modules, $conf, $langs; // Search modules - $filename = array(); - $modules = array(); - $orders = array(); - $categ = array(); - $dirmod = array(); - $modulesdir = array(); + $modulesdir = dolGetModulesDirs(); $i = 0; // is a sequencer of modules found $j = 0; // j is module number. Automatically affected if module number not defined. - foreach ($conf->file->dol_document_root as $type => $dirroot) - { - $modulesdir[$dirroot . '/core/modules/'] = $dirroot . '/core/modules/'; - - $handle=@opendir($dirroot); - if (is_resource($handle)) - { - while (($file = readdir($handle))!==false) - { - if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') - { - if (is_dir($dirroot . '/' . $file . '/core/modules/')) - { - $modulesdir[$dirroot . '/' . $file . '/core/modules/'] = $dirroot . '/' . $file . '/core/modules/'; - } - } - } - closedir($handle); - } - } - foreach ($modulesdir as $dir) { // Load modules attributes in arrays (name, numero, orders) from dir directory @@ -961,14 +895,6 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql } } - $modules[$i] = $objMod; - $filename[$i]= $modName; - $orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module - //print "x".$modName." ".$orders[$i]."\n
    "; - if (isset($categ[$objMod->special])) $categ[$objMod->special]++; // Array of all different modules categories - else $categ[$objMod->special]=1; - $dirmod[$i] = $dirroot; - // Complete arrays //&$tabname,&$tablib,&$tabsql,&$tabsqlsort,&$tabfield,&$tabfieldvalue,&$tabfieldinsert,&$tabrowid,&$tabcond if (empty($objMod->dictionaries) && ! empty($objMod->dictionnaries)) $objMod->dictionaries=$objMod->dictionnaries; // For backward compatibility diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index fd2a3cd4099..54e2b281f05 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -103,7 +103,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print '
    '; } @@ -124,7 +124,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { // Filter on hours print ''; - print ''; + print ''; print "'; - print ''; + print ''; print "
    '; print $langs->trans("ThirdParty").'   '; print ''; - print $form->select_company($socid, 'socid'); + print $form->select_company($socid, 'socid', '', 1); print '
    '.$langs->trans("WorkingTimeRange").''.$langs->trans("VisibleTimeRange").'"; print ''; if (empty($conf->dol_use_jmobile)) print ' - '; @@ -134,7 +134,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh // Filter on days print '
    '.$langs->trans("WorkingDaysRange").''.$langs->trans("VisibleDaysRange").'"; print ''; if (empty($conf->dol_use_jmobile)) print ' - '; diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index bca5b2f1bdf..66dab46b47a 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -72,6 +72,11 @@ function bank_prepare_head(Account $object) $h++; } + $head[$h][0] = DOL_URL_ROOT . "/compta/bank/document.php?account=" . $object->id; + $head[$h][1] = $langs->trans("Documents"); + $head[$h][2] = 'document'; + $h++; + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 92b5676746c..a84c4548706 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -479,7 +479,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='') } print "\n"; - print_fiche_titre($langs->trans("ProjectsDedicatedToThisThirdParty"),$buttoncreate,''); + print load_fiche_titre($langs->trans("ProjectsDedicatedToThisThirdParty"),$buttoncreate,''); print "\n".''; $sql = "SELECT p.rowid as id, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status"; @@ -602,7 +602,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print "\n"; $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ContactsForCompany") : $langs->trans("ContactsAddressesForCompany")); - print_fiche_titre($title,$buttoncreate,''); + print load_fiche_titre($title,$buttoncreate,''); print ''; print ''; @@ -816,7 +816,7 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='') } print "\n"; - print_fiche_titre($langs->trans("AddressesForCompany"),$buttoncreate,''); + print load_fiche_titre($langs->trans("AddressesForCompany"),$buttoncreate,''); print "\n".'
    '."\n"; @@ -897,7 +897,7 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='') */ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) { - global $bc,$user; + global $bc,$user,$conf; // Check parameters if (! is_object($object)) dol_print_error('','BadParameter'); @@ -915,12 +915,22 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) $out.="\n"; $out.='
    '; $out.=''; - $out.=''; - $out.=''; + $out.=''; $out.=''; @@ -965,7 +975,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) $var = !$var; $obj = $db->fetch_object($result); - + $actionstatic->fetch($obj->id); $datep=$db->jdate($obj->dp); $datep2=$db->jdate($obj->dp2); @@ -999,8 +1009,13 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) // Title of event //$out.=''; - $out.=''; - + $out.=''; + + if($conf->global->AGENDA_USE_EVENT_TYPE) { + $out.= ''; + } // Contact pour cette action if (empty($objcon->id) && $obj->fk_contact > 0) { @@ -1063,7 +1078,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) */ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) { - global $bc,$user; + global $bc,$user,$conf; // Check parameters if (! is_object($object)) dol_print_error('','BadParameter'); @@ -1202,12 +1217,22 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) $out.="\n"; $out.='
    '; + if($conf->global->AGENDA_USE_EVENT_TYPE) $out.=''; + else $out.=''; if (get_class($object) == 'Societe') $out.=''; $out.=$langs->trans("ActionsToDoShort"); if (get_class($object) == 'Societe') $out.=''; $out.=''; + + if($conf->global->AGENDA_USE_EVENT_TYPE) { + $out.=''; + $out.=$langs->trans("Type"); + $out.=''; + } else { + $out.=''; + } + $out.='
    '.dol_trunc($obj->label,40).''.$actionstatic->getNomUrl(1,120).''.$actionstatic->getNomUrl(1,120).''; + $out.=$actionstatic->type; + $out.='
    '; $out.=''; - $out.=''; - $out.=''; + $out.=''; $out.=''; @@ -1215,7 +1240,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) { $var=!$var; $out.=""; - + $actionstatic->fetch($histo[$key]['id']); // Champ date $out.=''; - + + if($conf->global->AGENDA_USE_EVENT_TYPE) { + $out.=''; + } // Title of event //$out.=''; @@ -1364,7 +1394,7 @@ function show_subsidiaries($conf,$langs,$db,$object) { $socstatic = new Societe($db); - print_titre($langs->trans("Subsidiaries")); + print load_fiche_titre($langs->trans("Subsidiaries")); print "\n".'
    '; + if($conf->global->AGENDA_USE_EVENT_TYPE) $out.=''; + else $out.=''; if (get_class($object) == 'Societe') $out.=''; $out.=$langs->trans("ActionsDoneShort"); if (get_class($object) == 'Societe') $out.=''; $out.=''; + + if($conf->global->AGENDA_USE_EVENT_TYPE) { + $out.=''; + $out.=$langs->trans("Type"); + $out.=''; + } else { + $out.=''; + } + $out.='
    '; $out.=dol_print_date($histo[$key]['datestart'],'dayhour'); @@ -1251,7 +1276,12 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) $out.=dol_trunc($libelle,120); } $out.=''; + $out.=$actionstatic->type; + $out.=''.dol_trunc($histo[$key]['note'], 40).'
    '."\n"; print ''; diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 088c36e06df..931f30ce998 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -88,6 +88,7 @@ function getServerTimeZoneInt($refgmtdate='now') if ($refgmtdate == 'now') $newrefgmtdate=$yearref.'-'.$monthref.'-'.$dayref; elseif ($refgmtdate == 'summer') $newrefgmtdate=$yearref.'-08-01'; else $newrefgmtdate=$yearref.'-01-01'; + $newrefgmtdate.='T00:00:00+00:00'; $localtz = new DateTimeZone(getServerTimeZoneString()); $localdt = new DateTime($newrefgmtdate, $localtz); $tmp=-1*$localtz->getOffset($localdt); @@ -97,30 +98,6 @@ function getServerTimeZoneInt($refgmtdate='now') { $tmp=0; 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 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; - $tmp=dol_mktime(0,0,0,$monthref,$dayref,$yearref,false,0)-dol_mktime(0,0,0,$monthref,$dayref,$yearref,true,0)-($daylight*3600); - return 'unknown'; // For true result - } - 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 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; - $tmp=dol_mktime(0,0,0,$monthref,$dayref,$yearref,false,0)-dol_mktime(0,0,0,$monthref,$dayref,$yearref,true,0)-($daylight*3600); - 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; @@ -167,7 +144,7 @@ function convertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0) /** Return, in clear text, value of a number of seconds in days, hours and minutes * * @param int $iSecond Number of seconds - * @param string $format Output format ('all': total delay days hour:min like "2 days 12:30"", 'allhourmin': total delay hours:min like "60:30", 'allhour': total delay hours without min/sec like "60:30", 'fullhour': total delay hour decimal like "60.5" for 60:30, 'hour': only hours part "12", 'min': only minutes part "30", 'sec': only seconds part, 'month': only month part, 'year': only year part); + * @param string $format Output format ('all': total delay days hour:min like "2 days 12:30", 'allwithouthour': total delay days without hour part like "2 days", 'allhourmin': total delay with format hours:min like "60:30", 'allhour': total delay hours without min/sec like "60:30", 'fullhour': total delay hour decimal like "60.5" for 60:30, 'hour': only hours part "12", 'min': only minutes part "30", 'sec': only seconds part, 'month': only month part, 'year': only year part); * @param int $lengthOfDay Length of day (default 86400 seconds for 1 day, 28800 for 8 hour) * @param int $lengthOfWeek Length of week (default 7) * @return string Formated text of duration @@ -180,7 +157,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt if (empty($lengthOfDay)) $lengthOfDay = 86400; // 1 day = 24 hours if (empty($lengthOfWeek)) $lengthOfWeek = 7; // 1 week = 7 days - if ($format == 'all' || $format == 'allhour' || $format == 'allhourmin') + if ($format == 'all' || $format == 'allwithouthour' || $format == 'allhour' || $format == 'allhourmin') { if ($iSecond === 0) return '0'; // This is to avoid having 0 return a 12:00 AM for en_US @@ -272,6 +249,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt /** * Convert a string date into a GM Timestamps date + * Warning: YYYY-MM-DDTHH:MM:SS+02:00 (RFC3339) is not supported. If parameter gm is 1, we will use no TZ, if not we will use TZ of server, not the one inside string. * * @param string $string Date in a string * YYYYMMDD @@ -306,8 +284,8 @@ function dol_stringtotime($string, $gm=1) $string=sprintf("%04d%02d%02d%02d%02d%02d",$syear,$smonth,$sday,$shour,$smin,$ssec); } else if ( - preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})Z$/i',$string,$reg) // Convert date with format RFC3339 - || preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})$/i',$string,$reg) // Convert date with format YYYY-MM-DD HH:MM:SS + preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})Z$/i',$string,$reg) // Convert date with format YYYY-MM-DDTHH:MM:SSZ (RFC3339) + || preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})$/i',$string,$reg) // Convert date with format YYYY-MM-DD HH:MM:SS || preg_match('/^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})Z$/i',$string,$reg) // Convert date with format YYYYMMDDTHHMMSSZ ) { diff --git a/htdocs/core/lib/doleditor.lib.php b/htdocs/core/lib/doleditor.lib.php new file mode 100644 index 00000000000..5be16a4c471 --- /dev/null +++ b/htdocs/core/lib/doleditor.lib.php @@ -0,0 +1,134 @@ + + * Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2015 Alexandre Spangaro + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + + +/** + * \file htdocs/core/lib/doleditor.lib.php + * \brief Ensemble de fonctions de base pour la gestion des utilisaterus et groupes + */ + +/** + * Show list of ckeditor's themes. + * + * @param User|null $fuser User concerned or null for global theme + * @param int $edit 1 to add edit form + * @return void + */ +function show_skin($fuser,$edit=0) +{ + global $conf,$langs,$db; + global $bc; + + require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; + + $formother = new FormOther($db); + + $dirskins=array('/includes/ckeditor/ckeditor/skins'); + if (! empty($conf->modules_parts['theme'])) // Using this feature slow down application + { + foreach($conf->modules_parts['theme'] as $reldir) + { + $dirskins=array_merge($dirskins,(array) ($reldir.'theme')); + } + } + $dirskins=array_unique($dirskins); + // Now dir_themes=array('/themes') or dir_themes=array('/theme','/mymodule/theme') + + $selected_theme=''; + if (empty($conf->global->FCKEDITOR_SKIN)) $selected_theme='moono'; + else $selected_theme=$conf->global->FCKEDITOR_SKIN; + + $colspan=2; + + $thumbsbyrow=6; + print '
    '.$langs->trans("Company").'
    '; + + $var=false; + + // Title + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + + //$var=!$var; + print ''; + + print '
    '.$langs->trans("DefaultSkin").''; + $url='http://ckeditor.com/addons/skins/all'; + /*print ''; + print $langs->trans('DownloadMoreSkins'); + print '';*/ + print '
    '.$langs->trans("ThemeDir").''; + foreach($dirskins as $dirskin) + { + echo '"'.$dirskin.'" '; + } + print '
    '; + + print '
    '; + + $i=0; + foreach($dirskins as $dir) + { + //print $dirroot.$dir;exit; + $dirskin=dol_buildpath($dir,0); // This include loop on $conf->file->dol_document_root + $urltheme=dol_buildpath($dir,1); + + if (is_dir($dirskin)) + { + $handle=opendir($dirskin); + if (is_resource($handle)) + { + while (($subdir = readdir($handle))!==false) + { + if (is_dir($dirskin."/".$subdir) && substr($subdir, 0, 1) <> '.' + && substr($subdir, 0, 3) <> 'CVS' && ! preg_match('/common|phones/i',$subdir)) + { + // Disable not stable themes (dir ends with _exp or _dev) + if ($conf->global->MAIN_FEATURES_LEVEL < 2 && preg_match('/_dev$/i',$subdir)) continue; + if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/_exp$/i',$subdir)) continue; + + print '
    '; + if ($subdir == $selected_theme) + { + print ' '.$subdir.''; + } + else + { + print ' '.$subdir; + } + print '
    '; + + $i++; + } + } + } + } + } + + print '
    '; + + print '
    '; +} + diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 2f197d8b645..c1b68d0f1b7 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -202,6 +202,329 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil } } +/** + * Scan a directory and return a array of files/directories from a selection. + * Content for string is UTF8 and dir separator is "/". + * + * @param int $fk_soc select socid - for your selection in array + * @param string $module_get Starting path from which to search + * @param string $sortorder SORT_ASC or SORT_DESC + * @param array $excludefiles Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.')) + * @return array Array of array( filefolder=> array( filelabel=> array( file=> array('name'=>'xxx','date'=>'yyy','size'=>99,'type'=>'dir|file')))) + */ +function get_soc_file_array($fk_soc, $module_get = false, $sortorder = false, $excludefiles = false) +{ + global $user, $conf, $db; + + $sortfield = "date"; + + if(!$sortorder){ + $sorting = SORT_DESC; + }else{ + $sorting = $sortorder; + } + + $ar_modules_get = array(); + if (is_array($module_get)) $ar_modules_get = $module_get; + elseif (strlen($module_get) > 0) $ar_modules_get[$module_get] = $module_get; + else + { + $ar_modules_get['company'] = 'company'; + $ar_modules_get['dolimail'] = 'dolimail'; + $ar_modules_get['actions'] = 'actions'; + $ar_modules_get['invoice'] = 'invoice'; + $ar_modules_get['order'] = 'order'; + $ar_modules_get['propal'] = 'propal'; + $ar_modules_get['contract'] = 'contract'; + $ar_modules_get['project'] = 'project'; + $ar_modules_get['invoice_supplier'] = 'invoice_supplier'; + $ar_modules_get['order_supplier'] = 'order_supplier'; + } + + + // rights + if (count($ar_modules_get) > 0) + foreach($ar_modules_get as $curmodule) + { + switch($curmodule) + { + case 'company': + if (! empty($conf->societe->enabled)) // Recht Alle oder nur die Vertriebspartneradressen + $ar_modules_secure['company']['outputdir'] = $conf->societe->dir_output; + break; + case 'dolimail': + if (! empty($conf->dolimail->enabled) && ($user->rights->dolimail->read || $user->admin)) + $ar_modules_secure[$curmodule]['outputdir']=$conf->dolimail->dir_output.'/attachments'; + break; + case 'actions': + if (! empty($conf->agenda->enabled) || ($user->rights->agenda->allactions->read || $user->admin)) + $ar_modules_secure[$curmodule]['outputdir']=$conf->agenda->dir_output; + break; + case 'invoice': + if (! empty($conf->facture->enabled) && ($user->rights->facture->lire || $user->admin)) + $ar_modules_secure[$curmodule]['outputdir']=$conf->facture->dir_output; + break; + case 'order': + if (!empty($conf->commande->enabled) && ($user->rights->commande->lire || $user->admin)) + $ar_modules_secure[$curmodule]['outputdir']=$conf->commande->dir_output; + break; + case 'propal': + if (!empty($conf->propal->enabled) && ($user->rights->propale->lire || $user->admin)) + $ar_modules_secure[$curmodule]['outputdir']=$conf->propal->dir_output; + break; + case 'project': + if (! empty($conf->projet->enabled) && ($user->rights->projet->lire || $user->admin)) + $ar_modules_secure[$curmodule]['outputdir']=$conf->projet->dir_output; + break; + case 'invoice_supplier': + if (! empty($conf->fournisseur->enabled) && ($user->rights->fournisseur->facture->lire || $user->admin)) + $ar_modules_secure[$curmodule]['outputdir']=$conf->fournisseur->dir_output.'/facture'; + break; + case 'order_supplier': + if (! empty($conf->fournisseur->enabled) && ($user->rights->fournisseur->commande->lire || $user->admin)) + $ar_modules_secure[$curmodule]['outputdir']=$conf->fournisseur->dir_output.'/commande'; + break; + } + } + /* TODO make a outputdir*/ + //unset($ar_modules_secure['dolimail']); + unset($ar_modules_secure['project']); // project (list with project) is "ref" + unset($ar_modules_secure['actions']); + unset($ar_modules_secure['contract']); + /* TODO make a outputdir*/ + unset($curmodule); + + if($fk_soc > 0) + $ar_modules_get = $ar_modules_secure; + + $xy=0; + if (count($ar_modules_get)>0) + foreach($ar_modules_get as $curmodule => $myarray) + { + if($fk_soc > 0 && $curmodule != "company") + { + + // SQL to find documents (ref number) + + if($curmodule == "invoice") $sql = "SELECT facnumber as refstr FROM ".MAIN_DB_PREFIX."facture"; + elseif($curmodule == "order") $sql = "SELECT ref as refstr FROM ".MAIN_DB_PREFIX."commande"; + elseif($curmodule == "invoice_supplier") $sql = "SELECT rowid as refstr FROM ".MAIN_DB_PREFIX."facture_fourn"; + elseif($curmodule == "order_supplier") $sql = "SELECT ref as refstr FROM ".MAIN_DB_PREFIX."commande_fournisseur"; + elseif($curmodule == "propal") $sql = "SELECT ref as refstr FROM ".MAIN_DB_PREFIX."propal"; + elseif($curmodule == "contract") $sql = "SELECT ref as refstr FROM ".MAIN_DB_PREFIX."contrat"; + elseif($curmodule == "dolimail") $sql = "SELECT uid as refstr, subject FROM ".MAIN_DB_PREFIX."mails"; + + $sql.= ' WHERE entity IN ('.getEntity('societe', 1).')'; + $sql.= " AND fk_soc = '".$fk_soc."'"; + + + $res = $db->query($sql); + if ($res && $db->num_rows($res) > 0) + { + while($obj = $db->fetch_object($res)) + { + $ar_modules_secure[$curmodule]['socref'][] = $obj->refstr; + if($curmodule == "dolimail") $ar_modules_secure['dolimail']['subject'][$obj->refstr] = $obj->subject; + } + } + else + { + unset($ar_modules_secure[$curmodule]); + continue; + $errors[]="SQL Error: ".$sql; + $error++; + } + + + }else{ + if($curmodule == "dolimail") $sql = "SELECT uid as refstr, subject FROM ".MAIN_DB_PREFIX."mails"; + + $res = $db->query($sql); + if ($res && $db->num_rows($res) > 0) + { + while($obj = $db->fetch_object($res)) + { + if($curmodule == "dolimail") $ar_modules_secure['dolimail']['subject'][$obj->refstr] = $obj->subject; + } + } + } + + // Data in Array + // Get Array from ar_module + + $output[$curmodule]=dol_dir_list($myarray['outputdir'],"files",1,'', $excludefiles, $sortfield, $sorting,1); + if($fk_soc > 0) + { + if($curmodule == "company") + { + foreach($output["company"] as $label => $filedata) + { + if($filedata['level1name'] != $fk_soc) + { + unset($output['company'][$label]); + } + } + } + + elseif($curmodule == "invoice") + { + if (! is_array($ar_modules_secure[$curmodule]['socref'])) { unset($output[$curmodule]); continue; } // wenn no file exsit + foreach($output["invoice"] as $label => $filedata) + { + if (! in_array($filedata['level1name'], $ar_modules_secure[$curmodule]['socref'])) + { + unset($output[$curmodule][$label]); // throw all ref number who are not in ($fac_supp_N_arr) array + } + + } + } + elseif($curmodule == "invoice_supplier") + { + if (! is_array($ar_modules_secure[$curmodule]['socref'])) { unset($output[$curmodule]); } // throw all ref number who are not in ($fac_invoice_arr) array + foreach($output["invoice_supplier"] as $label => $filedata) + { + if (! in_array($filedata['level1name'], $ar_modules_secure[$curmodule]['socref'])) { + unset($output[$curmodule][$label]); // throw all ref number who are not in ($fac_supp_N_arr) array + } + } + } + elseif($curmodule == "order") + { + if (! is_array($ar_modules_secure[$curmodule]['socref'])) { unset($output[$curmodule]); continue; } // throw all ref number who are not in ($fac_invoice_arr) array + foreach($output["order"] as $label => $filedata) + { + if (! in_array($filedata['level1name'], $ar_modules_secure[$curmodule]['socref'])) { + unset($output[$curmodule][$label]); // throw all ref number who are not in ($ref_order_arr) array + } + } + } + elseif($curmodule == "order_supplier") + { + if (! is_array($ar_modules_secure[$curmodule]['socref'])) { unset($output[$curmodule]); continue; } // throw all ref number who are not in ($fac_invoice_arr) array + foreach($output["order_supplier"] as $label => $filedata) + { + if (! in_array($filedata['level1name'], $ar_modules_secure[$curmodule]['socref'])) { + unset($output[$curmodule][$label]); // throw all ref number who are not in ($ref_order_supp_arr) array + } + } + } + elseif($curmodule == "propal") + { + if (! is_array($ar_modules_secure[$curmodule]['socref'])) { unset($output[$curmodule]); continue; } // throw all ref number who are not in ($fac_invoice_arr) array + foreach($output["propal"] as $label => $filedata) + { + if (! in_array($filedata['level1name'], $ar_modules_secure[$curmodule]['socref'])) { + unset($output[$curmodule][$label]); // throw all ref number who are not in ($ref_propal_arr) array + } + } + } + elseif($curmodule == "contract") + { + if (! is_array($ar_modules_secure[$curmodule]['socref'])) { unset($output[$curmodule]); continue; } // throw all ref number who are not in ($fac_invoice_arr) array + foreach($output["contract"] as $label => $filedata) + { + if (! in_array($filedata['level1name'], $ar_modules_secure[$curmodule]['socref'])) { + unset($output[$curmodule][$label]); // throw all ref number who are not in ($ref_contract_arr) array + } + } + } + elseif($curmodule == "dolimail") + { + + if (! is_array($ar_modules_secure[$curmodule]['socref'])) { unset($output[$curmodule]); continue; } // throw all ref number who are not in ($fac_invoice_arr) array + foreach($output["dolimail"] as $label => $filedata) + { + if($filedata['name'] == "winmail.dat" || $filedata['name'] == "smime.p7s") unset($output[$curmodule][$label]); + else + if (! in_array($filedata['level1name'], $ar_modules_secure[$curmodule]['socref'])) { + unset($output[$curmodule][$label]); // throw all ref number who are not in ($ref_propal_arr) array + } + } + } + // Error if ther isn't any File + if(count($output[$curmodule]) == 0) + { + $error++; + $errors[]="Error [404]: No File found for User: ".$fk_soc." in module: ".$curmodule; + unset($output[$curmodule]); + } + } + + // Extra for Mail attachments + if($curmodule == "dolimail" && count($output["dolimail"])>0) + { + foreach($output["dolimail"] as $label => $filedata) + { + $output[$curmodule][$label]['subject'] = $ar_modules_secure['dolimail']['subject'][$filedata['level1name']]; + } + } + + // Extra for Mail attachments + if($curmodule == "invoice" && count($output["invoice"])>0) + { + foreach($output["invoice"] as $label => $filedata) + { + $output[$curmodule][$label]['subject'] = $filedata['level1name']; + } + } + + // Extra for Mail attachments + if($curmodule == "invoice_supplier" && count($output["invoice_supplier"])>0) + { + foreach($output["invoice_supplier"] as $label => $filedata) + { + $output[$curmodule][$label]['subject'] = $filedata['level1name']; + } + } + + // Extra for Mail attachments + if($curmodule == "contract" && count($output["contract"])>0) + { + foreach($output["contract"] as $label => $filedata) + { + $output[$curmodule][$label]['subject'] = $filedata['level1name']; + } + } + + $xy++; + } + + if(count($output) > 0) + { + return $output; + } + else + { + return -1; + } +} + +/** + * Calculate Bytes to kb, mb and translate it to current language + * + * @param int $byt Bytes + * @return string calculated string + */ +function calculate_byte($byt) +{ + global $langs; + + if ($byt < 1024) { + $unit = ' '.$langs->trans("b"); + $mailsize=$byt; + } else if ($byt / 1024 > 1024) { + $mailsize = $byt / 1024 / 1024; + $unit = ' '.$langs->trans("Mb"); + } else { + $mailsize = $byt / 1024; + $unit = ' '.$langs->trans("Kb"); + } + + $val = number_format($mailsize, 2).$unit; + + return $val; +} + /** * Fast compare of 2 files identified by their properties ->name, ->date and ->size * @@ -627,7 +950,7 @@ function dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1) else dol_syslog("files.lib.php::dol_move failed", LOG_WARNING); } if (empty($newmask) && ! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK; - @chmod($newpathofsrcfile, octdec($newmask)); + @chmod($newpathofdestfile, octdec($newmask)); } return $result; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 30d8e7a5045..f07ff99c72a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -142,14 +142,14 @@ function getEntity($element=false, $shared=0) */ function getBrowserInfo($user_agent) { - include_once DOL_DOCUMENT_ROOT.'/includes/mobiledetect/mobiledetect.class.php'; + include_once DOL_DOCUMENT_ROOT.'/includes/mobiledetect/mobiledetectlib/Mobile_Detect.php'; $name='unknown'; $version=''; $os='unknown'; $phone = ''; - $detectmobile = new MobileDetect(null, $user_agent); + $detectmobile = new Mobile_Detect(null, $user_agent); $tablet = $detectmobile->isTablet(); if ($detectmobile->isMobile()) { @@ -302,7 +302,7 @@ function dol_getprefix() * * @param string $relpath Relative path to file (Ie: mydir/myfile, ../myfile, ...) * @param string $classname Class name - * @return bool + * @return bool True if load is a success, False if it fails */ function dol_include_once($relpath, $classname='') { @@ -397,7 +397,7 @@ function dol_clone($object) { dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING); - $myclone=clone($object); + $myclone = clone $object; return $myclone; } @@ -693,17 +693,17 @@ function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto * Show tab header of a card * * @param array $links Array of tabs - * @param int $active Active tab name + * @param string $active Active tab name * @param string $title Title * @param int $notab 0=Add tab header, 1=no tab header. If you set this to 1, using dol_fiche_end() to close tab is not required. * @param string $picto Add a picto on tab title * @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto. * @return string */ -function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0) +function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0) { - global $conf,$langs; - + global $conf,$langs, $hookmanager; + $out="\n".'
    '."\n"; // Show title @@ -731,6 +731,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p // if =0 we don't use the feature $limittoshow=(empty($conf->global->MAIN_MAXTABS_IN_CARD)?99:$conf->global->MAIN_MAXTABS_IN_CARD); $displaytab=0; + $nbintab=0; for ($i = 0 ; $i <= $maxkey ; $i++) { @@ -767,7 +768,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p } else { - $out.=''.$links[$i][1].''."\n"; + $out.=''.$links[$i][1].''."\n"; } } $out.='
    '; @@ -787,6 +788,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p $outmore.=''.$links[$i][1].''."\n"; $outmore.=''; + $nbintab++; } $displaytab=$i; } @@ -795,20 +797,23 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p { $tabsname=str_replace("@", "", $picto); $out.='
    '; - $out.=''.$langs->trans("More").'...'; + $out.=''.$langs->trans("More").' '.$nbintab.''; $out.='
    '.$outmore.'
    '; $out.="
    \n"; $out.=""; } $out.="\n"; - + if (! $notab) $out.="\n".'
    '."\n"; + $parameters=array('tabname' => $active); + $reshook=$hookmanager->executeHooks('printTabsHead',$parameters); // Note that $action and $object may have been modified by some hooks + return $out; } @@ -962,7 +967,8 @@ function dol_strftime($fmt, $ts=false, $is_gmt=false) * "day", "daytext", "dayhour", "dayhourldap", "dayhourtext", "dayrfc", "dayhourrfc" * @param string $tzoutput true or 'gmt' => string is for Greenwich location * false or 'tzserver' => output string is for local PHP server TZ usage - * 'tzuser' => output string is for local browser TZ usage + * 'tzuser' => output string is for user TZ (current browser TZ with current dst) + * 'tzuserrel' => output string is for user TZ (current browser TZ with dst or not, depending on date position) * @param Translate $outputlangs Object lang that contains language for text translation. * @param boolean $encodetooutput false=no convert into output pagecode * @return string Formated date or '' if time is null @@ -984,19 +990,17 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e if ($tzoutput == 'tzserver') { $to_gmt=false; - $offsettz=$offsetdst=0; + $offsettzstring=@date_default_timezone_get(); // Example 'Europe/Berlin' or 'Indian/Reunion' + $offsettz=0; + $offsetdst=0; } elseif ($tzoutput == 'tzuser') { $to_gmt=true; + $offsettzstring=(empty($_SESSION['dol_tz_string'])?'UTC':$_SESSION['dol_tz_string']); // Example 'Europe/Berlin' or 'Indian/Reunion' $offsettz=(empty($_SESSION['dol_tz'])?0:$_SESSION['dol_tz'])*60*60; $offsetdst=(empty($_SESSION['dol_dst'])?0:$_SESSION['dol_dst'])*60*60; } - elseif ($tzoutput == 'tzcompany') - { - $to_gmt=false; - $offsettz=$offsetdst=0; // TODO Define this and use it later - } } } if (! is_object($outputlangs)) $outputlangs=$langs; @@ -1045,9 +1049,9 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e $format=str_replace('%A','__A__',$format); } - // Analyze date (deprecated) Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000 + // Analyze date if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i',$time,$reg) - || preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i',$time,$reg)) + || preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i',$time,$reg)) // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000 { // This part of code should not be used. TODO Remove this. dol_syslog("Functions.lib::dol_print_date function call with deprecated value of time in page ".$_SERVER["PHP_SELF"], LOG_WARNING); @@ -1067,7 +1071,7 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e // Date is a timestamps if ($time < 100000000000) // Protection against bad date values { - $ret=adodb_strftime($format,$time+$offsettz+$offsetdst,$to_gmt); // TODO Remove this + $ret=adodb_strftime($format,$time+$offsettz+$offsetdst,$to_gmt); // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring. } else $ret='Bad value '.$time.' for date'; } @@ -1198,13 +1202,13 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1) { if (empty($gm) || $gm === 'server') { - $default_timezone=@date_default_timezone_get(); + $default_timezone=@date_default_timezone_get(); // Example 'Europe/Berlin' $localtz = new DateTimeZone($default_timezone); } else if ($gm === 'user') { - // We use dol_tz_string first because it contains dst. - $default_timezone=(empty($_SESSION["dol_tz_string"])?@date_default_timezone_get():$_SESSION["dol_tz_string"]); + // We use dol_tz_string first because it is more reliable. + $default_timezone=(empty($_SESSION["dol_tz_string"])?@date_default_timezone_get():$_SESSION["dol_tz_string"]); // Example 'Europe/Berlin' try { $localtz = new DateTimeZone($default_timezone); } @@ -1228,19 +1232,6 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1) else { dol_print_error('','PHP version must be 5.3+'); - /* - $usealternatemethod=false; - if ($year <= 1970) $usealternatemethod=true; // <= 1970 - if ($year >= 2038) $usealternatemethod=true; // >= 2038 - - if ($usealternatemethod || $gm) // Si time gm, seule adodb peut convertir - { - $date=adodb_mktime($hour,$minute,$second,$month,$day,$year,0,$gm); - } - else - { - $date=mktime($hour,$minute,$second,$month,$day,$year); - }*/ return ''; } } @@ -2744,8 +2735,8 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m * * @param string $title Title to show * @return string Title to show - * @deprecated Use print_fiche_titre instead - * @see print_fiche_titre + * @deprecated Use load_fiche_titre instead + * @see load_fiche_titre */ function print_titre($title) { @@ -2780,7 +2771,7 @@ function print_fiche_titre($title, $mesg='', $picto='title_generic.png', $pictoi * @param int $id To force an id on html objects * @return string */ -function load_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath=0, $id=0) +function load_fiche_titre($titre, $mesg='', $picto='title_generic.png', $pictoisfullpath=0, $id=0) { global $conf; @@ -2861,7 +2852,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so { if ($totalnboflines) // If we know total nb of lines { - $maxnbofpage=(empty($conf->dol_optimize_smallscreen)?10:3); // nb before and after selected page + $maxnbofpage=(empty($conf->dol_optimize_smallscreen) ? 6 : 3); // nb before and after selected page + ... + first or last $nbpages=ceil($totalnboflines/$conf->liste_limit); $cpt=($page-$maxnbofpage); @@ -2870,8 +2861,10 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so if ($cpt>=1) { $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page=0'.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">1'; - if ($cpt >= 2) $pagelist.='
  • ...
  • '; + if ($cpt > 2) $pagelist.='dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'class="inactive"':'data-role="button"').'>...'; + else if ($cpt == 2) $pagelist.='dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page=1'.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">2'; } + do { if ($cpt==$page) @@ -2885,9 +2878,11 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so $cpt++; } while ($cpt < $nbpages && $cpt<=$page+$maxnbofpage); + if ($cpt<$nbpages) { - if ($cpt<$nbpages-1) $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'class="inactive"':'data-role="button"').'>...'; + if ($cpt<$nbpages-2) $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'class="inactive"':'data-role="button"').'>...'; + else if ($cpt == $nbpages-2) $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page='.($nbpages-2).$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.($nbpages - 1).''; $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page='.($nbpages-1).$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.$nbpages.''; } } @@ -3757,7 +3752,7 @@ function yn($yesno, $case=1, $color=0) * * @param string $num Id of object * @param int $level Level of subdirs to return (1, 2 or 3 levels) - * @param int $alpha Use alpha ref + * @param int $alpha 0=Keep number only to forge path, 1=Use alpha part afer the - (By default, use 0). * @param int $withoutslash 0=With slash at end, 1=without slash at end (except if '/', we return '') * @param Object $object Object * @param string $modulepart Type of object ('invoice_supplier, 'donation', 'invoice', ...') @@ -4305,12 +4300,16 @@ function dolGetFirstLastname($firstname,$lastname,$nameorder=-1) $ret=''; // If order not defined, we use the setup if ($nameorder < 0) $nameorder=(empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)); - if ($nameorder) + if ($nameorder && ((string) $nameorder != '2')) { - $ret.=$firstname; + $ret.=$firstname; if ($firstname && $lastname) $ret.=' '; $ret.=$lastname; } + else if ($nameorder == 2) + { + $ret.=$firstname; + } else { $ret.=$lastname; @@ -4399,15 +4398,17 @@ function dol_htmloutput_events() /** * Get formated messages to output (Used to show messages on html output). + * This include also the translation of the message key. * - * @param string $mesgstring Message string - * @param array $mesgarray Messages array + * @param string $mesgstring Message string or message key + * @param string[] $mesgarray Array of message strings or message keys * @param string $style Style of message output ('ok' or 'error') * @param int $keepembedded Set to 1 in error message must be kept embedded into its html place (this disable jnotify) * @return string Return html output * * @see dol_print_error * @see dol_htmloutput_errors + * @see setEventMessages */ function get_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepembedded=0) { @@ -4492,14 +4493,15 @@ function get_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0) /** * Print formated messages to output (Used to show messages on html output). * - * @param string $mesgstring Message - * @param array $mesgarray Messages array - * @param string $style Which style to use ('ok', 'warning', 'error') - * @param int $keepembedded Set to 1 if message must be kept embedded into its html place (this disable jnotify) + * @param string $mesgstring Message string or message key + * @param string[] $mesgarray Array of message strings or message keys + * @param string $style Which style to use ('ok', 'warning', 'error') + * @param int $keepembedded Set to 1 if message must be kept embedded into its html place (this disable jnotify) * @return void * * @see dol_print_error * @see dol_htmloutput_errors + * @see setEventMessages */ function dol_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepembedded=0) { @@ -4853,6 +4855,8 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode= } else if (count($values) == 5) // deprecated { + dol_syslog('Passing 5 values in tabs module_parts is deprecated. Please update to 6 with permissions.', LOG_WARNING); + if ($values[0] != $type) continue; if ($values[3]) $langs->load($values[3]); if (preg_match('/SUBSTITUTION_([^_]+)/i',$values[2],$reg)) @@ -4899,7 +4903,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode= */ function printCommonFooter($zone='private') { - global $conf; + global $conf, $hookmanager; global $micro_start_time; if ($zone == 'private') print "\n".''."\n"; @@ -4936,7 +4940,7 @@ function printCommonFooter($zone='private') print 'MAIN_OPTIMIZE_SPEED='.(isset($conf->global->MAIN_OPTIMIZE_SPEED)?$conf->global->MAIN_OPTIMIZE_SPEED:'off'); if ($micro_start_time) { - $micro_end_time=dol_microtime_float(); + $micro_end_time = microtime(true); print ' - Build time: '.ceil(1000*($micro_end_time-$micro_start_time)).' ms'; } if (function_exists("memory_get_usage")) @@ -4977,6 +4981,8 @@ function printCommonFooter($zone='private') print "End of log output -->\n"; } + $parameters=array(); + $reshook=$hookmanager->executeHooks('printCommonFooter',$parameters); // Note that $action and $object may have been modified by some hooks } /** diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index e7566107613..651e4ea54ac 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1,9 +1,10 @@ - * Copyright (C) 2008-2012 Regis Houssin - * Copyright (C) 2008 Raphael Bertrand (Resultic) +/* Copyright (C) 2008-2011 Laurent Destailleur + * Copyright (C) 2008-2012 Regis Houssin + * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2014 Marcos García * Copyright (C) 2015 Ferran Marcet + * Copyright (C) 2015 Raphaël Doursenaud * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -104,7 +105,9 @@ function dolGetModulesDirs($subdir='') foreach ($conf->file->dol_document_root as $type => $dirroot) { // Default core/modules dir - $modulesdir[$dirroot . '/core/modules'.$subdir.'/'] = $dirroot . '/core/modules'.$subdir.'/'; + if ($type === 'main') { + $modulesdir[$dirroot . '/core/modules' . $subdir . '/'] = $dirroot . '/core/modules' . $subdir . '/'; + } // Scan dir from external modules $handle=@opendir($dirroot); @@ -1351,8 +1354,7 @@ function dol_print_reduction($reduction,$langs) /** * Return OS version. - * Note that PHP_OS returns only OS (not version) and OS PHP was built on, not - * necessarly OS PHP runs on. + * Note that PHP_OS returns only OS (not version) and OS PHP was built on, not necessarly OS PHP runs on. * * @return string OS version */ @@ -1366,6 +1368,7 @@ function version_os() * Return PHP version * * @return string PHP version + * @see versionphparray */ function version_php() { @@ -1376,6 +1379,7 @@ function version_php() * Return Dolibarr version * * @return string Dolibarr version + * @see versiondolibarrarray */ function version_dolibarr() { @@ -1790,10 +1794,10 @@ function cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent) /** * Get an array with properties of an element -* -* @param string $element_type Element type. ex : project_task or object@modulext or object_under@module -* @return array (module, classpath, element, subelement, classfile, classname) -*/ + * + * @param string $element_type Element type: 'action', 'facture', 'project_task' or 'object@modulext'... + * @return array (module, classpath, element, subelement, classfile, classname) + */ function getElementProperties($element_type) { // Parse element/subelement (ex: project_task) @@ -1886,15 +1890,15 @@ function getElementProperties($element_type) } /** - * Fetch an object with element_type and its id + * Fetch an object from its id and element_type * Inclusion classes is automatic * - * @param int $element_id Element id - * @param string $element_type Element type - * @return object || 0 || -1 if error + * @param int $element_id Element id + * @param string $element_type Element type + * @return int|object object || 0 || -1 if error */ -function fetchObjectByElement($element_id,$element_type) { - +function fetchObjectByElement($element_id, $element_type) +{ global $conf; global $db,$conf; diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index af0c6b91da0..682ddb1b1d1 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -24,12 +24,12 @@ /** * Function get content from an URL (use proxy if proxy defined) * - * @param string $url URL to call. - * @param string $postorget 'POST', 'GET', 'HEAD' - * @param string $param Parameters of URL (x=value1&y=value2) - * @param string $followlocation 1=Follow location, 0=Do not follow - * @param array $addheaders Array of string to add into header. Example: array('Accept: application/xrds+xml', ....) - * @return array Returns an associative array containing the response from the server array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...) + * @param string $url URL to call. + * @param string $postorget 'POST', 'GET', 'HEAD', 'PUT', 'PUTALREADYFORMATED', 'DELETE' + * @param string $param Parameters of URL (x=value1&y=value2) or may be a formated content with PUTALREADYFORMATED + * @param string $followlocation 1=Follow location, 0=Do not follow + * @param array $addheaders Array of string to add into header. Example: ('Accept: application/xrds+xml', ....) + * @return array Returns an associative array containing the response from the server array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...) */ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addheaders=array()) { @@ -74,7 +74,18 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea else if ($postorget == 'PUT') { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT' - curl_setopt($ch, CURLOPT_POSTFIELDS, $param); // Setting param x=a&y=z as PUT fields + if (! is_array($param)) parse_str($param, $array_param); + else + { + dol_syslog("parameter param must be a string", LOG_WARNING); + $array_param=$param; + } + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($array_param)); // Setting param x=a&y=z as PUT fields + } + else if ($postorget == 'PUTALREADYFORMATED') + { + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT' + curl_setopt($ch, CURLOPT_POSTFIELDS, $param); // param = content of post, like a xml string } else if ($postorget == 'HEAD') { diff --git a/htdocs/core/lib/json.lib.php b/htdocs/core/lib/json.lib.php index e3f00a064e5..6b868663aa7 100644 --- a/htdocs/core/lib/json.lib.php +++ b/htdocs/core/lib/json.lib.php @@ -43,9 +43,12 @@ if (! function_exists('json_encode')) * @param mixed $elements PHP Object to json encode * @return string Json encoded string * @deprecated PHP >= 5.3 supports native json_encode + * @see json_encode() */ function dol_json_encode($elements) { + dol_syslog('dol_json_encode() is deprecated. Please update your code to use native json_encode().', LOG_WARNING); + $num=count($elements); if (is_object($elements)) // Count number of properties for an object { @@ -221,9 +224,12 @@ if (! function_exists('json_decode')) * @param bool $assoc False return an object, true return an array. Try to always use it with true ! * @return mixed Object or Array or false on error * @deprecated PHP >= 5.3 supports native json_decode + * @see json_decode() */ function dol_json_decode($json, $assoc=false) { + dol_syslog('dol_json_decode() is deprecated. Please update your code to use native json_decode().', LOG_WARNING); + $comment = false; $out=''; @@ -253,7 +259,9 @@ function dol_json_decode($json, $assoc=false) if (! empty($array)) { $object = false; - + if (count($array)>0) { + $object = (object) array(); + } foreach ($array as $key => $value) { if ($key) $object->{$key} = $value; diff --git a/htdocs/core/lib/memory.lib.php b/htdocs/core/lib/memory.lib.php index b68016c3a46..69c127f915c 100644 --- a/htdocs/core/lib/memory.lib.php +++ b/htdocs/core/lib/memory.lib.php @@ -47,14 +47,19 @@ function dol_setcache($memoryid,$data) // Using a memcached server if (! empty($conf->memcached->enabled) && class_exists('Memcached')) { - $memoryid=session_name().'_'.$memoryid; - $m=new Memcached(); - $tmparray=explode(':',$conf->global->MEMCACHED_SERVER); - $result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211); - //$m->setOption(Memcached::OPT_COMPRESSION, false); - //print "Add memoryid=".$memoryid; - $m->add($memoryid,$data); // This fails if key already exists - $rescode=$m->getResultCode(); + global $dolmemcache; + if (empty($dolmemcache) || ! is_object($dolmemcache)) + { + $dolmemcache=new Memcached(); + $tmparray=explode(':',$conf->global->MEMCACHED_SERVER); + $result=$dolmemcache->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211); + if (! $result) return -1; + } + + $memoryid=session_name().'_'.$memoryid; + //$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false); + $dolmemcache->add($memoryid,$data); // This fails if key already exists + $rescode=$dolmemcache->getResultCode(); if ($rescode == 0) { return count($data); @@ -66,12 +71,18 @@ function dol_setcache($memoryid,$data) } else if (! empty($conf->memcached->enabled) && class_exists('Memcache')) { - $memoryid=session_name().'_'.$memoryid; - $m=new Memcache(); - $tmparray=explode(':',$conf->global->MEMCACHED_SERVER); - $result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211); - //$m->setOption(Memcached::OPT_COMPRESSION, false); - $result=$m->add($memoryid,$data); // This fails if key already exists + global $dolmemcache; + if (empty($dolmemcache) || ! is_object($dolmemcache)) + { + $dolmemcache=new Memcache(); + $tmparray=explode(':',$conf->global->MEMCACHED_SERVER); + $result=$dolmemcache->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211); + if (! $result) return -1; + } + + $memoryid=session_name().'_'.$memoryid; + //$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false); + $result=$dolmemcache->add($memoryid,$data); // This fails if key already exists if ($result) { return count($data); @@ -103,10 +114,16 @@ function dol_getcache($memoryid) // Using a memcached server if (! empty($conf->memcached->enabled) && class_exists('Memcached')) { + global $m; + if (empty($m) || ! is_object($m)) + { + $m=new Memcached(); + $tmparray=explode(':',$conf->global->MEMCACHED_SERVER); + $result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211); + if (! $result) return -1; + } + $memoryid=session_name().'_'.$memoryid; - $m=new Memcached(); - $tmparray=explode(':',$conf->global->MEMCACHED_SERVER); - $result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211); //$m->setOption(Memcached::OPT_COMPRESSION, false); //print "Get memoryid=".$memoryid; $data=$m->get($memoryid); @@ -124,10 +141,16 @@ function dol_getcache($memoryid) } else if (! empty($conf->memcached->enabled) && class_exists('Memcache')) { - $memoryid=session_name().'_'.$memoryid; - $m=new Memcache(); - $tmparray=explode(':',$conf->global->MEMCACHED_SERVER); - $result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211); + global $m; + if (empty($m) || ! is_object($m)) + { + $m=new Memcache(); + $tmparray=explode(':',$conf->global->MEMCACHED_SERVER); + $result=$m->addServer($tmparray[0], $tmparray[1]?$tmparray[1]:11211); + if (! $result) return -1; + } + + $memoryid=session_name().'_'.$memoryid; //$m->setOption(Memcached::OPT_COMPRESSION, false); $data=$m->get($memoryid); //print "memoryid=".$memoryid." - rescode=".$rescode." - data=".count($data)."\n
    "; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index d294bac5132..6f2d9ff8089 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -290,6 +290,55 @@ function pdf_getHeightForLogo($logo, $url = false) return $height; } +/** + * Function to try to calculate height of a HTML Content + * + * @param TCPDF $pdf PDF initialized object + * @param string $htmlcontent HTML Contect + * @see getStringHeight + */ +function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent) +{ + // store current object + $pdf->startTransaction(); + // store starting values + $start_y = $pdf->GetY(); + var_dump($start_y); + $start_page = $pdf->getPage(); + // call your printing functions with your parameters + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + $pdf->writeHTMLCell(0, 0, 0, $start_y, $htmlcontent, 0, 1, false, true, 'J',true); + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // get the new Y + $end_y = $pdf->GetY(); + $end_page = $pdf->getPage(); + // calculate height + $height = 0; + if ($end_page == $start_page) { + $height = $end_y - $start_y; + } + else + { + for ($page=$start_page; $page <= $end_page; ++$page) { + $this->setPage($page); + if ($page == $start_page) { + // first page + $height = $this->h - $start_y - $this->bMargin; + } elseif ($page == $end_page) { + // last page + $height = $end_y - $this->tMargin; + } else { + $height = $this->h - $this->tMargin - $this->bMargin; + } + } + } + // restore previous object + $pdf = $pdf->rollbackTransaction(); + + return $height; +} + + /** * Returns the name of the thirdparty * @@ -676,7 +725,8 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default if ($account->getCountryCode() == 'IN') $ibankey="IFSC"; if (! empty($account->iban)) { - $ibanDisplay_temp = $outputlangs->convToOutputCharset($account->iban); + //Remove whitespaces to ensure we are dealing with the format we expect + $ibanDisplay_temp = str_replace(' ', '', $outputlangs->convToOutputCharset($account->iban)); $ibanDisplay = ""; for($i = 0; $i < dol_strlen($ibanDisplay_temp); $i++) @@ -744,7 +794,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass // First line of company infos $line1=""; $line2=""; $line3=""; $line4=""; - if ($showdetails && 1) + if ($showdetails) { // Company name if ($fromcompany->name) @@ -788,7 +838,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass $line2.=($line2?" - ":"").$fromcompany->email; } } - if (($showdetails && 2) || ($fromcompany->country_code == 'DE')) + if ($showdetails || ($fromcompany->country_code == 'DE')) { // Managers if ($fromcompany->managers) @@ -853,11 +903,20 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass $freetextheight=0; if ($line) // Free text { - $width=20000; $align='L'; // By default, ask a manual break: We use a large value 20000, to not have automatic wrap. This make user understand, he need to add CR on its text. - if (! empty($conf->global->MAIN_USE_AUTOWRAP_ON_FREETEXT)) { - $width=200; $align='C'; + //$line="eee
    \nfdsfsdf
    \nghfghg
    "; + if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) // by default + { + $width=20000; $align='L'; // By default, ask a manual break: We use a large value 20000, to not have automatic wrap. This make user understand, he need to add CR on its text. + if (! empty($conf->global->MAIN_USE_AUTOWRAP_ON_FREETEXT)) { + $width=200; $align='C'; + } + $freetextheight=$pdf->getStringHeight($width,$line); + } + else + { + $freetextheight=pdfGetHeightForHtmlContent($pdf,dol_htmlentitiesbr($line, 1, 'UTF-8', 0)); // New method (works for HTML content) + //print '
    '.$freetextheight;exit; } - $freetextheight=$pdf->getStringHeight($width,$line); } $marginwithfooter=$marge_basse + $freetextheight + (! empty($line1)?3:0) + (! empty($line2)?3:0) + (! empty($line3)?3:0) + (! empty($line4)?3:0); @@ -866,7 +925,14 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass if ($line) // Free text { $pdf->SetXY($dims['lm'],-$posy); - $pdf->MultiCell(0, 3, $line, 0, $align, 0); + if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) // by default + { + $pdf->MultiCell(0, 3, $line, 0, $align, 0); + } + else + { + $pdf->writeHTMLCell($pdf->page_largeur - $pdf->margin_left - $pdf->margin_right, $freetextheight, $dims['lm'], $dims['hk']-$marginwithfooter, dol_htmlentitiesbr($line, 1, 'UTF-8', 0)); + } $posy-=$freetextheight; } @@ -1275,7 +1341,10 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlinevatrate',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlinevatrate',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else { @@ -1305,7 +1374,10 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlineupexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlineupexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else { @@ -1362,7 +1434,11 @@ function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlineqty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlineqty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; + } else { @@ -1392,7 +1468,10 @@ function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlineqty_asked',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlineqty_asked',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else { @@ -1422,7 +1501,10 @@ function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlineqty_shipped',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlineqty_shipped',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else { @@ -1452,7 +1534,10 @@ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlineqty_keeptoship',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlineqty_keeptoship',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else { @@ -1487,8 +1572,12 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanag 'special_code' => $special_code ); $action = ''; - return $hookmanager->executeHooks('pdf_getlineunit', $parameters, $object, + $reshook = $hookmanager->executeHooks('pdf_getlineunit', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; + } else { if (empty($hidedetails) || $hidedetails > 1) { return $langs->transnoentitiesnoconv($object->lines[$i]->getLabelOfUnit('short')); @@ -1521,7 +1610,10 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlineremisepercent',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlineremisepercent',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else { @@ -1548,7 +1640,10 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm if (!empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i' => $i, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails, 'special_code' => $special_code); $action = ''; - return $hookmanager->executeHooks('pdf_getlineprogress', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlineprogress', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else { if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->situation_percent . '%'; } @@ -1583,7 +1678,10 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlinetotalexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlinetotalexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else { @@ -1618,7 +1716,10 @@ function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlinetotalwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlinetotalwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else { @@ -1692,64 +1793,61 @@ function pdf_getLinkedObjects($object,$outputlangs) if ($objecttype == 'propal') { $outputlangs->load('propal'); - $num=count($objects); - for ($i=0;$i<$num;$i++) + + foreach($objects as $elementobject) { $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefProposal"); - $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref); + $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref); $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DatePropal"); - $linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date,'day','',$outputlangs); + $linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date,'day','',$outputlangs); } } else if ($objecttype == 'commande') { $outputlangs->load('orders'); - $num=count($objects); - for ($i=0;$i<$num;$i++) + foreach($objects as $elementobject) { $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder"); - $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref) . ($objects[$i]->ref_client ? ' ('.$objects[$i]->ref_client.')' : ''); + $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref) . ($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : ''); $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate"); - $linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date,'day','',$outputlangs); + $linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date,'day','',$outputlangs); } } else if ($objecttype == 'contrat') { $outputlangs->load('contracts'); - $num=count($objects); - for ($i=0;$i<$num;$i++) + foreach($objects as $elementobject) { $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefContract"); - $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref); + $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref); $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateContract"); - $linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date_contrat,'day','',$outputlangs); + $linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date_contrat,'day','',$outputlangs); } } else if ($objecttype == 'shipping') { $outputlangs->load('orders'); $outputlangs->load('sendings'); - $num=count($objects); - for ($i=0;$i<$num;$i++) + foreach($objects as $elementobject) { - $objects[$i]->fetchObjectLinked(); - $order = $objects[$i]->linkedObjects['commande'][0]; + $elementobject->fetchObjectLinked(); + $order = $elementobject->linkedObjects['commande'][0]; if (! empty($object->linkedObjects['commande'])) // There is already a link to order so we show only info of shipment { $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefSending"); - $linkedobjects[$objecttype]['ref_value'].= $outputlangs->transnoentities($objects[$i]->ref); + $linkedobjects[$objecttype]['ref_value'].= $outputlangs->transnoentities($elementobject->ref); $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateSending"); - $linkedobjects[$objecttype]['date_value'].= dol_print_date($objects[$i]->date_delivery,'day','',$outputlangs); + $linkedobjects[$objecttype]['date_value'].= dol_print_date($elementobject->date_delivery,'day','',$outputlangs); } else // We show both info of order and shipment { $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder") . ' / ' . $outputlangs->transnoentities("RefSending"); $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($order->ref) . ($order->ref_client ? ' ('.$order->ref_client.')' : ''); - $linkedobjects[$objecttype]['ref_value'].= ' / ' . $outputlangs->transnoentities($objects[$i]->ref); + $linkedobjects[$objecttype]['ref_value'].= ' / ' . $outputlangs->transnoentities($elementobject->ref); $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate") . ' / ' . $outputlangs->transnoentities("DateSending"); $linkedobjects[$objecttype]['date_value'] = dol_print_date($order->date,'day','',$outputlangs); - $linkedobjects[$objecttype]['date_value'].= ' / ' . dol_print_date($objects[$i]->date_delivery,'day','',$outputlangs); + $linkedobjects[$objecttype]['date_value'].= ' / ' . dol_print_date($elementobject->date_delivery,'day','',$outputlangs); } } } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 5167fcd69f3..89d658fa01a 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -378,7 +378,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t // Title of task print "
    "; if ($showlineingray) print ''; - else print ''; + else print ''; for ($k = 0 ; $k < $level ; $k++) { print "     "; @@ -401,7 +401,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t $plannedworkloadoutputformat='allhourmin'; $timespentoutputformat='allhourmin'; if (! empty($conf->global->PROJECT_PLANNED_WORKLOAD_FORMAT)) $plannedworkloadoutputformat=$conf->global->PROJECT_PLANNED_WORKLOAD_FORMAT; - if (! empty($conf->global->PROJECT_TIMES_PENT_FORMAT)) $timespentoutputformat=$conf->global->PROJECT_TIME_SPENT_FORMAT; + if (! empty($conf->global->PROJECT_TIMES_SPENT_FORMAT)) $timespentoutputformat=$conf->global->PROJECT_TIME_SPENT_FORMAT; // Planned Workload (in working hours) print ''; @@ -1023,14 +1023,13 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= if (!empty($conf->global->PROJECT_LIMIT_YEAR_RANGE)) { //Add the year filter input + print ''; print ''; print ''; print ''; - print ''; print '\n"; - print '
    '.$langs->trans("Year").''; - print ''; print "
    '; + print '
    '; } } diff --git a/htdocs/core/lib/report.lib.php b/htdocs/core/lib/report.lib.php index 79ab5fe0ead..8946449d5ac 100644 --- a/htdocs/core/lib/report.lib.php +++ b/htdocs/core/lib/report.lib.php @@ -61,7 +61,7 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat // Ligne de titre print '
    '.$langs->trans("ReportName").''.$langs->trans("ReportName").''; else print ''; print $nom; @@ -73,7 +73,7 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat if ($calcmode) { print '
    '.$langs->trans("CalculationMode").''.$langs->trans("CalculationMode").''; else print ''; print $calcmode; @@ -94,7 +94,7 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat // Ligne de description print '
    '.$langs->trans("ReportDescription").''.$langs->trans("ReportDescription").''.$description.'
    '; print ''; diff --git a/htdocs/core/lib/treeview.lib.php b/htdocs/core/lib/treeview.lib.php index 5b1682c5494..b3f3e16a3bd 100644 --- a/htdocs/core/lib/treeview.lib.php +++ b/htdocs/core/lib/treeview.lib.php @@ -94,7 +94,7 @@ function tree_showpad(&$fulltree,$key,$silent=0) -// ------------------------------- Used by menu editor ----------------- +// ------------------------------- Used by menu editor, category view, ... ----------------- /** * Recursive function to output menu tree.
    • ...
    diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 5dc17962e14..f5f8df18ba1 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -277,6 +277,10 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) if (empty($foruserprofile)) $selected_theme=$conf->global->MAIN_THEME; else $selected_theme=((is_object($fuser) && ! empty($fuser->conf->MAIN_THEME))?$fuser->conf->MAIN_THEME:''); + $hoverdisabled=''; + if (empty($foruserprofile)) $hoverdisabled=(isset($conf->global->THEME_ELDY_USE_HOVER) && $conf->global->THEME_ELDY_USE_HOVER == '0'); + else $hoverdisabled=(is_object($fuser)?(empty($fuser->conf->THEME_ELDY_USE_HOVER) || $fuser->conf->THEME_ELDY_USE_HOVER == '0'):''); + $colspan=2; if ($foruserprofile) $colspan=4; @@ -295,7 +299,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; } @@ -359,11 +363,11 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print '
    '; if ($subdir == $selected_theme) { - print ''.$subdir.''; + print ''.$subdir.''; } else { - print ' '.$subdir; + print ' '.$subdir; } print ''; @@ -378,57 +382,101 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print ''; - if (! $foruserprofile) + // Use Hover + $var=!$var; + if ($foruserprofile) + { + /* Must first change option to choose color of highlight insteado of yes or no. + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + */ + } + else + { + print ''; + print ''; + print ''; + print ''; + } + + // TopMenuBackgroundColor + if ($foruserprofile) + { + /*$var=!$var; + print ''; + print ''; + print ''; + print ''; + print '';*/ + } + else { $var=!$var; print ''; - print ''; - $hoverdisabled=(isset($conf->global->THEME_ELDY_USE_HOVER) && $conf->global->THEME_ELDY_USE_HOVER == '0'); - print ''; + print ''; + } + + // BackgroundTableTitleColor + if ($foruserprofile) + { + + + } + else + { + $var=!$var; + print ''; + print ''; + print ''; - print ''; - - //if ($conf->theme == 'eldy') - //{ - // TopMenuBackgroundColor - $var=!$var; - print ''; - print ''; - print ''; - - // BackgroundTableTitleColor - $var=!$var; - print ''; - print ''; - print ''; - //} print ''; } - + print '
    '.$langs->trans("DefaultSkin").''.$conf->global->MAIN_THEME.' '.$langs->trans("UsePersonalValue").' '.$langs->trans("UsePersonalValue").' 
    '.$langs->trans("HighlightLinesOnMouseHover").'global->THEME_ELDY_USE_HOVER?" checked":"").'> '.$langs->trans("UsePersonalValue").''; + print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '
    '.$langs->trans("HighlightLinesOnMouseHover").''; + print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '
    '.$langs->trans("TopMenuBackgroundColor").''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); + print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo + print '> '.$langs->trans("UsePersonalValue").''; + if ($edit) + { + print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''),'THEME_ELDY_TOPMENU_BACK1','formcolor',1).' '; + } + else + { + $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); + if ($color) print ''; + else print ''; + } + if ($edit) print '
    ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '
    '.$langs->trans("HighlightLinesOnMouseHover").''; - print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print ''.$langs->trans("TopMenuBackgroundColor").''; + if ($edit) + { + print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''),'THEME_ELDY_TOPMENU_BACK1','formcolor',1).' '; + } + else + { + $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); + if ($color) print ''; + else print $langs->trans("Default"); + } + print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '
    '.$langs->trans("BackgroundTableTitleColor").''; + if ($edit) + { + print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKTITLE1,array()),''),'THEME_ELDY_BACKTITLE1','formcolor',1).' '; + } + else + { + print $formother->showColor($conf->global->THEME_ELDY_BACKTITLE1, $langs->trans("Default")); + } + print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print '
    '.$langs->trans("TopMenuBackgroundColor").''; - if ($edit) - { - print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''),'THEME_ELDY_TOPMENU_BACK1','formcolor',1).' '; - } - else - { - $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); - if ($color) print ''; - else print $langs->trans("Default"); - } - print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; - print '
    '.$langs->trans("BackgroundTableTitleColor").''; - if ($edit) - { - print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKTITLE1,array()),''),'THEME_ELDY_BACKTITLE1','formcolor',1).' '; - } - else - { - print $formother->showColor($conf->global->THEME_ELDY_BACKTITLE1, $langs->trans("Default")); - } - print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; - print '
    '; } diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index 5927bf97674..14cda539291 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -59,12 +59,14 @@ function build_calfile($format,$title,$desc,$events_array,$outputfile) fwrite($calfileh,"CALSCALE:GREGORIAN\n"); fwrite($calfileh,"X-WR-CALNAME:".$encoding.format_cal($format,$title)."\n"); fwrite($calfileh,"X-WR-CALDESC:".$encoding.format_cal($format,$desc)."\n"); - $hh=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'hour'); - $mm=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'min'); - $ss=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'sec'); //fwrite($calfileh,"X-WR-TIMEZONE:Europe/Paris\n"); if (! empty($conf->global->MAIN_AGENDA_EXPORT_CACHE) - && $conf->global->MAIN_AGENDA_EXPORT_CACHE > 60) fwrite($calfileh,"X-PUBLISHED-TTL: P".$hh."H".$mm."M".$ss."S\n"); + && $conf->global->MAIN_AGENDA_EXPORT_CACHE > 60){ + $hh=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'hour'); + $mm=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'min'); + $ss=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'sec'); + fwrite($calfileh,"X-PUBLISHED-TTL: P".$hh."H".$mm."M".$ss."S\n"); + } foreach ($events_array as $date => $event) { diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index d65108e5f1a..b1bc55be0a8 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -23,6 +23,9 @@ insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin', __HANDLER__, 'left', 100__+MAX_llx_menu__, 'home', 'setup', 1__+MAX_llx_menu__, '/admin/index.php?leftmenu=setup', 'Setup', 0, 'admin', '', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 101__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/company.php?leftmenu=setup', 'MenuCompanySetup', 1, 'admin', '', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 102__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/ihm.php?leftmenu=setup', 'GUISetup', 1, 'admin', '', '', 2, 4, __ENTITY__); + +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 114__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/translation.php?leftmenu=setup', 'Translation', 1, 'admin', '', '', 2, 4, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 103__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/modules.php?leftmenu=setup', 'Modules', 1, 'admin', '', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 104__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/boxes.php?leftmenu=setup', 'Boxes', 1, 'admin', '', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 105__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/menus.php?leftmenu=setup', 'Menus', 1, 'admin', '', '', 2, 3, __ENTITY__); @@ -197,8 +200,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'accountancy', '', 2250__+MAX_llx_menu__, '/compta/sociales/charges.php?leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'accountancy', '', 2250__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'accountancy', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?leftmenu=tax_vat&action=create', 'NewPayment', 2, 'companies', '$user->rights->tax->charges->creer', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/reglement.php?leftmenu=tax_vat', 'Payments', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?leftmenu=tax_vat&action=create', 'New', 2, 'companies', '$user->rights->tax->charges->creer', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/reglement.php?leftmenu=tax_vat', 'List', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?leftmenu=tax_vat', 'ReportByCustomers', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); -- Ventilation (accounting) @@ -296,12 +299,12 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 5200__+MAX_llx_menu__, 'members', 'cat', 13__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=3', 'MembersCategoriesShort', 0, 'categories', '$user->rights->categorie->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 5201__+MAX_llx_menu__, 'members', '', 5200__+MAX_llx_menu__, '/categories/card.php?action=create&type=3', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); -- HRM - Holiday -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5000__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/holiday/index.php?&leftmenu=hrm', 'CPTitreMenu', 0, 'holiday', '$user->rights->holiday->write', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5000__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/holiday/list.php?&leftmenu=hrm', 'CPTitreMenu', 0, 'holiday', '$user->rights->holiday->write', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5001__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/card.php?&action=request', 'MenuAddCP', 1, 'holiday', '$user->rights->holiday->write', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5002__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/define_holiday.php?&action=request', 'MenuConfCP', 1, 'holiday', '$user->rights->holiday->define_holiday', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5003__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/view_log.php?&action=request', 'MenuLogCP', 1, 'holiday', '$user->rights->holiday->view_log', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5004__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/month_report.php?&action=request', 'MenuReportMonth', 1, 'holiday', '$user->rights->holiday->month_report', '', 0, 4, __ENTITY__); --- HRM - Trips and expenses +-- HRM - Expense reports insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2100__+MAX_llx_menu__, 'accountancy', 'tripsandexpenses', 15__+MAX_llx_menu__, '/compta/deplacement/index.php?leftmenu=tripsandexpenses', 'TripsAndExpenses', 0, 'trips', '$user->rights->deplacement->lire', '', 0, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2101__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses', 'New', 1, 'trips', '$user->rights->deplacement->creer', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2102__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/list.php?leftmenu=tripsandexpenses', 'List', 1, 'trips', '$user->rights->deplacement->lire', '', 0, 2, __ENTITY__); diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 15057d6f3d7..1cafd091521 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -61,17 +61,19 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) if ($showmode == 1) { $url = $shorturl = $newTabMenu[$i]['url']; + if (! preg_match("/^(http:\/\/|https:\/\/)/i",$newTabMenu[$i]['url'])) { $tmp=explode('?',$newTabMenu[$i]['url'],2); $url = $shorturl = $tmp[0]; $param = (isset($tmp[1])?$tmp[1]:''); - if (! preg_match('/mainmenu/i',$url) || ! preg_match('/leftmenu/i',$url)) $param.=($param?'&':'').'mainmenu='.$newTabMenu[$i]['mainmenu'].'&leftmenu='; + if (! preg_match('/mainmenu/i',$param) || ! preg_match('/leftmenu/i',$param)) $param.=($param?'&':'').'mainmenu='.$newTabMenu[$i]['mainmenu'].'&leftmenu='; //$url.="idmenu=".$newTabMenu[$i]['rowid']; // Already done by menuLoad $url = dol_buildpath($url,1).($param?'?'.$param:''); $shorturl = $shorturl.($param?'?'.$param:''); } + $url=preg_replace('/__LOGIN__/',$user->login,$url); $shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl); $url=preg_replace('/__USERID__/',$user->id,$url); @@ -233,7 +235,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM } $title=$langs->trans("GoIntoSetupToChangeLogo"); print "\n".''."\n"; - print '
    '."\n"; + print '
    '.img_picto('','object_globe.png').' '.$langs->trans("UrlForSurvey",'').''; +print '
    '.img_picto('','object_globe.png').' '.$langs->trans("UrlForSurvey",'').''; // Define $urlwithroot $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current -$url=$urlwithouturlroot.dol_buildpath('/public/opensurvey/studs.php',1).'?sondage='.$numsondage; -$urlvcal=''.$url.''; -print $urlvcal; +$url=$urlwithouturlroot.dol_buildpath('/public/opensurvey/studs.php',1).'?sondage='.$object->id_sondage; +$urllink=''; +print $urllink; +if ($action != 'edit') +{ + print ''; + print ' '.$langs->trans("Link").''; +} + +print '
    '; diff --git a/htdocs/opensurvey/wizard/choix_autre.php b/htdocs/opensurvey/wizard/choix_autre.php index 6b4cceaae0d..9797762d6cb 100644 --- a/htdocs/opensurvey/wizard/choix_autre.php +++ b/htdocs/opensurvey/wizard/choix_autre.php @@ -121,7 +121,7 @@ if (empty($_SESSION['titre'])) print ''."\n"; -print_fiche_titre($langs->trans("CreatePoll").' (2 / 2)'); +print load_fiche_titre($langs->trans("CreatePoll").' (2 / 2)'); print '
    '. $langs->trans("PollOnChoice") .'

    '."\n"; diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php index cc08434cd50..6a1efd39617 100644 --- a/htdocs/opensurvey/wizard/choix_date.php +++ b/htdocs/opensurvey/wizard/choix_date.php @@ -330,7 +330,7 @@ else //Debut du formulaire et bandeaux de tete print ''."\n"; -print_fiche_titre($langs->trans("CreatePoll").' (2 / 2)'); +print load_fiche_titre($langs->trans("CreatePoll").' (2 / 2)'); //affichage de l'aide pour les jours print '
    '."\n"; diff --git a/htdocs/opensurvey/wizard/create_survey.php b/htdocs/opensurvey/wizard/create_survey.php index 7f6609d5fe6..22dddffbff5 100644 --- a/htdocs/opensurvey/wizard/create_survey.php +++ b/htdocs/opensurvey/wizard/create_survey.php @@ -94,7 +94,7 @@ if (GETPOST("creation_sondage_date") || GETPOST("creation_sondage_autre")) $_SESSION['champdatefin'] = dol_print_date($champdatefin,'dayrfc'); //$testdate = false; //$_SESSION['champdatefin'] = dol_print_date($champdatefin,'dayrfc'); - setEventMessage($langs->trans('ExpiredDate'),'warnings'); + setEventMessage('ExpireDate','warnings'); } } @@ -131,7 +131,7 @@ $arrayofjs=array(); $arrayofcss=array('/opensurvey/css/style.css'); llxHeader('', $langs->trans("OpenSurvey"), '', "", 0, 0, $arrayofjs, $arrayofcss); -print_fiche_titre($langs->trans("CreatePoll").' (1 / 2)'); +print load_fiche_titre($langs->trans("CreatePoll").' (1 / 2)'); //debut du formulaire print ''."\n"; diff --git a/htdocs/opensurvey/wizard/index.php b/htdocs/opensurvey/wizard/index.php index 1f324a52a58..68f75f3bce7 100644 --- a/htdocs/opensurvey/wizard/index.php +++ b/htdocs/opensurvey/wizard/index.php @@ -41,7 +41,7 @@ $arrayofjs=array(); $arrayofcss=array('/opensurvey/css/style.css'); llxHeader('', $langs->trans("Survey"), '', "", 0, 0, $arrayofjs, $arrayofcss); -print_fiche_titre($langs->trans("CreatePoll")); +print load_fiche_titre($langs->trans("CreatePoll")); print ''; print '
    '; diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index 42f81685f8a..5a7301613c4 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -91,7 +91,7 @@ if (empty($conf->global->PAYBOX_IBS_DEVISE)) $conf->global->PAYBOX_IBS_DEVISE=$I llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("PayBoxSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("PayBoxSetup"),$linkback,'title_setup'); print $langs->trans("PayBoxDesc")."
    \n"; @@ -100,6 +100,8 @@ print ''; print ''; print ''; +dol_fiche_head(null, 'payboxaccount', ''); + $var=true; print ''; @@ -195,7 +197,13 @@ print ''; -print '

    '; +print '
    '; + +dol_fiche_end(); + +print '
    '; + +print ''; print '

    '; @@ -227,6 +235,6 @@ if (! empty($conf->adherent->enabled)) print "
    "; print info_admin($langs->trans("YouCanAddTagOnUrl")); -$db->close(); -dol_fiche_end(); llxFooter(); + +$db->close(); diff --git a/htdocs/paybox/lib/paybox.lib.php b/htdocs/paybox/lib/paybox.lib.php index a55687db823..922679bcb86 100644 --- a/htdocs/paybox/lib/paybox.lib.php +++ b/htdocs/paybox/lib/paybox.lib.php @@ -131,7 +131,6 @@ function print_paybox_redirect($PRICE,$CURRENCY,$EMAIL,$urlok,$urlko,$TAG) $IBS_MODE=1; // Mode formulaire $IBS_PORTEUR=$EMAIL; $IBS_RETOUR="montant:M;ref:R;auto:A;trans:T"; // Format des parametres du get de validation en reponse (url a definir sous paybox) - //$IBS_TXT="
    ".$langsiso->trans("YouWillBeRedirectedOnPayBox")."
    ".$langsiso->trans("PleaseBePatient")."...
    "; $IBS_TXT=' '; // Use a space $IBS_BOUTPI=$langs->trans("Wait"); //$IBS_BOUTPI=''; diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index eec35e38430..fd649b825bc 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -93,11 +93,16 @@ llxHeader('',$langs->trans("PaypalSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("ModuleSetup").' PayPal',$linkback); +print load_fiche_titre($langs->trans("ModuleSetup").' PayPal',$linkback); print '
    '; $head=paypaladmin_prepare_head(); +print '
    '; +print ''; +print ''; + + dol_fiche_head($head, 'paypalaccount', ''); print $langs->trans("PaypalDesc")."
    \n"; @@ -111,10 +116,6 @@ if (! function_exists('curl_version')) print '
    '; -print ''; -print ''; -print ''; - print ''; @@ -232,12 +233,12 @@ print ''; print '
    '; -print '
    '; +dol_fiche_end(); + +print '
    '; print '
    '; -dol_fiche_end(); - print '

    '; // Help doc @@ -365,10 +366,10 @@ if (! empty($conf->use_javascript_ajax)) { print "\n".''; - } - $checked=($_POST["superadmin"]?' checked':''); - $disabled=($_POST["superadmin"]?'':' disabled'); - print ' '.$langs->trans("SuperAdministrator"); + $("input[name=superadmin]").change(function() { + if ( $(this).is(":checked") ) { + $("select[name=entity]") + .prop("disabled", true); + } else { + $("select[name=entity]") + .prop("disabled", false); + } + }); + }); + '; } - print "
    '.$langs->trans("ColorUser").''; - print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', 'usercolorconfig', 1, '', 'hideifnotset'); + print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', null, 1, '', 'hideifnotset'); print '
    '.$langs->trans("THM").'
    '; + $text=$langs->trans("THM"); + print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm'); + print ''; print ''; print '
    '.$langs->trans("TJM").'
    '; + $text=$langs->trans("TJM"); + print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classthm'); + print ''; print ''; print '
    '.$langs->trans("ColorUser").''; - print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', 'usercolorconfig', 1, '', 'hideifnotset'); + print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', null, 1, '', 'hideifnotset'); print '
    '; diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index ccaf6687da9..23356c08889 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -65,7 +65,7 @@ $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css') llxHeader('',$langs->trans("ListOfUsers"). ' ('.$langs->trans("HierarchicView").')','','',0,0,$arrayofjs,$arrayofcss); -print_fiche_titre($langs->trans("ListOfUsers"). ' ('.$langs->trans("HierarchicView").')', '
    '); +print load_fiche_titre($langs->trans("ListOfUsers"). ' ('.$langs->trans("HierarchicView").')', '
    '); diff --git a/htdocs/user/home.php b/htdocs/user/home.php index ba3b3c15586..22b6d54adda 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -53,7 +53,7 @@ $fuserstatic = new User($db); llxHeader(); -print_fiche_titre($langs->trans("MenuUsersAndGroups")); +print load_fiche_titre($langs->trans("MenuUsersAndGroups")); //print '
    '; diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 9c8060e7275..f2e53987ed8 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -84,7 +84,7 @@ llxHeader('',$langs->trans("ListOfUsers")); $buttonviewhierarchy='
    '; -print_fiche_titre($langs->trans("ListOfUsers"), $buttonviewhierarchy); +print load_fiche_titre($langs->trans("ListOfUsers"), $buttonviewhierarchy); $sql = "SELECT u.rowid, u.lastname, u.firstname, u.admin, u.fk_soc, u.login, u.email, u.gender,"; $sql.= " u.datec,"; diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index 2d1ac2f7464..0ee41812c29 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -168,7 +168,7 @@ if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') print "
    \n"; // Affichage attributs LDAP -print_titre($langs->trans("LDAPInformationsForThisUser")); +print load_fiche_titre($langs->trans("LDAPInformationsForThisUser")); print '
    '; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 5355a0f74fc..9e67a1015c7 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -93,7 +93,18 @@ if ($action == 'update' && ($caneditfield || ! empty($user->admin))) if ($_POST["check_MAIN_THEME"]=="on") $tabparam["MAIN_THEME"]=$_POST["main_theme"]; else $tabparam["MAIN_THEME"]=''; - $tabparam["MAIN_SEARCHFORM_CONTACT"]=$_POST["main_searchform_contact"]; + $val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())))); + if ($val == '') $tabparam['THEME_ELDY_TOPMENU_BACK1']=''; + else $tabparam['THEME_ELDY_TOPMENU_BACK1']=join(',',colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())); + + $val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())))); + if ($val == '') $tabparam['THEME_ELDY_BACKTITLE1']=''; + else $tabparam['THEME_ELDY_BACKTITLE1']=join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())); + + if (GETPOST('check_THEME_ELDY_USE_HOVER') == 'on') $tabparam["THEME_ELDY_USE_HOVER"]=1; + else $tabparam["THEME_ELDY_USE_HOVER"]=0; + + $tabparam["MAIN_SEARCHFORM_CONTACT"]=$_POST["main_searchform_contact"]; $tabparam["MAIN_SEARCHFORM_SOCIETE"]=$_POST["main_searchform_societe"]; $tabparam["MAIN_SEARCHFORM_PRODUITSERVICE"]=$_POST["main_searchform_produitservice"]; @@ -152,17 +163,48 @@ print '

    '; if ($action == 'edit') { - print ''; + if (! empty($conf->use_javascript_ajax)) + {/* + print '';*/ + } + if (! empty($conf->use_javascript_ajax)) + { + print ''; + } + clearstatcache(); $var=true; @@ -197,7 +239,7 @@ if ($action == 'edit') print '

    '; // Theme - show_theme($object,(($user->admin || empty($dolibarr_main_demo))?1:0),true); + show_theme($object, (($user->admin || empty($dolibarr_main_demo))?1:0), true); dol_fiche_end(); diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index d611e1f5c70..f0b9db050b4 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -412,8 +412,8 @@ if ($result) print ' '; } - $perm_libelle=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id)!=("PermissionAdvanced".$obj->id))?$langs->trans("PermissionAdvanced".$obj->id):(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$obj->libelle)); - print ''.$perm_libelle. ''; + $permlabel=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id)!=("PermissionAdvanced".$obj->id))?$langs->trans("PermissionAdvanced".$obj->id):(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$langs->trans($obj->libelle))); + print ''.$permlabel. ''; print ''."\n"; diff --git a/htdocs/webservices/admin/webservices.php b/htdocs/webservices/admin/webservices.php index 3f97eda6574..97b19ab8ff7 100644 --- a/htdocs/webservices/admin/webservices.php +++ b/htdocs/webservices/admin/webservices.php @@ -63,7 +63,7 @@ if ($actionsave) llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("WebServicesSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("WebServicesSetup"),$linkback,'title_setup'); print $langs->trans("WebServicesDesc")."
    \n"; print "
    \n"; diff --git a/scripts/company/sync_contacts_dolibarr2ldap.php b/scripts/company/sync_contacts_dolibarr2ldap.php index 8a582a77f74..2223cd1ca8f 100755 --- a/scripts/company/sync_contacts_dolibarr2ldap.php +++ b/scripts/company/sync_contacts_dolibarr2ldap.php @@ -34,12 +34,6 @@ if (substr($sapi_type, 0, 3) == 'cgi') { exit(-1); } -if (! isset($argv[1]) || ! $argv[1]) { - print "Usage: $script_file now\n"; - exit(-1); -} -$now=$argv[1]; - require_once($path."../../htdocs/master.inc.php"); require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); @@ -49,6 +43,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"); // Global variables $version=DOL_VERSION; $error=0; +$confirmed=0; /* @@ -59,6 +54,18 @@ $error=0; print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; dol_syslog($script_file." launched with arg ".join(',',$argv)); +if (! isset($argv[1]) || ! $argv[1]) { + print "Usage: $script_file now [-y]\n"; + exit(-1); +} + +foreach($argv as $key => $val) +{ + if (preg_match('/-y$/',$val,$reg)) $confirmed=1; +} + +$now=$argv[1]; + print "Mails sending disabled (useless in batch mode)\n"; $conf->global->MAIN_DISABLE_ALL_MAILS=1; // On bloque les mails print "\n"; @@ -77,12 +84,16 @@ print "login=".$conf->global->LDAP_ADMIN_DN."\n"; print "pass=".preg_replace('/./i','*',$conf->global->LDAP_ADMIN_PASS)."\n"; print "DN target=".$conf->global->LDAP_CONTACT_DN."\n"; print "\n"; -print "Press a key to confirm...\n"; -$input = trim(fgets(STDIN)); -print "Warning, this operation may result in data loss if it failed.\n"; -print "Be sure to have a backup of your LDAP database (With OpenLDAP: slapcat > save.ldif).\n"; -print "Hit Enter to continue or CTRL+C to stop...\n"; -$input = trim(fgets(STDIN)); + +if (! $confirmed) +{ + print "Press a key to confirm...\n"; + $input = trim(fgets(STDIN)); + print "Warning, this operation may result in data loss if it failed.\n"; + print "Be sure to have a backup of your LDAP database (With OpenLDAP: slapcat > save.ldif).\n"; + print "Hit Enter to continue or CTRL+C to stop...\n"; + $input = trim(fgets(STDIN)); +} /* if (! $conf->global->LDAP_CONTACT_ACTIVE) diff --git a/scripts/members/sync_members_dolibarr2ldap.php b/scripts/members/sync_members_dolibarr2ldap.php index 13529561a80..bfe16330b79 100755 --- a/scripts/members/sync_members_dolibarr2ldap.php +++ b/scripts/members/sync_members_dolibarr2ldap.php @@ -43,7 +43,7 @@ $langs->load("main"); // Global variables $version=DOL_VERSION; $error=0; - +$confirmed=0; /* @@ -55,9 +55,15 @@ print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; dol_syslog($script_file." launched with arg ".join(',',$argv)); if (! isset($argv[1]) || ! $argv[1]) { - print "Usage: $script_file now\n"; + print "Usage: $script_file now [-y]\n"; exit(-1); } + +foreach($argv as $key => $val) +{ + if (preg_match('/-y$/',$val,$reg)) $confirmed=1; +} + $now=$argv[1]; print "Mails sending disabled (useless in batch mode)\n"; @@ -78,13 +84,16 @@ print "login=".$conf->global->LDAP_ADMIN_DN."\n"; print "pass=".preg_replace('/./i','*',$conf->global->LDAP_ADMIN_PASS)."\n"; print "DN target=".$conf->global->LDAP_MEMBER_DN."\n"; print "\n"; -print "Press a key to confirm...\n"; -$input = trim(fgets(STDIN)); -print "Warning, this operation may result in data loss if it failed.\n"; -print "Be sure to have a backup of your LDAP database (With OpenLDAP: slapcat > save.ldif).\n"; -print "Hit Enter to continue or CTRL+C to stop...\n"; -$input = trim(fgets(STDIN)); +if (! $confirmed) +{ + print "Press a key to confirm...\n"; + $input = trim(fgets(STDIN)); + print "Warning, this operation may result in data loss if it failed.\n"; + print "Be sure to have a backup of your LDAP database (With OpenLDAP: slapcat > save.ldif).\n"; + print "Hit Enter to continue or CTRL+C to stop...\n"; + $input = trim(fgets(STDIN)); +} /* if (! $conf->global->LDAP_MEMBER_ACTIVE) diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php index 4ed5e36f696..cf18a75e508 100755 --- a/scripts/members/sync_members_ldap2dolibarr.php +++ b/scripts/members/sync_members_ldap2dolibarr.php @@ -48,7 +48,7 @@ $langs->load("errors"); $version=DOL_VERSION; $error=0; $forcecommit=0; - +$confirmed=0; /* @@ -94,7 +94,7 @@ $required_fields=array_unique(array_values(array_filter($required_fields, "dolVa if (! isset($argv[2]) || ! is_numeric($argv[2])) { - print "Usage: $script_file (nocommitiferror|commitiferror) id_member_type [--server=ldapserverhost]\n"; + print "Usage: $script_file (nocommitiferror|commitiferror) id_member_type [--server=ldapserverhost] [-y]\n"; exit(-1); } @@ -103,6 +103,7 @@ foreach($argv as $key => $val) { if ($val == 'commitiferror') $forcecommit=1; if (preg_match('/--server=([^\s]+)$/',$val,$reg)) $conf->global->LDAP_SERVER_HOST=$reg[1]; + if (preg_match('/-y$/',$val,$reg)) $confirmed=1; } print "Mails sending disabled (useless in batch mode)\n"; @@ -139,9 +140,11 @@ if ($typeid <= 0) } -print "Hit Enter to continue or CTRL+C to stop...\n"; -$input = trim(fgets(STDIN)); - +if (! $confirmed) +{ + print "Hit Enter to continue or CTRL+C to stop...\n"; + $input = trim(fgets(STDIN)); +} // Load table of correspondence of countries $hashlib2rowid=array(); diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php index 93406276ead..b48a4af974e 100755 --- a/scripts/user/sync_groups_ldap2dolibarr.php +++ b/scripts/user/sync_groups_ldap2dolibarr.php @@ -49,6 +49,7 @@ $langs->load("errors"); $version=DOL_VERSION; $error=0; $forcecommit=0; +$confirmed=0; /* @@ -73,7 +74,7 @@ $required_fields=array_unique(array_values(array_filter($required_fields, "dolVa if (! isset($argv[1])) { //print "Usage: $script_file (nocommitiferror|commitiferror) [id_group]\n"; - print "Usage: $script_file (nocommitiferror|commitiferror) [--server=ldapserverhost] [--excludeuser=user1,user2...]\n"; + print "Usage: $script_file (nocommitiferror|commitiferror) [--server=ldapserverhost] [--excludeuser=user1,user2...] [-y]\n"; exit(-1); } @@ -82,6 +83,7 @@ foreach($argv as $key => $val) if ($val == 'commitiferror') $forcecommit=1; if (preg_match('/--server=([^\s]+)$/',$val,$reg)) $conf->global->LDAP_SERVER_HOST=$reg[1]; if (preg_match('/--excludeuser=([^\s]+)$/',$val,$reg)) $excludeuser=explode(',',$reg[1]); + if (preg_match('/-y$/',$val,$reg)) $confirmed=1; } print "Mails sending disabled (useless in batch mode)\n"; @@ -105,9 +107,11 @@ print "commitiferror=".$forcecommit."\n"; print "Mapped LDAP fields=".join(',',$required_fields)."\n"; print "\n"; -print "Hit Enter to continue or CTRL+C to stop...\n"; -$input = trim(fgets(STDIN)); - +if (! $confirmed) +{ + print "Hit Enter to continue or CTRL+C to stop...\n"; + $input = trim(fgets(STDIN)); +} if (empty($conf->global->LDAP_GROUP_DN)) { diff --git a/scripts/user/sync_users_ldap2dolibarr.php b/scripts/user/sync_users_ldap2dolibarr.php index 296db5ec0b2..53a48cc03ca 100755 --- a/scripts/user/sync_users_ldap2dolibarr.php +++ b/scripts/user/sync_users_ldap2dolibarr.php @@ -48,7 +48,7 @@ $version=DOL_VERSION; $error=0; $forcecommit=0; $excludeuser=array(); - +$confirmed=0; /* * Main @@ -85,7 +85,7 @@ $required_fields = array( $required_fields=array_unique(array_values(array_filter($required_fields, "dolValidElement"))); if (! isset($argv[1])) { - print "Usage: $script_file (nocommitiferror|commitiferror) [--server=ldapserverhost] [--excludeuser=user1,user2...]\n"; + print "Usage: $script_file (nocommitiferror|commitiferror) [--server=ldapserverhost] [--excludeuser=user1,user2...] [-y]\n"; exit(-1); } @@ -94,6 +94,7 @@ foreach($argv as $key => $val) if ($val == 'commitiferror') $forcecommit=1; if (preg_match('/--server=([^\s]+)$/',$val,$reg)) $conf->global->LDAP_SERVER_HOST=$reg[1]; if (preg_match('/--excludeuser=([^\s]+)$/',$val,$reg)) $excludeuser=explode(',',$reg[1]); + if (preg_match('/-y$/',$val,$reg)) $confirmed=1; } print "Mails sending disabled (useless in batch mode)\n"; @@ -118,9 +119,11 @@ print "excludeuser=".join(',',$excludeuser)."\n"; print "Mapped LDAP fields=".join(',',$required_fields)."\n"; print "\n"; -print "Hit Enter to continue or CTRL+C to stop...\n"; -$input = trim(fgets(STDIN)); - +if (! $confirmed) +{ + print "Hit Enter to continue or CTRL+C to stop...\n"; + $input = trim(fgets(STDIN)); +} if (empty($conf->global->LDAP_USER_DN)) { diff --git a/test/phpunit/AdherentTest.php b/test/phpunit/AdherentTest.php index 3a19b195b7c..42b4ff7cf7f 100644 --- a/test/phpunit/AdherentTest.php +++ b/test/phpunit/AdherentTest.php @@ -266,7 +266,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase $result=$localobject->update_note($localobject->note,'_private'); print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0); - $result=$localobject->update_note_public($localobject->note,'_public'); + $result=$localobject->update_note($localobject->note,'_public'); print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0); diff --git a/test/phpunit/ContactTest.php b/test/phpunit/ContactTest.php index b638cdc776b..d9532417fc2 100755 --- a/test/phpunit/ContactTest.php +++ b/test/phpunit/ContactTest.php @@ -189,7 +189,7 @@ class ContactTest extends PHPUnit_Framework_TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject->oldcopy=dol_clone($localobject); + $localobject->oldcopy = clone $localobject; $localobject->note_private='New private note after update'; $localobject->note_public='New public note after update'; @@ -211,14 +211,14 @@ class ContactTest extends PHPUnit_Framework_TestCase $result=$localobject->update($localobject->id,$user); print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0, 'Contact::update error'); - - $result=$localobject->update_note($localobject->note_private,'_private'); - print __METHOD__." id=".$localobject->id." result=".$result."\n"; - $this->assertLessThan($result, 0, 'Contact::update_note error'); - - $result=$localobject->update_note_public($localobject->note_public); + + $result=$localobject->update_note($localobject->note_private,'_private'); print __METHOD__." id=".$localobject->id." result=".$result."\n"; - $this->assertLessThan($result, 0, 'Contact::update_note_public error'); + $this->assertLessThan($result, 0, 'Contact::update_note (private) error'); + + $result=$localobject->update_note($localobject->note_public, '_public'); + print __METHOD__." id=".$localobject->id." result=".$result."\n"; + $this->assertLessThan($result, 0, 'Contact::update_note (public) error'); $newobject=new Contact($this->savdb); $result=$newobject->fetch($localobject->id); diff --git a/test/phpunit/HolidayTest.php b/test/phpunit/HolidayTest.php index 36556fd9281..a04646a8a14 100644 --- a/test/phpunit/HolidayTest.php +++ b/test/phpunit/HolidayTest.php @@ -183,7 +183,7 @@ class HolidayTest extends PHPUnit_Framework_TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject->oldcopy=dol_clone($localobject); + $localobject->oldcopy = clone $localobject; $localobject->note_private='New private note after update'; $localobject->note_public='New public note after update'; @@ -208,11 +208,11 @@ class HolidayTest extends PHPUnit_Framework_TestCase $result=$localobject->update_note($localobject->note_private,'_private'); print __METHOD__." id=".$localobject->id." result=".$result."\n"; - $this->assertLessThan($result, 0, 'Holiday::update_note error'); - - $result=$localobject->update_note_public($localobject->note_public); - print __METHOD__." id=".$localobject->id." result=".$result."\n"; - $this->assertLessThan($result, 0, 'Holiday::update_note_public error'); + $this->assertLessThan($result, 0, 'Holiday::update_note (private) error'); + + $result=$localobject->update_note($localobject->note_public, '_public'); + print __METHOD__." id=".$localobject->id." result=".$result."\n"; + $this->assertLessThan($result, 0, 'Holiday::update_note (public) error'); $newobject=new Holiday($this->savdb); diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 8bcfb247365..24b868b743e 100755 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -211,13 +211,13 @@ class SocieteTest extends PHPUnit_Framework_TestCase print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0); - $result=$localobject->update_note($localobject->note_private,'_private'); - print __METHOD__." id=".$localobject->id." result=".$result."\n"; - $this->assertLessThan($result, 0, 'Holiday::update_note_private error'); + $result=$localobject->update_note($localobject->note_private,'_private'); + print __METHOD__." id=".$localobject->id." result=".$result."\n"; + $this->assertLessThan($result, 0, 'Holiday::update_note (private) error'); - $result=$localobject->update_note_public($localobject->note_public); - print __METHOD__." id=".$localobject->id." result=".$result."\n"; - $this->assertLessThan($result, 0, 'Holiday::update_note_public error'); + $result=$localobject->update_note($localobject->note_public, '_public'); + print __METHOD__." id=".$localobject->id." result=".$result."\n"; + $this->assertLessThan($result, 0, 'Holiday::update_note (public) error'); $newobject=new Societe($this->savdb); $result=$newobject->fetch($localobject->id); diff --git a/test/raven/raven b/test/raven/raven new file mode 120000 index 00000000000..9080498f871 --- /dev/null +++ b/test/raven/raven @@ -0,0 +1 @@ +../raven/raven/bin/raven \ No newline at end of file