mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 17:02:34 +01:00
Compare commits
138 Commits
3.5.2
...
3.6.beta2_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a51e18a5a7 | ||
|
|
872e764c94 | ||
|
|
2a6b2a4540 | ||
|
|
b11ef37c58 | ||
|
|
1df758320d | ||
|
|
f34aadef3d | ||
|
|
23e951ff2a | ||
|
|
a63d085181 | ||
|
|
8840e28bc0 | ||
|
|
07bc933110 | ||
|
|
649fdd72dc | ||
|
|
df35b4d2ea | ||
|
|
2771c506e9 | ||
|
|
31ea7117f0 | ||
|
|
d1ee20dd42 | ||
|
|
dc94b6e1bf | ||
|
|
1d01377dab | ||
|
|
9c398b14c5 | ||
|
|
20ec1e6ac8 | ||
|
|
300e430024 | ||
|
|
95d8161dc1 | ||
|
|
fa733c8ba4 | ||
|
|
7acecadc79 | ||
|
|
2c05146778 | ||
|
|
43bf9ba890 | ||
|
|
a705d4e333 | ||
|
|
0d121de1a6 | ||
|
|
9cc74c36d2 | ||
|
|
77c09d887a | ||
|
|
b2f299f5e4 | ||
|
|
603c28dcdd | ||
|
|
3481884731 | ||
|
|
13da9c368e | ||
|
|
2a16a562d9 | ||
|
|
87b9d0412c | ||
|
|
4a7e9e4d0b | ||
|
|
c82ff0a146 | ||
|
|
4a89446162 | ||
|
|
b146dcad31 | ||
|
|
366bd64c4f | ||
|
|
753ef28168 | ||
|
|
ff1eb983c8 | ||
|
|
5a5c858578 | ||
|
|
56415400eb | ||
|
|
5709179cf0 | ||
|
|
0e13ded641 | ||
|
|
c2370f352b | ||
|
|
ab337c7485 | ||
|
|
6bfff8b2b8 | ||
|
|
39b0ed7fc2 | ||
|
|
fa212438c6 | ||
|
|
9ae9f062ac | ||
|
|
4fc818d329 | ||
|
|
6cebccf1b4 | ||
|
|
d7d8eba6b1 | ||
|
|
8ab09d63a2 | ||
|
|
98bd78a277 | ||
|
|
bd061f4245 | ||
|
|
f13c146908 | ||
|
|
5f0c4dbe48 | ||
|
|
3f08664eee | ||
|
|
6f4a390780 | ||
|
|
bafc53ad95 | ||
|
|
bcfc9f8aa1 | ||
|
|
09b5971b7d | ||
|
|
847fa3827b | ||
|
|
7b05944530 | ||
|
|
7bb24969d8 | ||
|
|
3fd7e18c08 | ||
|
|
1724fd2f89 | ||
|
|
4e41b721fb | ||
|
|
f855709cf4 | ||
|
|
a627dd9ae8 | ||
|
|
62537cf5a4 | ||
|
|
2aa2f896c6 | ||
|
|
02e0fac79f | ||
|
|
c0af0c3b52 | ||
|
|
1b25fdc323 | ||
|
|
70cccc907a | ||
|
|
4bf86508a5 | ||
|
|
ef2a8a0b09 | ||
|
|
ac27884b88 | ||
|
|
16b3ec8923 | ||
|
|
1bc3558307 | ||
|
|
0e2497e710 | ||
|
|
e35008b534 | ||
|
|
3f22bc7009 | ||
|
|
e6708a5072 | ||
|
|
fb7f08b33a | ||
|
|
8681079fa7 | ||
|
|
7fe5389adf | ||
|
|
182dd774b6 | ||
|
|
fe43d10c79 | ||
|
|
3abede630b | ||
|
|
5a6ad1ef5f | ||
|
|
5e12459ad1 | ||
|
|
460b5296ba | ||
|
|
7a452519e7 | ||
|
|
503924fbbc | ||
|
|
53a1e7d09a | ||
|
|
1c6c79811d | ||
|
|
215ff25ddd | ||
|
|
647d431857 | ||
|
|
4da918ce01 | ||
|
|
959b104b78 | ||
|
|
c4291c228e | ||
|
|
948e0bf753 | ||
|
|
5740c22a41 | ||
|
|
011fe254a6 | ||
|
|
a04cd99090 | ||
|
|
c9ebe7729f | ||
|
|
e8308e795d | ||
|
|
697f68c9a9 | ||
|
|
03f9f0bada | ||
|
|
08301e3478 | ||
|
|
f34a9983bd | ||
|
|
50c10d3d1e | ||
|
|
4599b22cb5 | ||
|
|
7216b2a843 | ||
|
|
876a35d1a1 | ||
|
|
2637305065 | ||
|
|
a4126fae66 | ||
|
|
4fa472518e | ||
|
|
bd8cdd337a | ||
|
|
537ada96a8 | ||
|
|
4ecfa1d6e0 | ||
|
|
6968304641 | ||
|
|
c54d9d9171 | ||
|
|
0b1bfa56e2 | ||
|
|
889ed4a49c | ||
|
|
31d56d6c38 | ||
|
|
34948ef2d6 | ||
|
|
78ce40f23b | ||
|
|
8564691896 | ||
|
|
b1fd8cf503 | ||
|
|
2213128531 | ||
|
|
ee3592c976 | ||
|
|
2ffe4f589e |
37
ChangeLog
37
ChangeLog
@@ -2,6 +2,41 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
***** ChangeLog for 3.5.3 compared to 3.5.2 *****
|
||||
Fix: Error on field accountancy code for export profile of invoices.
|
||||
Fix: [ bug #1351 ] VIES verification link broken.
|
||||
Fix: [ bug #1352 ] Removing a shipping does not remove the delivery.
|
||||
Fix: Option MAIN_INVERT_SENDER_RECIPIENT broken with typhon template.
|
||||
Fix: Can disable features with PHPEXCEL (no DLSF compatible).
|
||||
Fix: Can disable features with CKEDITOR.
|
||||
Fix: Pb of records not correctly cleaned when module marge is
|
||||
uninstalled (conflict between 'margin' and 'margins').
|
||||
Fix: [ bug #1341 ] Lastname not added by file or direct input in mass e-mailing.
|
||||
Fix: [ bug #1357 ] Invoice creator state not printed in generated invoice documents.
|
||||
Fix: Suppliers invoice mask fails using {tttt} in numbering.
|
||||
Fix: [ bug #1350 ] pdf template name for typhon was not correctly set when enabling module.
|
||||
Fix: Navigation on notes for shipments was not working.
|
||||
Fix: [ bug #1353 ] Email notifications, wrong URL.
|
||||
Fix: [ bug #1362 ] Note is not saved.
|
||||
Fix: tr/td balance.
|
||||
Fix: [ bug #1360 ] note indicator for member tab.
|
||||
Fix: Nb of notes and doc not visible onto tasks.
|
||||
Fix: [ bug #1372 ] Margin calculation does not work in proposals.
|
||||
Fix: [ bug #1381 ] PHP Warning when listing stock transactions page.
|
||||
Fix: [ bug #1367 ] "Show invoice" link after a POS sell throws an error.
|
||||
Fix: TCPDF error file not found in member card generation.
|
||||
Fix: [ bug #1380 ] Customer invoices are not grouped in company results report.
|
||||
Fix: [ bug #1393 ] PHP Warning when creating a supplier invoice.
|
||||
Fix: [ bug #1399 ] [pgsql] Silent warning when setting a propal as "facturée" in propal.php
|
||||
Fix: When number reach 9999 with default numbering module, next number
|
||||
will be 10000 instead of 0000 and error.
|
||||
Fix: element page on project give wrong href link.
|
||||
Fix: [ bug #1397 ] Filter by supplier orders with status Draft does not filter.
|
||||
Fix: [ bug #1388 ] Wrong date when invoicing several orders.
|
||||
Fix: [ bug #1411 ] Unable to set an expedition note if invoices module is not enabled.
|
||||
Fix: [ bug #1407 ] Rouget pdf overlapped when using tracking number and public notes.
|
||||
Fix: [ bug #1405 ] Rouget PDF expedition incorrect when two expeditions under the same commande
|
||||
|
||||
***** ChangeLog for 3.5.2 compared to 3.5.1 *****
|
||||
Fix: Can't add user for a task.
|
||||
Fix: Autoselect of warehouse if there is only one warehouse.
|
||||
@@ -45,7 +80,6 @@ Fix: Translation of number for pt_PT.
|
||||
Fix: Error on ajax_constantonoff function.
|
||||
Fix: [ bug #1323 ] problème pour générer un odt depuis les taches dans projet.
|
||||
Fix: Can not make withdrawals
|
||||
|
||||
|
||||
***** ChangeLog for 3.5.1 compared to 3.5.0 *****
|
||||
Fix: Do not report trigger errors twice.
|
||||
@@ -89,6 +123,7 @@ Fix: [ bug #1306 ] Fatal error when adding an external calendar.
|
||||
New: Added es_CL language
|
||||
Fix: Margin tabs bad data show
|
||||
Fix: [ bug #1318 ] Problem with enter key when adding an existing product to a customer invoice.
|
||||
Fix: [ bug #1410 ] Add customer order line asks for required Unit Price but doesn't interrupt the creation of the line
|
||||
|
||||
***** ChangeLog for 3.5 compared to 3.4.* *****
|
||||
For users:
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
dolibarr (3.5.3-3) unstable; urgency=low
|
||||
|
||||
[ Laurent Destailleur (eldy) ]
|
||||
* New upstream release.
|
||||
|
||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Fri, 2 May 2014 12:00:00 +0100
|
||||
|
||||
dolibarr (3.5.2-3) unstable; urgency=low
|
||||
|
||||
[ Laurent Destailleur (eldy) ]
|
||||
|
||||
@@ -36,7 +36,7 @@ $force_install_lockinstall='444';
|
||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
||||
//$force_dolibarr_lib_PHPEXCEL_PATH='';
|
||||
//$force_dolibarr_lib_PHPEXCEL_PATH=''; // Use '' or 'disabled'
|
||||
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor'; // Use '/javascript/ckeditor' or 'disabled'
|
||||
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
||||
//$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
|
||||
|
||||
@@ -31,7 +31,7 @@ PROJECT_NAME = dolibarr
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 3.5.2
|
||||
PROJECT_NUMBER = 3.5.3
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
; ----- Change this -----
|
||||
AppName=DoliWamp
|
||||
; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
|
||||
AppVerName=DoliWamp-3.5.2
|
||||
AppVerName=DoliWamp-3.5.3
|
||||
; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
|
||||
OutputBaseFilename=DoliWamp-3.5.2
|
||||
OutputBaseFilename=DoliWamp-3.5.3
|
||||
; ----- End of change
|
||||
;OutputManifestFile=build\doliwampbuild.log
|
||||
; Define full path from which all relative path are defined
|
||||
|
||||
@@ -603,7 +603,7 @@ upload_max_filesize = 2M
|
||||
;;;;;;;;;;;;;;;;;;
|
||||
|
||||
; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
|
||||
allow_url_fopen = Off
|
||||
allow_url_fopen = On
|
||||
|
||||
; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
|
||||
allow_url_include = Off
|
||||
|
||||
@@ -509,12 +509,13 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages
|
||||
|
||||
print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n";
|
||||
$cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMETGZ.tgz\" $FILENAMETGZ";
|
||||
$cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMETGZ.tgz\" $FILENAMETGZ";
|
||||
print "$cmd\n";
|
||||
$ret=`$cmd`;
|
||||
|
||||
# Move to final dir
|
||||
print "Move $FILENAMETGZ.tgz to $NEWDESTI/$FILENAMETGZ.tgz\n";
|
||||
$ret=`mv "$FILENAMETGZ.tgz" "$NEWDESTI/$FILENAMETGZ.tgz"`;
|
||||
print "Move $BUILDROOT/$FILENAMETGZ.tgz to $NEWDESTI/$FILENAMETGZ.tgz\n";
|
||||
$ret=`mv "$BUILDROOT/$FILENAMETGZ.tgz" "$NEWDESTI/$FILENAMETGZ.tgz"`;
|
||||
next;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@ beta version of Dolibarr, step by step.
|
||||
- Create a branch (x.y).
|
||||
|
||||
- Run makepack-dolibarr.pl to generate all packages.
|
||||
- Move build files into www.dolibarr.org web site (/home/dolibarr/wwwroot/files).
|
||||
- Move build files into www.dolibarr.org web site
|
||||
(/home/dolibarr/wwwroot/files/lastbuild).
|
||||
|
||||
- Post a news on dolibarr.org/dolibarr.fr
|
||||
- Send mail on mailings-list
|
||||
@@ -36,17 +37,17 @@ complete release of Dolibarr, step by step.
|
||||
- Update version number with x.y.z in build/debian/changelog
|
||||
- Update version number with x.y.z in build/exe/doliwamp/doliwamp.iss
|
||||
- Update version number with x.y.z in build/rpm/*.spec
|
||||
- Update PAD files.
|
||||
- Commit all changes.
|
||||
- Add a Tag (x.y.z)
|
||||
|
||||
- Build Dolibarr and DoliWamp packages with makepack-dolibarr.pl
|
||||
- Check content of built packages.
|
||||
- Move build files (tgz+exe+deb+rpm...), ChangeLog and PAD files
|
||||
into www.dolibarr.org web site (/home/dolibarr/wwwroot/files).
|
||||
- Edit symbolic links in directory "/home/dolibarr/wwwroot/files" on server to
|
||||
point to new files (used by PAD descriptor).
|
||||
- Upload files dolibarr.*.tgz and doliwamp.*.exe on sourceforge.
|
||||
- Move build files into www.dolibarr.org web site
|
||||
(/home/dolibarr/wwwroot/files/stable).
|
||||
- Run makepack-dolibarr.pl again with option to publish files on
|
||||
sourceforge.
|
||||
- Edit symbolic links in directory "/home/dolibarr/wwwroot/files/stable/xxx"
|
||||
on server to point to new files (used by some web sites).
|
||||
|
||||
- Send mail on mailings-list
|
||||
- Send news on OpenSource web sites (if major beta or release)
|
||||
|
||||
@@ -30,7 +30,7 @@ return "Regis Houssin";
|
||||
# script_dolibarr_versions()
|
||||
sub script_dolibarr_versions
|
||||
{
|
||||
return ( "3.5.2", "3.5.1", "3.5.0", "3.4.1", "3.4.0", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" );
|
||||
return ( "3.5.3", "3.5.2", "3.5.1", "3.5.0", "3.4.1", "3.4.0", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" );
|
||||
}
|
||||
|
||||
sub script_dolibarr_category
|
||||
|
||||
@@ -331,6 +331,9 @@ fi
|
||||
|
||||
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
|
||||
%changelog
|
||||
* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3
|
||||
- Upstream release
|
||||
|
||||
* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3
|
||||
- Upstream release
|
||||
|
||||
|
||||
@@ -567,6 +567,9 @@ fi
|
||||
|
||||
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
|
||||
%changelog
|
||||
* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3
|
||||
- Upstream release
|
||||
|
||||
* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3
|
||||
- Upstream release
|
||||
|
||||
|
||||
@@ -336,6 +336,9 @@ fi
|
||||
|
||||
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
|
||||
%changelog
|
||||
* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3
|
||||
- Upstream release
|
||||
|
||||
* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3
|
||||
- Upstream release
|
||||
|
||||
|
||||
@@ -347,6 +347,9 @@ fi
|
||||
|
||||
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
|
||||
%changelog
|
||||
* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3
|
||||
- Upstream release
|
||||
|
||||
* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3
|
||||
- Upstream release
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,7 +19,7 @@
|
||||
/**
|
||||
* \file htdocs/adherents/note.php
|
||||
* \ingroup member
|
||||
* \brief Fiche de notes sur un adherent
|
||||
* \brief Tabe for note of a member
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
|
||||
@@ -63,7 +63,7 @@ if ($actionsave)
|
||||
// Save agendas
|
||||
while ($i <= $MAXAGENDA)
|
||||
{
|
||||
$name=trim(GETPOST('agenda_ext_name'.$i),'alpha');
|
||||
$name=trim(GETPOST('agenda_ext_name'.$i,'alpha'));
|
||||
$src=trim(GETPOST('agenda_ext_src'.$i,'alpha'));
|
||||
$color=trim(GETPOST('agenda_ext_color'.$i,'alpha'));
|
||||
if ($color=='-1') $color='';
|
||||
@@ -76,7 +76,7 @@ if ($actionsave)
|
||||
break;
|
||||
}
|
||||
|
||||
//print 'color='.$color;
|
||||
//print '-name='.$name.'-color='.$color;
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NAME'.$i,$name,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_SRC'.$i,$src,'chaine',0,'',$conf->entity);
|
||||
|
||||
@@ -57,7 +57,7 @@ if ($action == 'add')
|
||||
|
||||
$db->begin();
|
||||
|
||||
// Initialize distinctfkuser with all already existing values of fk_user (user that use a personalized view of boxes for pos)
|
||||
// Initialize distinct fkuser with all already existing values of fk_user (user that use a personalized view of boxes for page "pos")
|
||||
$distinctfkuser=array();
|
||||
if (! $error)
|
||||
{
|
||||
@@ -85,14 +85,31 @@ if ($action == 'add')
|
||||
}
|
||||
}
|
||||
|
||||
$distinctfkuser['0']='0'; // Add entry for fk_user = 0. We must use string as key and val
|
||||
|
||||
foreach($distinctfkuser as $fk_user)
|
||||
{
|
||||
if (! $error && $fk_user != 0) // We will add fk_user = 0 later.
|
||||
if (! $error && $fk_user != '')
|
||||
{
|
||||
$nbboxonleft=$nbboxonright=0;
|
||||
$sql = "SELECT box_order FROM ".MAIN_DB_PREFIX."boxes WHERE position = ".GETPOST("pos","alpha")." AND fk_user = ".$fk_user." AND entity = ".$conf->entity;
|
||||
dol_syslog("boxes.php activate box sql=".$sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while($obj = $db->fetch_object($resql))
|
||||
{
|
||||
$boxorder=$obj->box_order;
|
||||
if (preg_match('/A/',$boxorder)) $nbboxonleft++;
|
||||
if (preg_match('/B/',$boxorder)) $nbboxonright++;
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (";
|
||||
$sql.= "box_id, position, box_order, fk_user, entity";
|
||||
$sql.= ") values (";
|
||||
$sql.= GETPOST("boxid","int").", ".GETPOST("pos","alpha").", 'A01', ".$fk_user.", ".$conf->entity;
|
||||
$sql.= GETPOST("boxid","int").", ".GETPOST("pos","alpha").", '".(($nbboxonleft > $nbboxonright) ? 'B01' : 'A01')."', ".$fk_user.", ".$conf->entity;
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog("boxes.php activate box sql=".$sql);
|
||||
@@ -105,24 +122,6 @@ if ($action == 'add')
|
||||
}
|
||||
}
|
||||
|
||||
// If value 0 was not included, we add it.
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (";
|
||||
$sql.= "box_id, position, box_order, fk_user, entity";
|
||||
$sql.= ") values (";
|
||||
$sql.= GETPOST("boxid","int").", ".GETPOST("pos","alpha").", 'A01', 0, ".$conf->entity;
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog("boxes.php activate box sql=".$sql);
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
$errmesg=$db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
header("Location: boxes.php");
|
||||
|
||||
@@ -522,9 +522,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$result = $db->query($sql);
|
||||
if ($result) // Add is ok
|
||||
{
|
||||
//$oldid=$id;
|
||||
//$_POST=array('id'=>$oldid); // Clean $_POST array, we keep only
|
||||
//$_GET["id"]=$_POST["id"]; // Force affichage dictionnaire en cours d'edition
|
||||
$_POST=array('id'=>$id); // Clean $_POST array, we keep only
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -416,24 +416,27 @@ if ($mode != 'marketplace')
|
||||
print "</td>\n";
|
||||
|
||||
// Activate/Disable and Setup (2 columns)
|
||||
if (! empty($conf->global->$const_name))
|
||||
if (! empty($conf->global->$const_name)) // If module is activated
|
||||
{
|
||||
$disableSetup = 0;
|
||||
|
||||
print '<td align="center" valign="middle">';
|
||||
|
||||
if (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1)))
|
||||
if (! empty($objMod->disabled))
|
||||
{
|
||||
print $langs->trans("Disabled");
|
||||
}
|
||||
else if (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1)))
|
||||
{
|
||||
print $langs->trans("Required");
|
||||
if (! empty($conf->multicompany->enabled) && $user->entity) $disableSetup++;
|
||||
print '</td>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="modules.php?id='.$objMod->numero.'&action=reset&value=' . $modName . '&mode=' . $mode . '">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print '</a></td>'."\n";
|
||||
print '</a>';
|
||||
}
|
||||
print '</td>'."\n";
|
||||
|
||||
if (! empty($objMod->config_page_url) && !$disableSetup)
|
||||
{
|
||||
@@ -478,19 +481,25 @@ if ($mode != 'marketplace')
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
else // Module not activated
|
||||
{
|
||||
print '<td align="center" valign="middle">';
|
||||
|
||||
if (! empty($objMod->always_enabled))
|
||||
if (! empty($objMod->always_enabled))
|
||||
{
|
||||
// Ne devrait pas arriver.
|
||||
}
|
||||
|
||||
// Module non actif
|
||||
print '<a href="modules.php?id='.$objMod->numero.'&action=set&value=' . $modName . '&mode=' . $mode . '">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print "</a></td>\n <td> </td>\n";
|
||||
else if (! empty($objMod->disabled))
|
||||
{
|
||||
print $langs->trans("Disabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Module non actif
|
||||
print '<a href="modules.php?id='.$objMod->numero.'&action=set&value=' . $modName . '&mode=' . $mode . '">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print "</a>\n";
|
||||
}
|
||||
print "</td>\n <td> </td>";
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -85,18 +85,35 @@ print '</br>';
|
||||
// OPCode cache
|
||||
print '<br>';
|
||||
print '<strong>'.$langs->trans("OPCodeCache").'</strong>: ';
|
||||
$test1=function_exists('xcache_info');
|
||||
if ($test1)
|
||||
$foundcache=0;
|
||||
$test=function_exists('xcache_info');
|
||||
if (! $foundcache && $test)
|
||||
{
|
||||
$foundcache++;
|
||||
print img_picto('','tick.png').' '.$langs->trans("XCacheInstalled");
|
||||
print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xcache.php'.'">Xcache admin page</a>';
|
||||
}
|
||||
else
|
||||
$test=function_exists('eaccelerator_info');
|
||||
if (! $foundcache && $test)
|
||||
{
|
||||
$test2=function_exists('eaccelerator_info');
|
||||
if ($test2) print img_picto('','tick.png').' '.$langs->trans("EAcceleratorInstalled");
|
||||
else print $langs->trans("NoOPCodeCacheFound");
|
||||
$foundcache++;
|
||||
print img_picto('','tick.png').' '.$langs->trans("EAcceleratorInstalled");
|
||||
}
|
||||
$test=function_exists('apc_cache_info');
|
||||
if (! $foundcache && $test)
|
||||
{
|
||||
//var_dump(apc_cache_info());
|
||||
if (ini_get('apc.enabled'))
|
||||
{
|
||||
$foundcache++;
|
||||
print img_picto('','tick.png').' '.$langs->trans("APCInstalled");
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_picto('','warning').' '.$langs->trans("APCCacheInstalledButDisabled");
|
||||
}
|
||||
}
|
||||
if (! $foundcache) print $langs->trans("NoOPCodeCacheFound");
|
||||
print '<br>';
|
||||
|
||||
// HTTPCacheStaticResources
|
||||
|
||||
@@ -46,7 +46,7 @@ class Categorie
|
||||
var $label;
|
||||
var $description;
|
||||
var $socid;
|
||||
var $type; // 0=Product, 1=Supplier, 2=Customer/Prospect, 3=Member
|
||||
var $type; // 0=Product, 1=Supplier, 2=Customer/Prospect, 3=Member, 4=Contact
|
||||
var $import_key;
|
||||
|
||||
var $cats=array(); // Tableau en memoire des categories
|
||||
@@ -296,7 +296,7 @@ class Categorie
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."categorie";
|
||||
$sql.= " SET fk_parent = ".$this->fk_parent;
|
||||
$sql.= " SET fk_parent = ".$this->fk_parent;
|
||||
$sql.= " WHERE fk_parent = ".$this->id;
|
||||
|
||||
if (!$this->db->query($sql))
|
||||
|
||||
@@ -56,14 +56,13 @@ class ICal
|
||||
{
|
||||
$this->file = $file;
|
||||
$file_text='';
|
||||
|
||||
|
||||
$tmparray=file($file);
|
||||
if (is_array($tmparray))
|
||||
{
|
||||
$file_text = join("", $tmparray); //load file
|
||||
$file_text = preg_replace("/[\r\n]{1,} ([:;])/","\\1",$file_text);
|
||||
$file_text = preg_replace("/[\r\n]{1,} /","",$file_text);
|
||||
}
|
||||
|
||||
return $file_text; // return all text
|
||||
}
|
||||
|
||||
@@ -115,6 +114,7 @@ class ICal
|
||||
{
|
||||
// get Key and Value VCALENDAR:Begin -> Key = VCALENDAR, Value = begin
|
||||
list($key, $value) = $this->retun_key_value($text);
|
||||
//var_dump($text.' -> '.$key.' - '.$value);
|
||||
|
||||
switch ($text) // search special string
|
||||
{
|
||||
@@ -165,6 +165,8 @@ class ICal
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($this->cal);
|
||||
return $this->cal;
|
||||
}
|
||||
|
||||
@@ -236,6 +238,7 @@ class ICal
|
||||
*/
|
||||
function retun_key_value($text)
|
||||
{
|
||||
/*
|
||||
preg_match("/([^:]+)[:]([\w\W]+)/", $text, $matches);
|
||||
|
||||
if (empty($matches))
|
||||
@@ -246,8 +249,8 @@ class ICal
|
||||
{
|
||||
$matches = array_splice($matches, 1, 2);
|
||||
return $matches;
|
||||
}
|
||||
|
||||
}*/
|
||||
return explode(':',$text,2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -146,9 +146,11 @@ if (empty($conf->global->AGENDA_DISABLE_EXT) && $conf->global->AGENDA_EXT_NB > 0
|
||||
$source='AGENDA_EXT_SRC'.$i;
|
||||
$name='AGENDA_EXT_NAME'.$i;
|
||||
$color='AGENDA_EXT_COLOR'.$i;
|
||||
$buggedfile='AGENDA_EXT_BUGGEDFILE'.$i;
|
||||
if (! empty($conf->global->$source) && ! empty($conf->global->$name))
|
||||
{
|
||||
$listofextcals[]=array('src'=>$conf->global->$source,'name'=>$conf->global->$name,'color'=>$conf->global->$color);
|
||||
// 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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -527,9 +529,11 @@ if (count($listofextcals))
|
||||
$url=$extcal['src']; // Example: https://www.google.com/calendar/ical/eldy10%40gmail.com/private-cde92aa7d7e0ef6110010a821a2aaeb/basic.ics
|
||||
$namecal = $extcal['name'];
|
||||
$colorcal = $extcal['color'];
|
||||
//print "url=".$url." namecal=".$namecal." colorcal=".$colorcal;
|
||||
$buggedfile = $extcal['buggedfile'];
|
||||
//print "url=".$url." namecal=".$namecal." colorcal=".$colorcal." buggedfile=".$buggedfile;
|
||||
$ical=new ICal();
|
||||
$ical->parse($url);
|
||||
|
||||
// After this $ical->cal['VEVENT'] contains array of events, $ical->cal['DAYLIGHT'] contains daylight info, $ical->cal['STANDARD'] contains non daylight info, ...
|
||||
//var_dump($ical->cal); exit;
|
||||
$icalevents=array();
|
||||
@@ -643,6 +647,8 @@ if (count($listofextcals))
|
||||
// Loop on each entry into cal file to know if entry is qualified and add an ActionComm into $eventarray
|
||||
foreach($icalevents as $icalevent)
|
||||
{
|
||||
//var_dump($icalevent);
|
||||
|
||||
//print $icalevent['SUMMARY'].'->'.var_dump($icalevent).'<br>';exit;
|
||||
if (! empty($icalevent['RRULE'])) continue; // We found a repeatable event. It was already split into unitary events, so we discard general rule.
|
||||
|
||||
@@ -659,12 +665,36 @@ if (count($listofextcals))
|
||||
$event->fulldayevent=true;
|
||||
$addevent=true;
|
||||
}
|
||||
elseif (!is_array($icalevent['DTSTART'])) // not fullday event (DTSTART is not array)
|
||||
elseif (!is_array($icalevent['DTSTART'])) // not fullday event (DTSTART is not array. It is a value like '19700101T000000Z' for 00:00 in greenwitch)
|
||||
{
|
||||
$datestart=$icalevent['DTSTART'];
|
||||
$dateend=$icalevent['DTEND'];
|
||||
$addevent=true;
|
||||
}
|
||||
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'];
|
||||
// $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
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
// $buggedfile is set to uselocalandtzdaylight if conf->global->AGENDA_EXT_BUGGEDFILEx = 'uselocalandtzdaylight' (for example with bluemind)
|
||||
if ($buggedfile === 'uselocalandtzdaylight') // unixtime is a local date that does take daylight into account, TZID is +2 for example for 'Europe/Paris' in summer
|
||||
{
|
||||
$localtzs = new DateTimeZone(preg_replace('/"/','',$icalevent['DTSTART']['TZID']));
|
||||
$localtze = new DateTimeZone(preg_replace('/"/','',$icalevent['DTEND']['TZID']));
|
||||
$localdts = new DateTime(dol_print_date($datestart,'dayrfc','gmt'), $localtzs);
|
||||
$localdte = new DateTime(dol_print_date($dateend,'dayrfc','gmt'), $localtze);
|
||||
$tmps=-1*$localtzs->getOffset($localdts);
|
||||
$tmpe=-1*$localtze->getOffset($localdte);
|
||||
$datestart+=$tmps;
|
||||
$dateend+=$tmpe;
|
||||
//var_dump($datestart);
|
||||
}
|
||||
$addevent=true;
|
||||
}
|
||||
|
||||
if ($addevent)
|
||||
{
|
||||
|
||||
@@ -1368,7 +1368,7 @@ if ($action == 'create')
|
||||
|
||||
// Date
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td colspan="2">';
|
||||
$form->select_date('','','','','',"addprop");
|
||||
$form->select_date('','','','','',"addprop",1,1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Validaty duration
|
||||
@@ -1407,8 +1407,7 @@ if ($action == 'create')
|
||||
}
|
||||
else
|
||||
{
|
||||
$datepropal=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
|
||||
$form->select_date($datepropal,'liv_','','','',"addprop");
|
||||
$form->select_date(-1,'liv_','','','',"addprop",1,1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@@ -1462,7 +1461,7 @@ if ($action == 'create')
|
||||
print '<input type="hidden" name="createmode" value="empty">';
|
||||
}
|
||||
|
||||
print '<table>';
|
||||
if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE) || ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print '<table>';
|
||||
if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE))
|
||||
{
|
||||
// For backward compatibility
|
||||
@@ -1533,14 +1532,11 @@ if ($action == 'create')
|
||||
print '<td><input type="text" size="2" name="remise'.$i.'" value="'.$soc->remise_percent.'">%</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE) || ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print '</table><br>';
|
||||
|
||||
$langs->load("bills");
|
||||
print '<center>';
|
||||
|
||||
@@ -1702,7 +1702,7 @@ class Propal extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||
$sql.= " SET fk_statut = ".$statut.", note_private = '".$this->db->escape($note)."', date_cloture=".$this->db->idate($now).", fk_user_cloture=".$user->id;
|
||||
$sql.= " SET fk_statut = ".$statut.", note_private = '".$this->db->escape($note)."', date_cloture='".$this->db->idate($now)."', fk_user_cloture=".$user->id;
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
@@ -210,6 +210,15 @@ if ($search_user > 0)
|
||||
|
||||
|
||||
$sql.= ' ORDER BY '.$sortfield.' '.$sortorder.', p.ref DESC';
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->plimit($limit + 1,$offset);
|
||||
$result=$db->query($sql);
|
||||
|
||||
@@ -236,7 +245,7 @@ if ($result)
|
||||
if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht;
|
||||
if ($search_author) $param.='&search_author='.$search_author;
|
||||
if ($search_town) $param.='&search_town='.$search_town;
|
||||
print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->nom:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num);
|
||||
print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->nom:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||
|
||||
// Lignes des champs de filtre
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
@@ -1362,7 +1362,7 @@ class Commande extends CommonOrder
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
|
||||
$this->fetch_optionals($this->id,$extralabels);
|
||||
|
||||
$this->db->free();
|
||||
$this->db->free($result);
|
||||
|
||||
/*
|
||||
* Lines
|
||||
@@ -2516,7 +2516,7 @@ class Commande extends CommonOrder
|
||||
$this->nbtodo=$this->nbtodolate=0;
|
||||
$clause = " WHERE";
|
||||
|
||||
$sql = "SELECT c.rowid, c.date_creation as datec, c.fk_statut";
|
||||
$sql = "SELECT c.rowid, c.date_creation as datec, 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)
|
||||
{
|
||||
@@ -2535,7 +2535,9 @@ class Commande extends CommonOrder
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$this->nbtodo++;
|
||||
if ($obj->fk_statut != 3 && $this->db->jdate($obj->datec) < ($now - $conf->commande->client->warning_delay)) $this->nbtodolate++;
|
||||
|
||||
$date_to_test = empty($obj->delivery_date) ? $obj->datec : $obj->delivery_date;
|
||||
if ($obj->fk_statut != 3 && $this->db->jdate($date_to_test) < ($now - $conf->commande->client->warning_delay)) $this->nbtodolate++;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -568,7 +568,7 @@ else if ($action == 'setnote_private' && $user->rights->commande->creer)
|
||||
else if ($action == 'addline' && $user->rights->commande->creer)
|
||||
{
|
||||
$langs->load('errors');
|
||||
$error = false;
|
||||
$error = 0;
|
||||
|
||||
// Set if we used free entry or predefined product
|
||||
if (GETPOST('addline_libre')
|
||||
|
||||
@@ -200,6 +200,15 @@ if ($search_user > 0)
|
||||
}
|
||||
|
||||
$sql.= ' ORDER BY '.$sortfield.' '.$sortorder;
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->plimit($limit + 1,$offset);
|
||||
|
||||
//print $sql;
|
||||
@@ -245,7 +254,7 @@ if ($resql)
|
||||
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num);
|
||||
print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||
$i = 0;
|
||||
|
||||
// Lignes des champs de filtre
|
||||
|
||||
@@ -413,7 +413,7 @@ if ($action == 'create' && empty($mesgs))
|
||||
|
||||
// Date invoice
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td colspan="2">';
|
||||
$html->select_date(0,'','','','',"add",1,1);
|
||||
$html->select_date('','','','','',"add",1,1);
|
||||
print '</td></tr>';
|
||||
// Payment term
|
||||
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">';
|
||||
|
||||
@@ -1855,21 +1855,25 @@ else if ($action == 'builddoc') // En get ou en post
|
||||
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
|
||||
if (GETPOST('fk_bank')) $object->fk_bank=GETPOST('fk_bank');
|
||||
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang='';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
|
||||
if (! empty($newlang))
|
||||
// object->modelpdf can be empty when we are using odt template by default and builddoc is called by POS module (invoice was just created and no template ODT template was selected).
|
||||
if (! empty($object->modelpdf))
|
||||
{
|
||||
$outputlangs = new Translate("",$conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$result=facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result <= 0)
|
||||
{
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang='';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
|
||||
if (! empty($newlang))
|
||||
{
|
||||
$outputlangs = new Translate("",$conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$result=facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result <= 0)
|
||||
{
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -231,6 +231,15 @@ $sql.= ' ORDER BY ';
|
||||
$listfield=explode(',',$sortfield);
|
||||
foreach ($listfield as $key => $value) $sql.= $listfield[$key].' '.$sortorder.',';
|
||||
$sql.= ' f.rowid DESC ';
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->plimit($limit+1,$offset);
|
||||
//print $sql;
|
||||
|
||||
@@ -255,7 +264,7 @@ if ($resql)
|
||||
if ($search_user > 0) $param.='&search_user=' .$search_user;
|
||||
if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht;
|
||||
if ($search_montant_ttc) $param.='&search_montant_ttc='.$search_montant_ttc;
|
||||
print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->nom:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num);
|
||||
print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->nom:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||
|
||||
$i = 0;
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
|
||||
@@ -428,7 +428,7 @@ if ($object->id > 0)
|
||||
|
||||
/*
|
||||
* Withdrawal request
|
||||
*/
|
||||
*/
|
||||
|
||||
$sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande";
|
||||
$sql .= " , pfd.date_traite as date_traite";
|
||||
@@ -462,12 +462,13 @@ if ($object->id > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#">'.$langs->trans("MakeWithdrawRequest").'</a>';
|
||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#">'.$langs->trans("MakeWithdrawRequest").'</a>';
|
||||
if ($num == 0) print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("AlreadyPayed")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
|
||||
else print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("RequestAlreadyDone")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
|
||||
}
|
||||
|
||||
print "</div><br>\n";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -28,7 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$chid=isset($_GET["id"])?$_GET["id"]:$_POST["id"];
|
||||
$chid=GETPOST("id");
|
||||
$action=GETPOST('action');
|
||||
$amounts = array();
|
||||
|
||||
// Security check
|
||||
@@ -43,7 +44,7 @@ if ($user->societe_id > 0)
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($_POST["action"] == 'add_payment')
|
||||
if ($action == 'add_payment')
|
||||
{
|
||||
$error=0;
|
||||
|
||||
@@ -171,7 +172,8 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
print '<form name="add_payment" action="'.$_SERVER['PHP_SELF'].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="id" value="'.$charge->id.'">';
|
||||
print '<input type="hidden" name="id" value="'.$chid.'">';
|
||||
print '<input type="hidden" name="chid" value="'.$chid.'">';
|
||||
print '<input type="hidden" name="action" value="add_payment">';
|
||||
|
||||
print '<table cellspacing="0" class="border" width="100%" cellpadding="2">';
|
||||
@@ -184,7 +186,6 @@ if ($_GET["action"] == 'create')
|
||||
print '<tr><td>'.$langs->trans("Period")."</td><td colspan=\"2\">".dol_print_date($charge->periode,'day')."</td></tr>\n";
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$charge->lib."</td></tr>\n";
|
||||
print '<tr><td>'.$langs->trans("DateDue")."</td><td colspan=\"2\">".dol_print_date($charge->date_ech,'day')."</td></tr>\n";
|
||||
|
||||
print '<tr><td>'.$langs->trans("AmountTTC")."</td><td colspan=\"2\"><b>".price($charge->amount).'</b> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
$sql = "SELECT sum(p.amount) as total";
|
||||
@@ -198,43 +199,50 @@ if ($_GET["action"] == 'create')
|
||||
$db->free();
|
||||
}
|
||||
print '<tr><td>'.$langs->trans("AlreadyPaid").'</td><td colspan="2"><b>'.price($sumpaid).'</b> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print "<tr><td valign=\"top\">".$langs->trans("RemainderToPay")."</td><td colspan=\"3\"><b>".price($total - $sumpaid).'</b> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print "<tr><td valign=\"top\">".$langs->trans("RemainderToPay").'</td><td colspan="2"><b>'.price($total - $sumpaid).'</b> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
print "<tr class=\"liste_titre\"><td colspan=\"3\">".$langs->trans("Payment").'</td>';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print "<input type=\"hidden\" name=\"chid\" value=\"$chid\">";
|
||||
print "<td colspan=\"3\">".$langs->trans("Payment").'</td>';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td colspan="2">';
|
||||
$datepaye = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
||||
$datepayment=empty($conf->global->MAIN_AUTOFILL_DATE)?(empty($_POST["remonth"])?-1:$datepaye):0;
|
||||
$form->select_date($datepayment,'','','','',"add_payment",1,1);
|
||||
print "</td>";
|
||||
print '<td>'.$langs->trans("Comments").'</td></tr>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td colspan="2">';
|
||||
$form->select_types_paiements(isset($_POST["paiementtype"])?$_POST["paiementtype"]:$charge->paiementtype, "paiementtype");
|
||||
print "</td>\n";
|
||||
|
||||
print '<td rowspan="3" valign="top"><textarea name="comment" wrap="soft" cols="40" rows="'.ROWS_3.'"></textarea></td></tr>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">'.$langs->trans('AccountToDebit').'</td>';
|
||||
print '<td>';
|
||||
print '<td colspan="2">';
|
||||
$form->select_comptes(isset($_POST["accountid"])?$_POST["accountid"]:$charge->accountid, "accountid", 0, '',1); // Show opend bank account list
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Numero');
|
||||
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
|
||||
print "<td><input name=\"num_paiement\" type=\"text\"></td></tr>\n";
|
||||
print '<td colspan="2"><input name="num_paiement" type="text"></td></tr>'."\n";
|
||||
|
||||
print '<tr>';
|
||||
print '<td valign="top">'.$langs->trans("Comments").'</td>';
|
||||
print '<td valign="top" colspan="2"><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_3.'"></textarea></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
/*
|
||||
* Autres charges impayees
|
||||
*/
|
||||
$num = 1;
|
||||
$i = 0;
|
||||
print '<tr><td colspan="3">';
|
||||
|
||||
print '<table class="nobordernopadding" width="100%">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
//print '<td>'.$langs->trans("SocialContribution").'</td>';
|
||||
print '<td align="left">'.$langs->trans("DateDue").'</td>';
|
||||
@@ -303,17 +311,6 @@ if ($_GET["action"] == 'create')
|
||||
print '<td align="center"> </td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</table></td></tr>\n";
|
||||
// }
|
||||
// $db->free();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// print $sql ."<br>".$db->error();
|
||||
// }
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ else
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
$sql.= " GROUP BY s.nom, s.rowid";
|
||||
$sql.= " ORDER BY s.nom";
|
||||
$sql.= " ORDER BY s.nom, s.rowid";
|
||||
|
||||
dol_syslog("get customer invoices sql=".$sql);
|
||||
$result = $db->query($sql);
|
||||
@@ -281,11 +281,11 @@ print '</tr>';
|
||||
|
||||
|
||||
/*
|
||||
* Frais, factures fournisseurs.
|
||||
* Suppliers invoices
|
||||
*/
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
$sql = "SELECT s.nom, s.rowid as socid, date_format(f.datef,'%Y-%m') as dm, sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc";
|
||||
$sql = "SELECT s.nom, s.rowid as socid, sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||
@@ -299,7 +299,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT s.nom, s.rowid as socid, date_format(p.datep,'%Y-%m') as dm, sum(pf.amount) as amount_ttc";
|
||||
$sql = "SELECT s.nom, 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";
|
||||
@@ -312,7 +312,7 @@ else
|
||||
}
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
$sql .= " GROUP BY s.nom, s.rowid, dm";
|
||||
$sql .= " GROUP BY s.nom, s.rowid";
|
||||
$sql .= " ORDER BY s.nom, s.rowid";
|
||||
|
||||
print '<tr><td colspan="4">'.$langs->trans("SuppliersInvoices").'</td></tr>';
|
||||
@@ -372,11 +372,11 @@ print '</tr>';
|
||||
* Charges sociales non deductibles
|
||||
*/
|
||||
|
||||
print '<tr><td colspan="4">'.$langs->trans("SocialContributions").'</td></tr>';
|
||||
print '<tr><td colspan="4">'.$langs->trans("SocialContributions").' ('.$langs->trans("Type").' 0)</td></tr>';
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
$sql = "SELECT c.libelle as nom, sum(cs.amount) as amount";
|
||||
$sql = "SELECT c.id, c.libelle as nom, sum(cs.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql.= " WHERE cs.fk_type = c.id";
|
||||
@@ -386,7 +386,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT c.libelle as nom, sum(p.amount) as amount";
|
||||
$sql = "SELECT c.id, c.libelle as nom, sum(p.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p";
|
||||
@@ -397,8 +397,8 @@ else
|
||||
$sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
$sql.= " AND cs.entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY c.libelle";
|
||||
$sql.= " ORDER BY c.libelle";
|
||||
$sql.= " GROUP BY c.libelle, c.id";
|
||||
$sql.= " ORDER BY c.libelle, c.id";
|
||||
|
||||
dol_syslog("get social contributions deductible=0 sql=".$sql);
|
||||
$result=$db->query($sql);
|
||||
@@ -446,11 +446,11 @@ print '</tr>';
|
||||
* Charges sociales deductibles
|
||||
*/
|
||||
|
||||
print '<tr><td colspan="4">'.$langs->trans("SocialContributions").'</td></tr>';
|
||||
print '<tr><td colspan="4">'.$langs->trans("SocialContributions").' ('.$langs->trans("Type").' 1)</td></tr>';
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
$sql = "SELECT c.libelle as nom, sum(cs.amount) as amount";
|
||||
$sql = "SELECT c.id, c.libelle as nom, sum(cs.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql.= " WHERE cs.fk_type = c.id";
|
||||
@@ -458,12 +458,12 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
if (! empty($date_start) && ! empty($date_end))
|
||||
$sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND cs.entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY c.libelle";
|
||||
$sql.= " ORDER BY c.libelle";
|
||||
$sql.= " GROUP BY c.libelle, c.id";
|
||||
$sql.= " ORDER BY c.libelle, c.id";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT c.libelle as nom, sum(p.amount) as amount";
|
||||
$sql = "SELECT c.id, c.libelle as nom, sum(p.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p";
|
||||
@@ -473,8 +473,8 @@ else
|
||||
if (! empty($date_start) && ! empty($date_end))
|
||||
$sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND cs.entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY c.libelle";
|
||||
$sql.= " ORDER BY c.libelle";
|
||||
$sql.= " GROUP BY c.libelle, c.id";
|
||||
$sql.= " ORDER BY c.libelle, c.id";
|
||||
}
|
||||
|
||||
dol_syslog("get social contributions deductible=1 sql=".$sql);
|
||||
@@ -541,6 +541,7 @@ if ($mysoc->tva_assuj == 'franchise') // Non assujeti
|
||||
/*
|
||||
* VAT
|
||||
*/
|
||||
|
||||
print '<tr><td colspan="4">'.$langs->trans("VAT").'</td></tr>';
|
||||
$subtotal_ht = 0;
|
||||
$subtotal_ttc = 0;
|
||||
@@ -564,12 +565,15 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
|
||||
dol_syslog("get vat to pay sql=".$sql);
|
||||
$result=$db->query($sql);
|
||||
if ($result) {
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$var=false;
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
while ($i < $num) {
|
||||
if ($num)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$amount -= $obj->amount;
|
||||
@@ -606,12 +610,15 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
|
||||
dol_syslog("get vat received back sql=".$sql);
|
||||
$result=$db->query($sql);
|
||||
if ($result) {
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$var=true;
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
while ($i < $num) {
|
||||
if ($num)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$amount += $obj->amount;
|
||||
@@ -634,7 +641,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
}
|
||||
else
|
||||
{
|
||||
// TVA reellement deja payee
|
||||
// VAT really already paid
|
||||
$amount=0;
|
||||
$sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
|
||||
@@ -675,7 +682,7 @@ else
|
||||
print "<td align=\"right\">".price($amount)."</td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
// TVA recuperee
|
||||
// VAT really received
|
||||
$amount=0;
|
||||
$sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -256,7 +256,7 @@ if ($id > 0)
|
||||
|
||||
$head=tax_prepare_head($object);
|
||||
|
||||
print dol_get_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill');
|
||||
dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill');
|
||||
|
||||
// Confirmation de la suppression de la charge
|
||||
if ($action == 'paid')
|
||||
@@ -303,8 +303,8 @@ if ($id > 0)
|
||||
print '<td rowspan="'.$rowspan.'" valign="top">';
|
||||
|
||||
/*
|
||||
* Paiements
|
||||
*/
|
||||
* Payments
|
||||
*/
|
||||
$sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,";
|
||||
$sql.= "c.libelle as paiement_type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p";
|
||||
@@ -324,8 +324,12 @@ if ($id > 0)
|
||||
$i = 0; $total = 0;
|
||||
echo '<table class="nobordernopadding" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Payments").'</td><td>'.$langs->trans("Type").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Amount").'</td><td> </td></tr>';
|
||||
print '<td>'.$langs->trans("RefPayment").'</td>';
|
||||
print '<td>'.$langs->trans("Date").'</td>';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Amount").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
@@ -333,15 +337,15 @@ if ($id > 0)
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").'</a> ';
|
||||
print dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.'</a></td>';
|
||||
print '<td>'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
print "<td>".$objp->paiement_type.' '.$objp->num_paiement."</td>\n";
|
||||
print '<td align="right">'.price($objp->amount)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td>\n";
|
||||
print '<td align="right">'.price($objp->amount)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td>\n";
|
||||
print "</tr>";
|
||||
$totalpaye += $objp->amount;
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
if ($object->paye == 0)
|
||||
{
|
||||
print "<tr><td colspan=\"2\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\"><b>".price($totalpaye)."</b></td><td> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||
@@ -363,7 +367,7 @@ if ($id > 0)
|
||||
|
||||
print "</tr>";
|
||||
|
||||
// Period end date
|
||||
// Period end date
|
||||
print "<tr><td>".$langs->trans("PeriodEndDate")."</td>";
|
||||
print "<td>";
|
||||
if ($action == 'edit')
|
||||
@@ -375,7 +379,7 @@ if ($id > 0)
|
||||
print dol_print_date($object->periode,"day");
|
||||
}
|
||||
print "</td></tr>";
|
||||
|
||||
|
||||
// Due date
|
||||
if ($action == 'edit')
|
||||
{
|
||||
@@ -406,7 +410,7 @@ if ($id > 0)
|
||||
|
||||
if ($action == 'edit') print "</form>\n";
|
||||
|
||||
print '</div>';
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -1151,11 +1151,11 @@ class Contrat extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
// Calcul du total TTC et de la TVA pour la ligne a partir de
|
||||
// qty, pu, remise_percent et txtva
|
||||
// qty, pu, remise_percent et tvatx
|
||||
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
|
||||
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
|
||||
|
||||
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$mysoc);
|
||||
$localtaxes_type=getLocalTaxesFromRate($tvatx,0,$mysoc);
|
||||
|
||||
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtaxtx1, $txlocaltaxtx2, 0, $price_base_type, $info_bits, 1, '', $localtaxes_type);
|
||||
$total_ht = $tabprice[0];
|
||||
|
||||
@@ -118,7 +118,10 @@ abstract class CommonDocGenerator
|
||||
'mycompany_idprof5'=>$mysoc->idprof5,
|
||||
'mycompany_idprof6'=>$mysoc->idprof6,
|
||||
'mycompany_vatnumber'=>$mysoc->tva_intra,
|
||||
'mycompany_note'=>$mysoc->note
|
||||
// Only private not exists for "mysoc"
|
||||
'mycompany_note'=>$mysoc->note_private
|
||||
//'mycompany_note_private'=>$mysoc->note_private,
|
||||
//'mycompany_note_public'=>$mysoc->note_public,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ abstract class CommonObject
|
||||
|
||||
public $array_options=array();
|
||||
|
||||
public $linkedObjectsIds;
|
||||
public $linkedObjects;
|
||||
public $linkedObjectsIds; // Loaded by ->fetchObjectLinked
|
||||
public $linkedObjects; // Loaded by ->fetchObjectLinked
|
||||
|
||||
// No constructor as it is an abstract class
|
||||
|
||||
@@ -1691,7 +1691,7 @@ abstract class CommonObject
|
||||
* @param string $sourcetype Object source type
|
||||
* @param int $targetid Object target id
|
||||
* @param string $targettype Object target type
|
||||
* @param string $clause OR, AND clause
|
||||
* @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided
|
||||
* @return void
|
||||
*/
|
||||
function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR')
|
||||
@@ -2359,7 +2359,8 @@ abstract class CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Function to check if an object is used by others
|
||||
* Function to check if an object is used by others.
|
||||
* Check is done into this->childtables. There is no check into llx_element_element.
|
||||
*
|
||||
* @param int $id Id of object
|
||||
* @return int <0 if KO, 0 if not used, >0 if already used
|
||||
|
||||
@@ -424,16 +424,17 @@ class FormOther
|
||||
/**
|
||||
* Return list of project and tasks
|
||||
*
|
||||
* @param int $selectedtask Pre-selected task
|
||||
* @param int $projectid Project id
|
||||
* @param string $htmlname Name of html select
|
||||
* @param int $modeproject 1 to restrict on projects owned by user
|
||||
* @param int $modetask 1 to restrict on tasks associated to user
|
||||
* @param int $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists
|
||||
* @param int $useempty 0=Allow empty values
|
||||
* @param int $selectedtask Pre-selected task
|
||||
* @param int $projectid Project id
|
||||
* @param string $htmlname Name of html select
|
||||
* @param int $modeproject 1 to restrict on projects owned by user
|
||||
* @param int $modetask 1 to restrict on tasks associated to user
|
||||
* @param int $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists
|
||||
* @param int $useempty 0=Allow empty values
|
||||
* @param int $disablechildoftaskid 1=Disable task that are child of the provided task id
|
||||
* @return void
|
||||
*/
|
||||
function selectProjectTasks($selectedtask='', $projectid=0, $htmlname='task_parent', $modeproject=0, $modetask=0, $mode=0, $useempty=0)
|
||||
function selectProjectTasks($selectedtask='', $projectid=0, $htmlname='task_parent', $modeproject=0, $modetask=0, $mode=0, $useempty=0, $disablechildoftaskid=0)
|
||||
{
|
||||
global $user, $langs;
|
||||
|
||||
@@ -448,7 +449,7 @@ class FormOther
|
||||
if ($useempty) print '<option value="0"> </option>';
|
||||
$j=0;
|
||||
$level=0;
|
||||
$this->_pLineSelect($j, 0, $tasksarray, $level, $selectedtask, $projectid);
|
||||
$this->_pLineSelect($j, 0, $tasksarray, $level, $selectedtask, $projectid, $disablechildoftaskid);
|
||||
print '</select>';
|
||||
}
|
||||
else
|
||||
@@ -458,17 +459,18 @@ class FormOther
|
||||
}
|
||||
|
||||
/**
|
||||
* Write all lines of a project (if parent = 0)
|
||||
* Write lines of a project (all lines of a project if parent = 0)
|
||||
*
|
||||
* @param int &$inc Cursor counter
|
||||
* @param int $parent Id parent
|
||||
* @param Object $lines Line object
|
||||
* @param int $parent Id of parent task we want to see
|
||||
* @param array $lines Array of task lines
|
||||
* @param int $level Level
|
||||
* @param int $selectedtask Id selected task
|
||||
* @param int $selectedproject Id selected project
|
||||
* @param int $disablechildoftaskid 1=Disable task that are child of the provided task id
|
||||
* @return void
|
||||
*/
|
||||
private function _pLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0)
|
||||
private function _pLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0, $disablechildoftaskid=0)
|
||||
{
|
||||
global $langs, $user, $conf;
|
||||
|
||||
@@ -477,16 +479,16 @@ class FormOther
|
||||
$numlines=count($lines);
|
||||
for ($i = 0 ; $i < $numlines ; $i++)
|
||||
{
|
||||
if ($lines[$i]->fk_parent == $parent)
|
||||
if ($lines[$i]->fk_parent == $parent)
|
||||
{
|
||||
$var = !$var;
|
||||
|
||||
//var_dump($selectedtask."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id);
|
||||
//var_dump($selectedproject."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id); // $lines[$i]->id may be empty if project has no lines
|
||||
|
||||
// Break on a new project
|
||||
if ($parent == 0)
|
||||
if ($parent == 0) // We are on a task at first level
|
||||
{
|
||||
if ($lines[$i]->fk_project != $lastprojectid)
|
||||
if ($lines[$i]->fk_project != $lastprojectid) // Break found on project
|
||||
{
|
||||
if ($i > 0 && $conf->browser->firefox) print '<option value="0" disabled="disabled">----------</option>';
|
||||
print '<option value="'.$lines[$i]->fk_project.'_0"';
|
||||
@@ -509,11 +511,22 @@ class FormOther
|
||||
}
|
||||
}
|
||||
|
||||
$newdisablechildoftaskid=$disablechildoftaskid;
|
||||
|
||||
// Print task
|
||||
if ($lines[$i]->id >= 0)
|
||||
if (isset($lines[$i]->id)) // We use isset because $lines[$i]->id may be null if project has no task and are on root project (tasks may be caught by a left join). We enter here only if '0' or >0
|
||||
{
|
||||
// Check if we must disable entry
|
||||
$disabled=0;
|
||||
if ($disablechildoftaskid && (($lines[$i]->id == $disablechildoftaskid || $lines[$i]->fk_parent == $disablechildoftaskid)))
|
||||
{
|
||||
$disabled++;
|
||||
if ($lines[$i]->fk_parent == $disablechildoftaskid) $newdisablechildoftaskid=$lines[$i]->id; // If task is child of a disabled parent, we will propagate id to disable next child too
|
||||
}
|
||||
|
||||
print '<option value="'.$lines[$i]->fk_project.'_'.$lines[$i]->id.'"';
|
||||
if (($lines[$i]->id == $selectedtask) || ($lines[$i]->fk_project.'_'.$lines[$i]->id == $selectedtask)) print ' selected="selected"';
|
||||
if ($disabled) print ' disabled="disabled"';
|
||||
print '>';
|
||||
print $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||
if (empty($lines[$i]->public))
|
||||
@@ -534,7 +547,7 @@ class FormOther
|
||||
}
|
||||
|
||||
$level++;
|
||||
if ($lines[$i]->id) $this->_pLineSelect($inc, $lines[$i]->id, $lines, $level, $selectedtask, $selectedproject);
|
||||
if ($lines[$i]->id) $this->_pLineSelect($inc, $lines[$i]->id, $lines, $level, $selectedtask, $selectedproject, $newdisablechildoftaskid);
|
||||
$level--;
|
||||
}
|
||||
}
|
||||
@@ -1042,7 +1055,7 @@ class FormOther
|
||||
$emptybox->showBox(array(),array());
|
||||
}
|
||||
print "</div>\n";
|
||||
print "<!-- End box container -->\n";
|
||||
print "<!-- End box left container -->\n";
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
@@ -1073,7 +1086,7 @@ class FormOther
|
||||
$emptybox->showBox(array(),array());
|
||||
}
|
||||
print "</div>\n";
|
||||
print "<!-- End box container -->\n";
|
||||
print "<!-- End box right container -->\n";
|
||||
|
||||
print '</div></div>';
|
||||
print "\n";
|
||||
|
||||
@@ -194,6 +194,7 @@ class FormProjets
|
||||
if (!empty($this->societe->id)) {
|
||||
$sql.= " AND fk_soc=".$this->societe->id;
|
||||
}
|
||||
$sql.= ' AND entity='.$conf->entity;
|
||||
$sql.= " ORDER BY ref DESC";
|
||||
|
||||
dol_syslog(get_class($this).'::select_element sql='.$sql,LOG_DEBUG);
|
||||
|
||||
@@ -133,7 +133,7 @@ class Notify
|
||||
|
||||
$langs->load("other");
|
||||
|
||||
dol_syslog("Notify::send action=$action, socid=$socid, texte=$texte, objet_type=$objet_type, objet_id=$objet_id, file=$file");
|
||||
dol_syslog(get_class($this)."::send action=".$action.", socid=".$socid.", texte=".$texte.", objet_type=".$objet_type.", objet_id=".$objet_id.", file=".$file);
|
||||
|
||||
$sql = "SELECT s.nom, c.email, c.rowid as cid, c.lastname, c.firstname,";
|
||||
$sql.= " a.rowid as adid, a.label, a.code, n.rowid";
|
||||
@@ -185,10 +185,10 @@ class Notify
|
||||
$link='/compta/facture.php?facid='.$objet_id;
|
||||
break;
|
||||
case 'order':
|
||||
$link='/commande/fiche.php?facid='.$objet_id;
|
||||
$link='/commande/fiche.php?id='.$objet_id;
|
||||
break;
|
||||
case 'order_supplier':
|
||||
$link='/fourn/commande/fiche.php?facid='.$objet_id;
|
||||
$link='/fourn/commande/fiche.php?id='.$objet_id;
|
||||
break;
|
||||
}
|
||||
// Define $urlwithroot
|
||||
|
||||
@@ -257,7 +257,7 @@ class DoliDBMysql extends DoliDB
|
||||
{
|
||||
return explode('.',$this->getVersion());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return version of database client driver
|
||||
*
|
||||
@@ -267,7 +267,7 @@ class DoliDBMysql extends DoliDB
|
||||
{
|
||||
return mysqli_get_client_info();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Close database connexion
|
||||
@@ -651,6 +651,7 @@ class DoliDBMysql extends DoliDB
|
||||
1006 => 'DB_ERROR_CANNOT_CREATE',
|
||||
1007 => 'DB_ERROR_ALREADY_EXISTS',
|
||||
1008 => 'DB_ERROR_CANNOT_DROP',
|
||||
1022 => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS',
|
||||
1025 => 'DB_ERROR_NO_FOREIGN_KEY_TO_DROP',
|
||||
1044 => 'DB_ERROR_ACCESSDENIED',
|
||||
1046 => 'DB_ERROR_NODBSELECTED',
|
||||
@@ -1078,8 +1079,16 @@ class DoliDBMysql extends DoliDB
|
||||
$resql=$this->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
|
||||
return -1;
|
||||
if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS')
|
||||
{
|
||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If user already exists, we continue to set permissions
|
||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING);
|
||||
}
|
||||
}
|
||||
$sql = "GRANT ALL PRIVILEGES ON ".$this->escape($dolibarr_main_db_name).".* TO '".$this->escape($dolibarr_main_db_user)."'@'".$this->escape($dolibarr_main_db_host)."' IDENTIFIED BY '".$this->escape($dolibarr_main_db_pass)."'";
|
||||
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log
|
||||
|
||||
@@ -262,7 +262,7 @@ class DoliDBMysqli extends DoliDB
|
||||
{
|
||||
return mysqli_get_client_info($this->db);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Close database connexion
|
||||
@@ -650,6 +650,7 @@ class DoliDBMysqli extends DoliDB
|
||||
1006 => 'DB_ERROR_CANNOT_CREATE',
|
||||
1007 => 'DB_ERROR_ALREADY_EXISTS',
|
||||
1008 => 'DB_ERROR_CANNOT_DROP',
|
||||
1022 => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS',
|
||||
1025 => 'DB_ERROR_NO_FOREIGN_KEY_TO_DROP',
|
||||
1044 => 'DB_ERROR_ACCESSDENIED',
|
||||
1046 => 'DB_ERROR_NODBSELECTED',
|
||||
@@ -1072,8 +1073,16 @@ class DoliDBMysqli extends DoliDB
|
||||
$resql=$this->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
|
||||
return -1;
|
||||
if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS')
|
||||
{
|
||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If user already exists, we continue to set permissions
|
||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING);
|
||||
}
|
||||
}
|
||||
$sql = "GRANT ALL PRIVILEGES ON ".$this->escape($dolibarr_main_db_name).".* TO '".$this->escape($dolibarr_main_db_user)."'@'".$this->escape($dolibarr_main_db_host)."' IDENTIFIED BY '".$this->escape($dolibarr_main_db_pass)."'";
|
||||
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log
|
||||
|
||||
@@ -214,7 +214,8 @@ class DoliDBPgsql extends DoliDB
|
||||
|
||||
// nuke unsigned
|
||||
$line=preg_replace('/(int\w+|smallint)\s+unsigned/i','\\1',$line);
|
||||
|
||||
$line=preg_replace('/as signed/i','as integer',$line);
|
||||
|
||||
// blob -> text
|
||||
$line=preg_replace('/\w*blob/i','text',$line);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
* @param string $filterd Filter of done by user
|
||||
* @param int $pid Product id
|
||||
* @param int $socid Third party id
|
||||
* @param array $showextcals Array with list of external calendars, or -1 to show no legend
|
||||
* @param array $showextcals Array with list of external calendars (used to show links to select calendar), or -1 to show no legend
|
||||
* @param string $actioncode Preselected value of actioncode for filter on type
|
||||
* @return void
|
||||
*/
|
||||
@@ -136,7 +136,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
|
||||
print '});' . "\n";
|
||||
print '</script>' . "\n";
|
||||
print '<table>';
|
||||
if (! empty($conf->global->MAIN_JS_SWITCH_AGENDA))
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
if (count($showextcals) > 0)
|
||||
{
|
||||
@@ -147,7 +147,10 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
|
||||
print '<tr><td>';
|
||||
print '<script type="text/javascript">' . "\n";
|
||||
print 'jQuery(document).ready(function () {' . "\n";
|
||||
print 'jQuery("#check_' . $htmlname . '").click(function() { jQuery(".family_' . $htmlname . '").toggle(); });' . "\n";
|
||||
print ' jQuery("#check_' . $htmlname . '").click(function() {';
|
||||
print ' /* alert("'.$htmlname.'"); */';
|
||||
print ' jQuery(".family_' . $htmlname . '").toggle();';
|
||||
print ' });' . "\n";
|
||||
print '});' . "\n";
|
||||
print '</script>' . "\n";
|
||||
print '<input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val ['name'];
|
||||
@@ -434,9 +437,9 @@ function actions_prepare_head($object)
|
||||
$head[$h][1] = $langs->trans('Info');
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'action');
|
||||
|
||||
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'action','remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@@ -69,8 +69,6 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
|
||||
// Description long of product line
|
||||
if ($desc && ($desc != $label))
|
||||
{
|
||||
if ( $libelleproduitservice && empty($hidedesc) ) $libelleproduitservice.="\n";
|
||||
|
||||
if ($desc == '(CREDIT_NOTE)' && $line->fk_remise_except)
|
||||
{
|
||||
$discount=new DiscountAbsolute($db);
|
||||
@@ -83,18 +81,17 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
|
||||
$discount->fetch($line->fk_remise_except);
|
||||
$libelleproduitservice=$outputlangs->transnoentitiesnoconv("DiscountFromDeposit",$discount->ref_facture_source);
|
||||
// Add date of deposit
|
||||
if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec,'day','',$outputlangs).')';
|
||||
if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) $libelleproduitservice.=' ('.dol_print_date($discount->datec,'day','',$outputlangs).')';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($idprod)
|
||||
{
|
||||
if (empty($hidedesc))
|
||||
$libelleproduitservice.=$desc;
|
||||
if (empty($hidedesc)) $libelleproduitservice=dol_concatdesc($libelleproduitservice, $desc);
|
||||
}
|
||||
else
|
||||
{
|
||||
$libelleproduitservice.=$desc;
|
||||
$libelleproduitservice=dol_concatdesc($libelleproduitservice, $desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -148,7 +145,7 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
|
||||
$period='('.$outputlangs->transnoentitiesnoconv('DateUntil',dol_print_date($line->date_end, $format, false, $outputlangs)).')';
|
||||
}
|
||||
//print '>'.$outputlangs->charset_output.','.$period;
|
||||
$libelleproduitservice.="\n".$period;
|
||||
$libelleproduitservice=dol_concatdesc($libelleproduitservice, $period);
|
||||
//print $libelleproduitservice;
|
||||
}
|
||||
|
||||
|
||||
@@ -2547,7 +2547,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
|
||||
if ($picto == 'setup') $picto='title.png';
|
||||
if (!empty($conf->browser->ie) && $picto=='title.png') $picto='title.gif';
|
||||
|
||||
if ($num > $conf->liste_limit or $num == -1)
|
||||
if (($num > $conf->liste_limit) || ($num == -1))
|
||||
{
|
||||
$nextpage = 1;
|
||||
}
|
||||
@@ -3414,13 +3414,13 @@ function picto_required()
|
||||
* Clean a string from all HTML tags and entities
|
||||
*
|
||||
* @param string $StringHtml String to clean
|
||||
* @param string $removelinefeed Replace also all lines feeds by a space
|
||||
* @param string $removelinefeed Replace also all lines feeds by a space, otherwise only last one are removed
|
||||
* @param string $pagecodeto Encoding of input/output string
|
||||
* @return string String cleaned
|
||||
*/
|
||||
function dol_string_nohtmltag($StringHtml,$removelinefeed=1,$pagecodeto='UTF-8')
|
||||
{
|
||||
$pattern = "/<[^>]+>/";
|
||||
$pattern = "/<[^<>]+>/";
|
||||
$temp = dol_html_entity_decode($StringHtml,ENT_COMPAT,$pagecodeto);
|
||||
$temp = preg_replace($pattern,"",$temp);
|
||||
|
||||
@@ -3486,7 +3486,6 @@ function dol_htmlentitiesbr($stringtoencode,$nl2brmode=0,$pagecodefrom='UTF-8')
|
||||
$newstring=strtr($newstring,array('&'=>'__and__','<'=>'__lt__','>'=>'__gt__','"'=>'__dquot__'));
|
||||
$newstring=dol_htmlentities($newstring,ENT_COMPAT,$pagecodefrom); // Make entity encoding
|
||||
$newstring=strtr($newstring,array('__and__'=>'&','__lt__'=>'<','__gt__'=>'>','__dquot__'=>'"'));
|
||||
//$newstring=strtr($newstring,array('__li__'=>"<li>\n")); // Restore <li>\n
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3530,7 +3529,7 @@ function dol_htmlcleanlastbr($stringtodecode)
|
||||
* Replace html_entity_decode functions to manage errors
|
||||
*
|
||||
* @param string $a Operand a
|
||||
* @param string $b Operand b
|
||||
* @param string $b Operand b (ENT_QUOTES=convert simple and double quotes)
|
||||
* @param string $c Operand c
|
||||
* @return string String decoded
|
||||
*/
|
||||
@@ -3670,17 +3669,11 @@ function dol_textishtml($msg,$option=0)
|
||||
{
|
||||
if (preg_match('/<html/i',$msg)) return true;
|
||||
elseif (preg_match('/<body/i',$msg)) return true;
|
||||
elseif (preg_match('/<b>/i',$msg)) return true;
|
||||
elseif (preg_match('/<br/i',$msg)) return true;
|
||||
elseif (preg_match('/<div/i',$msg)) return true;
|
||||
elseif (preg_match('/<em>/i',$msg)) return true;
|
||||
elseif (preg_match('/<font/i',$msg)) return true;
|
||||
elseif (preg_match('/<img/i',$msg)) return true;
|
||||
elseif (preg_match('/<i>/i',$msg)) return true;
|
||||
elseif (preg_match('/<li/i',$msg)) return true;
|
||||
elseif (preg_match('/<span/i',$msg)) return true;
|
||||
elseif (preg_match('/<strong/i',$msg)) return true;
|
||||
elseif (preg_match('/<table/i',$msg)) return true;
|
||||
elseif (preg_match('/<(b|em|i)>/i',$msg)) return true;
|
||||
elseif (preg_match('/<(br|div|font|img|li|span|strong|table)>/i',$msg)) return true;
|
||||
elseif (preg_match('/<(br|div|font|img|li|span|strong|table)\s+[^<>\/]*>/i',$msg)) return true;
|
||||
elseif (preg_match('/<(br|div|font|img|li|span|strong|table)\s+[^<>\/]*\/>/i',$msg)) return true;
|
||||
elseif (preg_match('/<h[0-9]>/i',$msg)) return true;
|
||||
elseif (preg_match('/&[A-Z0-9]{1,6};/i',$msg)) return true; // Html entities names (http://www.w3schools.com/tags/ref_entities.asp)
|
||||
elseif (preg_match('/&#[0-9]{2,3};/i',$msg)) return true; // Html entities numbers (http://www.w3schools.com/tags/ref_entities.asp)
|
||||
return false;
|
||||
@@ -3688,7 +3681,7 @@ function dol_textishtml($msg,$option=0)
|
||||
}
|
||||
|
||||
/**
|
||||
* Concat 2 descriptions (second one after first one)
|
||||
* Concat 2 descriptions (second one after first one with a new line separator if required)
|
||||
* text1 html + text2 html => text1 + '<br>' + text2
|
||||
* text1 html + text2 txt => text1 + '<br>' + dol_nl2br(text2)
|
||||
* text1 txt + text2 html => dol_nl2br(text1) + '<br>' + text2
|
||||
@@ -4540,4 +4533,4 @@ function natural_search($fields, $value)
|
||||
return " AND " . ($end > 1? '(' : '') . $res;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -536,7 +536,7 @@ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdopti
|
||||
* @param Societe $objsoc The company that own the object we need a counter for
|
||||
* @param string $date Date to use for the {y},{m},{d} tags.
|
||||
* @param string $mode 'next' for next value or 'last' for last value
|
||||
* @return string New value
|
||||
* @return string New value (numeric) or error message
|
||||
*/
|
||||
function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next')
|
||||
{
|
||||
@@ -798,6 +798,12 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
||||
{
|
||||
$counter++;
|
||||
|
||||
// If value for $counter has a length higher than $maskcounter chars
|
||||
if ($counter >= pow(10, dol_strlen($maskcounter)))
|
||||
{
|
||||
$counter='ErrorMaxNumberReachForThisMask';
|
||||
}
|
||||
|
||||
if (! empty($maskrefclient_maskcounter))
|
||||
{
|
||||
//print "maskrefclient_maskcounter=".$maskrefclient_maskcounter." maskwithnocode=".$maskwithnocode." maskrefclient=".$maskrefclient."\n<br>";
|
||||
@@ -839,6 +845,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
||||
$maskrefclient_counter = $maskrefclient_obj->val;
|
||||
}
|
||||
else dol_print_error($db);
|
||||
|
||||
if (empty($maskrefclient_counter) || preg_match('/[^0-9]/i',$maskrefclient_counter)) $maskrefclient_counter=$maskrefclient_maskoffset;
|
||||
$maskrefclient_counter++;
|
||||
}
|
||||
@@ -1286,6 +1293,7 @@ function getListOfModels($db,$type,$maxfilenamelength=0)
|
||||
$sql.= " WHERE type = '".$type."'";
|
||||
$sql.= " AND entity IN (0,".(! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)?"1,":"").$conf->entity.")";
|
||||
|
||||
dol_syslog('/core/lib/function2.lib.php::getListOfModels sql='.$sql, LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@@ -1532,3 +1540,126 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clean corrupted tree (orphelins linked to a not existing parent), record linked to themself and child-parent loop
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $tabletocleantree Table to clean
|
||||
* @param string $fieldfkparent Field name that contains id of parent
|
||||
* @return int Nb of records fixed/deleted
|
||||
*/
|
||||
function cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent)
|
||||
{
|
||||
$totalnb=0;
|
||||
$listofid=array();
|
||||
$listofparentid=array();
|
||||
|
||||
// Get list of all id in array listofid and all parents in array listofparentid
|
||||
$sql='SELECT rowid, '.$fieldfkparent.' as parent_id FROM '.MAIN_DB_PREFIX.$tabletocleantree;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$listofid[]=$obj->rowid;
|
||||
if ($obj->parent_id > 0) $listofparentid[$obj->rowid]=$obj->parent_id;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if (count($listofid))
|
||||
{
|
||||
print 'Code requested to clean tree (may be to solve data corruption), so we check/clean orphelins and loops.'."<br>\n";
|
||||
|
||||
// Check loops on each other
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabletocleantree." SET ".$fieldfkparent." = 0 WHERE ".$fieldfkparent." = rowid"; // So we update only records linked to themself
|
||||
dol_syslog("sql=".$sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$nb=$db->affected_rows($sql);
|
||||
if ($nb > 0)
|
||||
{
|
||||
print '<br>Some record that were parent of themself were cleaned.';
|
||||
}
|
||||
|
||||
$totalnb+=$nb;
|
||||
}
|
||||
//else dol_print_error($db);
|
||||
|
||||
// Check other loops
|
||||
$listofidtoclean=array();
|
||||
foreach($listofparentid as $id => $pid)
|
||||
{
|
||||
// Check depth
|
||||
//print 'Analyse record id='.$id.' with parent '.$pid.'<br>';
|
||||
|
||||
$cursor=$id; $arrayidparsed=array(); // We start from child $id
|
||||
while ($cursor > 0)
|
||||
{
|
||||
$arrayidparsed[$cursor]=1;
|
||||
if ($arrayidparsed[$listofparentid[$cursor]]) // We detect a loop. A record with a parent that was already into child
|
||||
{
|
||||
print 'Found a loop between id '.$id.' - '.$cursor.'<br>';
|
||||
unset($arrayidparsed);
|
||||
$listofidtoclean[$cursor]=$id;
|
||||
break;
|
||||
}
|
||||
$cursor=$listofparentid[$cursor];
|
||||
}
|
||||
|
||||
if (count($listofidtoclean)) break;
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabletocleantree;
|
||||
$sql.= " SET ".$fieldfkparent." = 0";
|
||||
$sql.= " WHERE rowid IN (".join(',',$listofidtoclean).")"; // So we update only records detected wrong
|
||||
dol_syslog("sql=".$sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$nb=$db->affected_rows($sql);
|
||||
if ($nb > 0)
|
||||
{
|
||||
// Removed orphelins records
|
||||
print '<br>Some records were detected to have parent that is a child, we set them as root record for id: ';
|
||||
print join(',',$listofidtoclean);
|
||||
}
|
||||
|
||||
$totalnb+=$nb;
|
||||
}
|
||||
//else dol_print_error($db);
|
||||
|
||||
// Check and clean orphelins
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabletocleantree;
|
||||
$sql.= " SET ".$fieldfkparent." = 0";
|
||||
$sql.= " WHERE ".$fieldfkparent." NOT IN (".join(',',$listofid).")"; // So we update only records linked to a non existing parent
|
||||
dol_syslog("sql=".$sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$nb=$db->affected_rows($sql);
|
||||
if ($nb > 0)
|
||||
{
|
||||
// Removed orphelins records
|
||||
print '<br>Some orphelins were found and modified to be parent so records are visible again for id: ';
|
||||
print join(',',$listofid);
|
||||
}
|
||||
|
||||
$totalnb+=$nb;
|
||||
}
|
||||
//else dol_print_error($db);
|
||||
|
||||
print '<br>We fixed '.$totalnb.' record(s). Some records may still be corrupted. New check may be required.';
|
||||
return $totalnb;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,9 +81,14 @@ function member_prepare_head($object)
|
||||
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'member');
|
||||
|
||||
$nbNote = 0;
|
||||
if(!empty($object->note)) $nbNote++;
|
||||
if(!empty($object->note_private)) $nbNote++;
|
||||
if(!empty($object->note_public)) $nbNote++;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/adherents/note.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Note");
|
||||
$head[$h][2] = 'note';
|
||||
if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/adherents/document.php?id='.$object->id;
|
||||
@@ -130,7 +135,7 @@ function member_admin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsMember");
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/adherents/admin/adherent_type_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsMemberType");
|
||||
$head[$h][2] = 'attributes_type';
|
||||
|
||||
@@ -843,8 +843,8 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
|
||||
{
|
||||
$pdf->SetXY(-20,-$posy);
|
||||
//print 'xxx'.$pdf->PageNo().'-'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit;
|
||||
if (empty($conf->global->MAIN_USE_FPDF)) $pdf->MultiCell(11, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0);
|
||||
else $pdf->MultiCell(11, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0);
|
||||
if (empty($conf->global->MAIN_USE_FPDF)) $pdf->MultiCell(13, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0);
|
||||
else $pdf->MultiCell(13, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0);
|
||||
}
|
||||
|
||||
return $marginwithfooter;
|
||||
|
||||
@@ -142,18 +142,24 @@ function task_prepare_head($object)
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'task');
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
|
||||
/*$filesdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$listoffiles=dol_dir_list($filesdir,'files',1);
|
||||
$head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents'));*/
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
$head[$h][2] = 'task_document';
|
||||
$h++;
|
||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
|
||||
{
|
||||
$nbNote = 0;
|
||||
if(!empty($object->note_private)) $nbNote++;
|
||||
if(!empty($object->note_public)) $nbNote++;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
|
||||
$head[$h][1] = $langs->trans('Notes');
|
||||
if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')';
|
||||
$head[$h][2] = 'task_notes';
|
||||
$h++;
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
|
||||
$head[$h][1] = $langs->trans('Notes');
|
||||
$head[$h][2] = 'task_notes';
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
|
||||
$filesdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->project->ref) . '/' .dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$listoffiles=dol_dir_list($filesdir,'files',1,'','thumbs');
|
||||
$head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents'));
|
||||
$head[$h][2] = 'task_document';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'task','remove');
|
||||
|
||||
@@ -110,16 +110,15 @@ function delivery_prepare_head($object)
|
||||
$head[$h][2] = 'delivery';
|
||||
$h++;
|
||||
|
||||
/* We are on id of delivery, no shipment
|
||||
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->origin_id;
|
||||
$head[$h][1] = $langs->trans("ContactsAddresses");
|
||||
$head[$h][2] = 'contact';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->origin_id;
|
||||
$head[$h][1] = $langs->trans("Notes");
|
||||
$head[$h][2] = 'note';
|
||||
$h++;*/
|
||||
$h++;
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
|
||||
@@ -758,16 +758,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
// Suppliers
|
||||
if (! empty($conf->societe->enabled) && ! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
if (! empty($conf->facture->enabled))
|
||||
{
|
||||
$langs->load("bills");
|
||||
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"),0,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
||||
$newmenu->add("/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"),1,$user->rights->fournisseur->facture->creer);
|
||||
$newmenu->add("/fourn/facture/impayees.php", $langs->trans("Unpaid"),1,$user->rights->fournisseur->facture->lire);
|
||||
$newmenu->add("/fourn/facture/paiement.php", $langs->trans("Payments"),1,$user->rights->fournisseur->facture->lire);
|
||||
$langs->load("bills");
|
||||
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"),0,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
||||
$newmenu->add("/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"),1,$user->rights->fournisseur->facture->creer);
|
||||
$newmenu->add("/fourn/facture/impayees.php", $langs->trans("Unpaid"),1,$user->rights->fournisseur->facture->lire);
|
||||
$newmenu->add("/fourn/facture/paiement.php", $langs->trans("Payments"),1,$user->rights->fournisseur->facture->lire);
|
||||
|
||||
$newmenu->add("/compta/facture/stats/index.php?leftmenu=suppliers_bills&mode=supplier", $langs->trans("Statistics"),1,$user->rights->fournisseur->facture->lire);
|
||||
}
|
||||
$newmenu->add("/compta/facture/stats/index.php?leftmenu=suppliers_bills&mode=supplier", $langs->trans("Statistics"),1,$user->rights->fournisseur->facture->lire);
|
||||
}
|
||||
|
||||
// Orders
|
||||
|
||||
@@ -71,7 +71,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
|
||||
$coyymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -105,7 +105,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
|
||||
|
||||
// D'abord on recupere la valeur max
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande";
|
||||
$sql.= " WHERE ref like '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -126,7 +126,9 @@ class mod_commande_marbre extends ModeleNumRefCommandes
|
||||
//$date=time();
|
||||
$date=$object->date;
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
|
||||
dol_syslog("mod_commande_marbre::getNextValue return ".$this->prefix.$yymm."-".$num);
|
||||
return $this->prefix.$yymm."-".$num;
|
||||
|
||||
@@ -69,7 +69,7 @@ class mod_contract_serpis extends ModelNumRefContracts
|
||||
$coyymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contrat";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -102,7 +102,7 @@ class mod_contract_serpis extends ModelNumRefContracts
|
||||
global $db,$conf;
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contrat";
|
||||
$sql.= " WHERE ref like '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -122,7 +122,9 @@ class mod_contract_serpis extends ModelNumRefContracts
|
||||
|
||||
$date=$contract->date_contrat;
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
|
||||
dol_syslog("mod_contract_serpis::getNextValue return ".$this->prefix.$yymm."-".$num);
|
||||
return $this->prefix.$yymm."-".$num;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -179,9 +180,10 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
$tab_height = 130;
|
||||
$tab_height_newpage = 150;
|
||||
|
||||
if (! empty($object->note_public) || ! empty($object->tracking_number))
|
||||
if (! empty($object->note_public) || (! empty($object->tracking_number) && ! empty($object->shipping_method_id)))
|
||||
{
|
||||
$tab_top = 88;
|
||||
$tab_top_alt = $tab_top;
|
||||
|
||||
// Tracking number
|
||||
if (! empty($object->tracking_number))
|
||||
@@ -196,7 +198,9 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
$label=$outputlangs->trans("LinkToTrackYourPackage")."<br>";
|
||||
$label.=$outputlangs->trans("SendingMethod".strtoupper($code))." :";
|
||||
$pdf->SetFont('','B', $default_font_size - 2);
|
||||
$pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top-1, $label." ".$object->tracking_url, 0, 1, false, true, 'L');
|
||||
$pdf->writeHTMLCell(60, 7, $this->posxdesc-1, $tab_top-1, $label." ".$object->tracking_url, 0, 1, false, true, 'L');
|
||||
|
||||
$tab_top_alt += 7;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -205,7 +209,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
if (! empty($object->note_public))
|
||||
{
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
|
||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top_alt, dol_htmlentitiesbr($object->note_public), 0, 1);
|
||||
}
|
||||
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
@@ -69,7 +69,7 @@ class mod_expedition_safor extends ModelNumRefExpedition
|
||||
$coyymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."expedition";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -102,7 +102,7 @@ class mod_expedition_safor extends ModelNumRefExpedition
|
||||
global $db,$conf;
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."expedition";
|
||||
$sql.= " WHERE ref like '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -122,7 +122,9 @@ class mod_expedition_safor extends ModelNumRefExpedition
|
||||
|
||||
$date=time();
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
|
||||
dol_syslog("mod_expedition_safor::getNextValue return ".$this->prefix.$yymm."-".$num);
|
||||
return $this->prefix.$yymm."-".$num;
|
||||
|
||||
@@ -68,6 +68,8 @@ class ExportExcel extends ModeleExports
|
||||
$this->label_lib='PhpExcel';
|
||||
$this->version_lib='1.7.2';
|
||||
|
||||
$this->disabled = (in_array(constant('PHPEXCEL_PATH'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages)
|
||||
|
||||
$this->row=0;
|
||||
}
|
||||
|
||||
@@ -181,14 +183,14 @@ class ExportExcel extends ModeleExports
|
||||
|
||||
if ($this->id == 'excel2007')
|
||||
{
|
||||
if (! class_exists('ZipArchive')) // For Excel2007, PHPExcel need ZipArchive
|
||||
if (! class_exists('ZipArchive')) // For Excel2007, PHPExcel need ZipArchive
|
||||
{
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans('ErrorPHPNeedModule','zip');
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->workbook = new PHPExcel();
|
||||
$this->workbook->getProperties()->setCreator($user->getFullName($outputlangs).' - Dolibarr '.DOL_VERSION);
|
||||
//$this->workbook->getProperties()->setLastModifiedBy('Dolibarr '.DOL_VERSION);
|
||||
|
||||
@@ -47,7 +47,6 @@ class ExportExcel2007 extends ExportExcel
|
||||
var $col;
|
||||
var $file; // To save filename
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@@ -69,6 +68,8 @@ class ExportExcel2007 extends ExportExcel
|
||||
$this->label_lib='PhpExcel';
|
||||
$this->version_lib='1.7.2';
|
||||
|
||||
$this->disabled = (in_array(constant('PHPEXCEL_PATH'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages)
|
||||
|
||||
$this->row=0;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $maxfilenamelength Max length of value to show
|
||||
* @return array List of templates
|
||||
* @return array List of templates (same content than array this->driverlabel)
|
||||
*/
|
||||
function liste_modeles($db,$maxfilenamelength=0)
|
||||
{
|
||||
@@ -74,7 +74,7 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
|
||||
// Picto
|
||||
$this->picto[$module->id]=$module->picto;
|
||||
// Driver properties
|
||||
$this->driverlabel[$module->id]=$module->getDriverLabel();
|
||||
$this->driverlabel[$module->id]=$module->getDriverLabel().(empty($module->disabled)?'':' __(Disabled)__'); // '__(Disabled)__' is a key
|
||||
$this->driverdesc[$module->id]=$module->getDriverDesc();
|
||||
$this->driverversion[$module->id]=$module->getDriverVersion();
|
||||
// If use an external lib
|
||||
|
||||
@@ -75,7 +75,7 @@ class mod_facture_mars extends ModeleNumRefFactures
|
||||
$fayymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(facnumber FROM ".$posindice.")) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE facnumber LIKE '".$this->prefixinvoice."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -138,7 +138,7 @@ class mod_facture_mars extends ModeleNumRefFactures
|
||||
|
||||
// D'abord on recupere la valeur max
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(facnumber FROM ".$posindice.")) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE facnumber LIKE '".$prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -159,7 +159,8 @@ class mod_facture_mars extends ModeleNumRefFactures
|
||||
|
||||
if ($mode == 'last')
|
||||
{
|
||||
$num = sprintf("%04s",$max);
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max);
|
||||
|
||||
$ref='';
|
||||
$sql = "SELECT facnumber as ref";
|
||||
@@ -182,7 +183,9 @@ class mod_facture_mars extends ModeleNumRefFactures
|
||||
{
|
||||
$date=$facture->date; // This is invoice date (not creation date)
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
|
||||
dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num);
|
||||
return $prefix.$yymm."-".$num;
|
||||
|
||||
@@ -73,7 +73,7 @@ class mod_facture_terre extends ModeleNumRefFactures
|
||||
$fayymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(facnumber FROM ".$posindice.")) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE facnumber LIKE '".$this->prefixinvoice."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -95,7 +95,7 @@ class mod_facture_terre extends ModeleNumRefFactures
|
||||
$fayymm='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(facnumber FROM ".$posindice.")) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE facnumber LIKE '".$this->prefixcreditnote."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -116,7 +116,7 @@ class mod_facture_terre extends ModeleNumRefFactures
|
||||
$fayymm='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(facnumber FROM ".$posindice.")) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE facnumber LIKE '".$this->prefixdeposit."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -154,7 +154,7 @@ class mod_facture_terre extends ModeleNumRefFactures
|
||||
|
||||
// D'abord on recupere la valeur max
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(facnumber FROM ".$posindice.")) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE facnumber LIKE '".$prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -175,7 +175,8 @@ class mod_facture_terre extends ModeleNumRefFactures
|
||||
|
||||
if ($mode == 'last')
|
||||
{
|
||||
$num = sprintf("%04s",$max);
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max);
|
||||
|
||||
$ref='';
|
||||
$sql = "SELECT facnumber as ref";
|
||||
@@ -198,7 +199,9 @@ class mod_facture_terre extends ModeleNumRefFactures
|
||||
{
|
||||
$date=$facture->date; // This is invoice date (not creation date)
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
|
||||
dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num);
|
||||
return $prefix.$yymm."-".$num;
|
||||
|
||||
@@ -72,7 +72,7 @@ class mod_pacific extends ModeleNumRefFicheinter
|
||||
$fayymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter";
|
||||
$sql.= " WHERE ref like '".$this->prefix."____-%'";
|
||||
$sql.= " WHERE entity = ".$conf->entity;
|
||||
@@ -108,7 +108,7 @@ class mod_pacific extends ModeleNumRefFicheinter
|
||||
|
||||
// D'abord on recupere la valeur max
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -124,7 +124,9 @@ class mod_pacific extends ModeleNumRefFicheinter
|
||||
//$date=time();
|
||||
$date=$object->datec;
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
|
||||
return $this->prefix.$yymm."-".$num;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
|
||||
$fayymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."livraison";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -112,7 +112,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
|
||||
|
||||
// D'abord on recupere la valeur max
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."livraison";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -134,7 +134,9 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
|
||||
$date=$object->date_delivery;
|
||||
if (empty($date)) $date=dol_now();
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
|
||||
dol_syslog("mod_livraison_jade::getNextValue return ".$this->prefix.$yymm."-".$num);
|
||||
return $this->prefix.$yymm."-".$num;
|
||||
|
||||
@@ -197,16 +197,16 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
$tplidx = $pdf->importPage(1);
|
||||
}
|
||||
|
||||
// Complete object by loading several other informations
|
||||
// We get the shipment that is the origin of delivery receipt
|
||||
$expedition=new Expedition($this->db);
|
||||
$result = $expedition->fetch($object->expedition_id);
|
||||
|
||||
$result = $expedition->fetch($object->origin_id);
|
||||
// Now we get the order that is origin of shipment
|
||||
$commande = new Commande($this->db);
|
||||
if ($expedition->origin == 'commande')
|
||||
{
|
||||
$commande->fetch($expedition->origin_id);
|
||||
}
|
||||
$object->commande=$commande;
|
||||
$object->commande=$commande; // We set order of shipment onto delivery.
|
||||
|
||||
|
||||
$pdf->Open();
|
||||
@@ -780,9 +780,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
|
||||
// Client destinataire
|
||||
$posy=42;
|
||||
$posx=102;
|
||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY(102,$posy-5);
|
||||
$pdf->SetXY($posx,$posy-5);
|
||||
$pdf->MultiCell(80,5, $outputlangs->transnoentities("DeliveryAddress").":", 0, 'L');
|
||||
|
||||
// If SHIPPING contact defined on order, we use it
|
||||
@@ -814,7 +816,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
|
||||
$posy=42;
|
||||
$posx=$this->page_largeur-$this->marge_droite-$widthrecbox;
|
||||
//if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||
|
||||
// Show recipient frame
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
@@ -168,7 +168,7 @@ class MailingTargets // This can't be abstract as it is used for some method
|
||||
$sql.= "'".$this->db->escape($targetarray['other'])."',";
|
||||
$sql.= "'".$this->db->escape($targetarray['source_url'])."',";
|
||||
$sql.= (empty($targetarray['source_id']) ? 'null' : "'".$this->db->escape($targetarray['source_id'])."'").",";
|
||||
$sql .= "'".$this->db->escape(dol_hash($targetarray['email'].';'.$targetarray['name'].';'.$mailing_id.';'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY))."',";
|
||||
$sql .= "'".$this->db->escape(dol_hash($targetarray['email'].';'.$targetarray['lastname'].';'.$mailing_id.';'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY))."',";
|
||||
$sql .= "'".$this->db->escape($targetarray['source_type'])."')";
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
|
||||
@@ -166,7 +166,7 @@ class mailing_xinputfile extends MailingTargets
|
||||
{
|
||||
$cibles[$j] = array(
|
||||
'email' => $email,
|
||||
'name' => $name,
|
||||
'lastname' => $name,
|
||||
'firstname' => $firstname,
|
||||
'other' => $other,
|
||||
'source_url' => '',
|
||||
|
||||
@@ -134,7 +134,7 @@ class mailing_xinputuser extends MailingTargets
|
||||
{
|
||||
$cibles[] = array(
|
||||
'email' => $email,
|
||||
'name' => $lastname,
|
||||
'lastname' => $lastname,
|
||||
'firstname' => $firstname,
|
||||
'other' => $other,
|
||||
'source_url' => '',
|
||||
|
||||
@@ -161,9 +161,12 @@ class pdf_standard
|
||||
|
||||
// Define photo
|
||||
$dir=$conf->adherent->dir_output;
|
||||
$file=get_exdir($idmember,2).'photos/'.$photo;
|
||||
$photo=$dir.'/'.$file;
|
||||
if (empty($photo) || ! is_readable($photo)) $photo='';
|
||||
if (! empty($photo))
|
||||
{
|
||||
$file=get_exdir($idmember,2).'photos/'.$photo;
|
||||
$photo=$dir.'/'.$file;
|
||||
if (! is_readable($photo)) $photo='';
|
||||
}
|
||||
|
||||
// Define background image
|
||||
$backgroundimage='';
|
||||
|
||||
@@ -368,7 +368,7 @@ class modAgenda extends DolibarrModules
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]="ExportDataset_event1";
|
||||
$this->export_permission[$r]=array(array("agenda","export"));
|
||||
$this->export_fields_array[$r]=array('a.id'=>'IdAgenda','a.label'=>'Actions','a.datep'=>'DateActionStart',
|
||||
$this->export_fields_array[$r]=array('a.id'=>'IdAgenda','a.label'=>'Title','a.datep'=>'DateActionStart',
|
||||
'a.datea'=>'DateActionEnd','a.percent'=>'PercentDone','a.fk_user_author'=>'ActionAskedBy','a.fk_user_action'=>'ActionAffectedTo',
|
||||
'a.fk_user_done'=>"ActionDoneBy","a.priority"=>"Priority","a.fulldayevent"=>"EventOnFullDay","a.location"=>"Location",
|
||||
"a.fk_soc"=>"ThirdParty","a.fk_contact"=>"ThirdPartyContact","a.fk_action"=>"Type");
|
||||
|
||||
@@ -97,12 +97,12 @@ class modExpedition extends DolibarrModules
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$r++;
|
||||
$this->const[$r][0] = "EXPEDITION_ADDON_PDF_ODT_PATH";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/shipment";
|
||||
$this->const[$r][3] = "";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "LIVRAISON_ADDON_PDF";
|
||||
$this->const[$r][1] = "chaine";
|
||||
@@ -118,7 +118,6 @@ class modExpedition extends DolibarrModules
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$r++;
|
||||
$this->const[$r][0] = "LIVRAISON_ADDON_PDF_ODT_PATH";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/delivery";
|
||||
@@ -271,8 +270,8 @@ class modExpedition extends DolibarrModules
|
||||
$sql = array(
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity,
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','shipping',".$conf->entity.")",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[2][2]."' AND entity = ".$conf->entity,
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[2][2]."','delivery',".$conf->entity.")",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[3][2]."' AND entity = ".$conf->entity,
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[3][2]."','delivery',".$conf->entity.")",
|
||||
);
|
||||
|
||||
return $this->_init($sql,$options);
|
||||
|
||||
@@ -178,7 +178,7 @@ class modFacture extends DolibarrModules
|
||||
$this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
$this->export_icon[$r]='bill';
|
||||
$this->export_permission[$r]=array(array("facture","facture","export"));
|
||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.subprice'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.special_code'=>'SpecialCode','fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_sell'=>'ProductAccountancyBuyCode');
|
||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.subprice'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.special_code'=>'SpecialCode','fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_sell'=>'ProductAccountancySellCode');
|
||||
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'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.price'=>"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.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text');
|
||||
$this->export_TypeFields_array[$r]=array('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','c.code'=>'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','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.subprice'=>"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.special_code'=>'invoice_line','fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product','p.accountancy_code_sell'=>'product');
|
||||
|
||||
@@ -62,8 +62,7 @@ class modFckeditor extends DolibarrModules
|
||||
$this->config_page_url = array("fckeditor.php");
|
||||
|
||||
// Dependances
|
||||
global $dolibarr_js_CKEDITOR;
|
||||
$this->hidden = ($dolibarr_js_CKEDITOR == 'disabled'?1:0); // A condition to disable module (used for native debian packages)
|
||||
$this->disabled = (in_array(constant('JS_CKEDITOR'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages)
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
|
||||
|
||||
@@ -250,10 +250,10 @@ class modFournisseur extends DolibarrModules
|
||||
$this->export_label[$r]='Factures fournisseurs et lignes de facture';
|
||||
$this->export_icon[$r]='bill';
|
||||
$this->export_permission[$r]=array(array("fournisseur","facture","export"));
|
||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.ref'=>"InvoiceRef",'f.ref_supplier'=>"RefSupplier",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_public'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.remise_percent'=>"Discount",'fd.total_ht'=>"LineTotalHT",'fd.total_ttc'=>"LineTotalTTC",'fd.tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
|
||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.ref'=>"InvoiceRef",'f.ref_supplier'=>"RefSupplier",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_public'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.remise_percent'=>"Discount",'fd.total_ht'=>"LineTotalHT",'fd.total_ttc'=>"LineTotalTTC",'fd.tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_buy'=>'ProductAccountancyBuyCode');
|
||||
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:CompanyName",'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.tva_intra'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_public'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Text",'fd.qty'=>"Number",'fd.total_ht'=>"Number",'fd.total_ttc'=>"Number",'fd.tva'=>"Number",'fd.product_type'=>'Boolean','fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text');
|
||||
$this->export_TypeFields_array[$r]=array('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.tva_intra'=>'Text','f.ref'=>"Text",'f.ref_supplier'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_public'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Text",'fd.qty'=>"Number",'fd.total_ht'=>"Number",'fd.total_ttc'=>"Number",'fd.tva'=>"Number",'fd.product_type'=>'Boolean','fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text');
|
||||
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.ref'=>"invoice",'f.ref_supplier'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.remise_percent'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product');
|
||||
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.ref'=>"invoice",'f.ref_supplier'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.remise_percent'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product','p.accountancy_code_buy'=>'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 ';
|
||||
|
||||
@@ -42,7 +42,7 @@ class modMargin extends DolibarrModules
|
||||
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
|
||||
$this->numero = 59000;
|
||||
// Key text used to identify module (for permissions, menus, etc...)
|
||||
$this->rights_class = 'margin';
|
||||
$this->rights_class = 'margins';
|
||||
|
||||
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
|
||||
// It is used to group modules in module setup page
|
||||
@@ -114,7 +114,6 @@ class modMargin extends DolibarrModules
|
||||
|
||||
// Permissions
|
||||
$this->rights = array();
|
||||
$this->rights_class = 'margins';
|
||||
$r=0;
|
||||
|
||||
$r++;
|
||||
|
||||
@@ -254,15 +254,15 @@ class modProduct extends DolibarrModules
|
||||
$this->export_label[$r]="ProductsMultiPrice"; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
$this->export_permission[$r]=array(array("produit","export"));
|
||||
$this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",
|
||||
'pr.price_base_type'=>"PriceLevelPriceBase",'pr.price_level'=>"PriceLevel",
|
||||
'pr.price'=>"PriceLevelUnitPriceHT",'pr.price_ttc'=>"PriceLevelUnitPriceTTC",
|
||||
'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
|
||||
'pr.tva_tx'=>'PriceLevelVATRate',
|
||||
'pr.price_base_type'=>"PriceBase",'pr.price_level'=>"PriceLevel",
|
||||
'pr.price'=>"HT",'pr.price_ttc'=>"TTC",
|
||||
'pr.price_min'=>"MinPriceHT",'pr.price_min_ttc'=>"MinPriceTTC",
|
||||
'pr.tva_tx'=>'VAT',
|
||||
'pr.date_price'=>'DateCreation');
|
||||
$this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",
|
||||
'pr.price_base_type'=>"product",'pr.price_level'=>"product",'pr.price'=>"product",
|
||||
'pr.price_ttc'=>"product",
|
||||
'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
|
||||
'pr.price_min'=>"product",'pr.price_min_ttc'=>"product",
|
||||
'pr.tva_tx'=>'product',
|
||||
'pr.date_price'=>"product");
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
@@ -282,11 +282,11 @@ class modProduct extends DolibarrModules
|
||||
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
||||
$this->import_tables_array[$r]=array('pr'=>MAIN_DB_PREFIX.'product_price');
|
||||
$this->import_tables_creator_array[$r]=array('pr'=>'fk_user_author'); // Fields to store import user id
|
||||
$this->import_fields_array[$r]=array('pr.fk_product'=>"ProductRowid*",
|
||||
'pr.price_base_type'=>"PriceLevelPriceBase",'pr.price_level'=>"PriceLevel",
|
||||
'pr.price'=>"PriceLevelUnitPriceHT",'pr.price_ttc'=>"PriceLevelUnitPriceTTC",
|
||||
'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
|
||||
'pr.tva_tx'=>'PriceLevelVATRate',
|
||||
$this->import_fields_array[$r]=array('pr.fk_product'=>"Id*",
|
||||
'pr.price_base_type'=>"PriceBase",'pr.price_level'=>"PriceLevel",
|
||||
'pr.price'=>"HT",'pr.price_ttc'=>"TTC",
|
||||
'pr.price_min'=>"MinPriceHT",'pr.price_min_ttc'=>"MinPriceTTC",
|
||||
'pr.tva_tx'=>'VAT',
|
||||
'pr.date_price'=>'DateCreation*');
|
||||
$this->import_regex_array[$r]=array('pr.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
|
||||
$this->import_examplevalues_array[$r]=array('pr.fk_product'=>"1",
|
||||
|
||||
@@ -157,6 +157,12 @@ class pdf_standardlabel
|
||||
}
|
||||
}
|
||||
|
||||
// Define photo
|
||||
if (! empty($photo))
|
||||
{
|
||||
if (! is_readable($photo)) $photo='';
|
||||
}
|
||||
|
||||
// Define background image
|
||||
$backgroundimage='';
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class mod_project_simple extends ModeleNumRefProjects
|
||||
$coyymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -108,7 +108,7 @@ class mod_project_simple extends ModeleNumRefProjects
|
||||
|
||||
// D'abord on recupere la valeur max
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet";
|
||||
$sql.= " WHERE ref like '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -130,7 +130,9 @@ class mod_project_simple extends ModeleNumRefProjects
|
||||
|
||||
//$yymm = strftime("%y%m",time());
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
|
||||
dol_syslog("mod_project_simple::getNextValue return ".$this->prefix.$yymm."-".$num);
|
||||
return $this->prefix.$yymm."-".$num;
|
||||
|
||||
@@ -72,7 +72,7 @@ class mod_task_simple extends ModeleNumRefTask
|
||||
$coyymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(task.ref FROM " . $posindice . ")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(task.ref FROM " . $posindice . ") AS SIGNED)) as max";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "projet_task AS task, ";
|
||||
$sql .= MAIN_DB_PREFIX . "projet AS project WHERE task.fk_projet=project.rowid";
|
||||
$sql .= " AND task.ref LIKE '" . $this->prefix . "____-%'";
|
||||
@@ -109,7 +109,7 @@ class mod_task_simple extends ModeleNumRefTask
|
||||
|
||||
// D'abord on recupere la valeur max
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet_task";
|
||||
$sql.= " WHERE ref like '".$this->prefix."____-%'";
|
||||
|
||||
@@ -130,7 +130,9 @@ class mod_task_simple extends ModeleNumRefTask
|
||||
|
||||
//$yymm = strftime("%y%m",time());
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
|
||||
dol_syslog("mod_task_simple::getNextValue return ".$this->prefix.$yymm."-".$num);
|
||||
return $this->prefix.$yymm."-".$num;
|
||||
|
||||
@@ -73,7 +73,7 @@ class mod_propale_marbre extends ModeleNumRefPropales
|
||||
$pryymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."propal";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -110,7 +110,7 @@ class mod_propale_marbre extends ModeleNumRefPropales
|
||||
|
||||
// D'abord on recupere la valeur max
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."propal";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -130,7 +130,9 @@ class mod_propale_marbre extends ModeleNumRefPropales
|
||||
|
||||
$date = time();
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
|
||||
dol_syslog("mod_propale_marbre::getNextValue return ".$this->prefix.$yymm."-".$num);
|
||||
return $this->prefix.$yymm."-".$num;
|
||||
@@ -150,4 +152,4 @@ class mod_propale_marbre extends ModeleNumRefPropales
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -119,7 +119,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
|
||||
|
||||
// D'abord on recupere la valeur max (reponse immediate car champ indexe)
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(".$field." FROM ".$posindice.")) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(".$field." FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe";
|
||||
$sql.= " WHERE ".$field." LIKE '".$prefix."____-%'";
|
||||
$sql.= " AND entity IN (".getEntity('societe', 1).")";
|
||||
@@ -139,7 +139,9 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
|
||||
|
||||
$date = dol_now();
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
|
||||
dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num);
|
||||
return $prefix.$yymm."-".$num;
|
||||
|
||||
@@ -73,7 +73,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices
|
||||
$siyymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefixinvoice."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -112,7 +112,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices
|
||||
|
||||
// D'abord on recupere la valeur max
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn";
|
||||
$sql.= " WHERE ref LIKE '".$prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -133,7 +133,8 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices
|
||||
|
||||
if ($mode == 'last')
|
||||
{
|
||||
$num = sprintf("%04s",$max);
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max);
|
||||
|
||||
$ref='';
|
||||
$sql = "SELECT ref as ref";
|
||||
@@ -156,7 +157,9 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices
|
||||
{
|
||||
$date=$object->date; // This is invoice date (not creation date)
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
|
||||
dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num);
|
||||
return $prefix.$yymm."-".$num;
|
||||
|
||||
@@ -73,7 +73,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
|
||||
$coyymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -108,7 +108,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
|
||||
|
||||
// D'abord on recupere la valeur max
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur";
|
||||
$sql.= " WHERE ref like '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -125,7 +125,9 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
|
||||
$date=$object->date_commande; // Not always defined
|
||||
if (empty($date)) $date=$object->date; // Creation date is order date for suppliers orders
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
|
||||
return $this->prefix.$yymm."-".$num;
|
||||
}
|
||||
|
||||
@@ -252,8 +252,10 @@ if (! empty($usemargins) && $user->rights->margins->creer)
|
||||
var remise = $("input[name='remise_percent']:first");
|
||||
|
||||
var rate = $("input[name='"+npRate+"']:first");
|
||||
|
||||
if (rate.val() == '')
|
||||
return true;
|
||||
|
||||
if (! $.isNumeric(rate.val().replace(',','.')))
|
||||
{
|
||||
alert('<?php echo dol_escape_js($langs->trans("rateMustBeNumeric")); ?>');
|
||||
@@ -274,12 +276,13 @@ if (! empty($usemargins) && $user->rights->margins->creer)
|
||||
|
||||
if (remisejs != 100)
|
||||
{
|
||||
if (remisejs == '') remisejs=0;
|
||||
|
||||
bpjs=price2numjs(buying_price.val());
|
||||
ratejs=price2numjs(rate.val());
|
||||
|
||||
if (npRate == "marginRate")
|
||||
if (npRate == "np_marginRate")
|
||||
price = ((bpjs * (1 + ratejs / 100)) / (1 - remisejs / 100));
|
||||
else if (npRate == "markRate")
|
||||
else if (npRate == "np_markRate")
|
||||
price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100));
|
||||
}
|
||||
$("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value
|
||||
@@ -291,6 +294,8 @@ if (! empty($usemargins) && $user->rights->margins->creer)
|
||||
/* Function similar to price2num in PHP */
|
||||
function price2numjs(num)
|
||||
{
|
||||
if (num == '') return '';
|
||||
|
||||
<?php
|
||||
$dec=','; $thousand=' ';
|
||||
if ($langs->transnoentitiesnoconv("SeparatorDecimal") != "SeparatorDecimal") $dec=$langs->transnoentitiesnoconv("SeparatorDecimal");
|
||||
|
||||
@@ -298,6 +298,8 @@ if (! empty($usemargins) && $user->rights->margins->creer)
|
||||
/* Function similar to price2num in PHP */
|
||||
function price2numjs(num)
|
||||
{
|
||||
if (num == '') return '';
|
||||
|
||||
<?php
|
||||
$dec=','; $thousand=' ';
|
||||
if ($langs->transnoentitiesnoconv("SeparatorDecimal") != "SeparatorDecimal") $dec=$langs->transnoentitiesnoconv("SeparatorDecimal");
|
||||
|
||||
@@ -203,8 +203,8 @@ class Expedition extends CommonObject
|
||||
$sql.= ") VALUES (";
|
||||
$sql.= "'(PROV)'";
|
||||
$sql.= ", ".$conf->entity;
|
||||
$sql.= ", ".($this->ref_customer?"'".$this->ref_customer."'":"null");
|
||||
$sql.= ", ".($this->ref_int?"'".$this->ref_int."'":"null");
|
||||
$sql.= ", ".($this->ref_customer?"'".$this->db->escape($this->ref_customer)."'":"null");
|
||||
$sql.= ", ".($this->ref_int?"'".$this->db->escape($this->ref_int)."'":"null");
|
||||
$sql.= ", '".$this->db->idate($now)."'";
|
||||
$sql.= ", ".$user->id;
|
||||
$sql.= ", ".($this->date_expedition>0?"'".$this->db->idate($this->date_expedition)."'":"null");
|
||||
@@ -785,9 +785,10 @@ class Expedition extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete shipment
|
||||
* Delete shipment.
|
||||
* Warning, do not delete a shipment if a delivery is linked to (with table llx_element_element)
|
||||
*
|
||||
* @return int >0 if OK otherwise if KO
|
||||
* @return int >0 if OK, 0 if deletion done but failed to delete files, <0 if KO
|
||||
*/
|
||||
function delete()
|
||||
{
|
||||
@@ -796,6 +797,14 @@ class Expedition extends CommonObject
|
||||
|
||||
$error=0;
|
||||
|
||||
// Add a protection to refuse deleting if shipment has at least one delivery
|
||||
$this->fetchObjectLinked($this->id, 'shipping', 0, 'delivery'); // Get deliveries linked to this shipment
|
||||
if (count($this->linkedObjectsIds) > 0)
|
||||
{
|
||||
$this->error='ErrorThereIsSomeDeliveries';
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Stock control
|
||||
@@ -840,7 +849,7 @@ class Expedition extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if(! $error)
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."expeditiondet";
|
||||
$sql.= " WHERE fk_expedition = ".$this->id;
|
||||
@@ -858,31 +867,6 @@ class Expedition extends CommonObject
|
||||
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
$this->db->commit();
|
||||
|
||||
// On efface le repertoire de pdf provisoire
|
||||
$ref = dol_sanitizeFileName($this->ref);
|
||||
if (! empty($conf->expedition->dir_output))
|
||||
{
|
||||
$dir = $conf->expedition->dir_output . '/sending/' . $ref ;
|
||||
$file = $dir . '/' . $ref . '.pdf';
|
||||
if (file_exists($file))
|
||||
{
|
||||
if (! dol_delete_file($file))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (file_exists($dir))
|
||||
{
|
||||
if (!dol_delete_dir($dir))
|
||||
{
|
||||
$this->error=$langs->trans("ErrorCanNotDeleteDir",$dir);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Call triggers
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
@@ -890,7 +874,40 @@ class Expedition extends CommonObject
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// End call triggers
|
||||
|
||||
return 1;
|
||||
if (! $error)
|
||||
{
|
||||
$this->db->commit();
|
||||
|
||||
// We delete PDFs
|
||||
$ref = dol_sanitizeFileName($this->ref);
|
||||
if (! empty($conf->expedition->dir_output))
|
||||
{
|
||||
$dir = $conf->expedition->dir_output . '/sending/' . $ref ;
|
||||
$file = $dir . '/' . $ref . '.pdf';
|
||||
if (file_exists($file))
|
||||
{
|
||||
if (! dol_delete_file($file))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (file_exists($dir))
|
||||
{
|
||||
if (!dol_delete_dir($dir))
|
||||
{
|
||||
$this->error=$langs->trans("ErrorCanNotDeleteDir",$dir);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -183,7 +183,7 @@ if ($action == 'add')
|
||||
|
||||
/*
|
||||
* Build a receiving receipt
|
||||
*/
|
||||
*/
|
||||
else if ($action == 'create_delivery' && $conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)
|
||||
{
|
||||
$result = $object->create_delivery($user);
|
||||
@@ -235,8 +235,9 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expe
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = $object->error;
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans($object->error),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,21 +47,44 @@ if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user, $origin, $origin_id);
|
||||
|
||||
$object = new Expedition($db);
|
||||
$object->fetch($id);
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$object->fetch($id, $ref);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
if (!empty($object->origin))
|
||||
{
|
||||
$typeobject = $object->origin;
|
||||
$origin = $object->origin;
|
||||
$object->fetch_origin();
|
||||
}
|
||||
|
||||
// Linked documents
|
||||
if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled))
|
||||
{
|
||||
$objectsrc=new Commande($db);
|
||||
$objectsrc->fetch($object->$typeobject->id);
|
||||
}
|
||||
if ($typeobject == 'propal' && $object->$typeobject->id && ! empty($conf->propal->enabled))
|
||||
{
|
||||
$objectsrc=new Propal($db);
|
||||
$objectsrc->fetch($object->$typeobject->id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* Actions */
|
||||
/******************************************************************************/
|
||||
|
||||
if ($action == 'setnote_public' && $user->rights->facture->creer)
|
||||
if ($action == 'setnote_public')
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
else if ($action == 'setnote_private' && $user->rights->facture->creer)
|
||||
else if ($action == 'setnote_private')
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
|
||||
|
||||
@@ -94,7 +94,8 @@ $entitytolang = array(
|
||||
'shipment_line'=> 'ShipmentLine',
|
||||
'project' => 'Projects',
|
||||
'projecttask' => 'Tasks',
|
||||
'task_time' => 'TaskTimeSpent'
|
||||
'task_time' => 'TaskTimeSpent',
|
||||
'action' => 'Action'
|
||||
);
|
||||
|
||||
$array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array();
|
||||
@@ -1029,7 +1030,7 @@ if ($step == 5 && $datatoexport)
|
||||
if ($action == 'remove_file')
|
||||
{
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?step=5&datatoexport='.$datatoexport.'&file='.urlencode(GETPOST("file")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
print '<table width="100%" class="border">';
|
||||
@@ -1093,13 +1094,21 @@ if ($step == 5 && $datatoexport)
|
||||
print '</tr>'."\n";
|
||||
|
||||
$liste=$objmodelexport->liste_modeles($db);
|
||||
foreach($liste as $key => $val)
|
||||
$listeall=$liste;
|
||||
foreach($listeall as $key => $val)
|
||||
{
|
||||
if (preg_match('/__\(Disabled\)__/',$listeall[$key]))
|
||||
{
|
||||
$listeall[$key]=preg_replace('/__\(Disabled\)__/','('.$langs->transnoentitiesnoconv("Disabled").')',$listeall[$key]);
|
||||
unset($liste[$key]);
|
||||
}
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td width="16">'.img_picto_common($key,$objmodelexport->getPictoForKey($key)).'</td>';
|
||||
$text=$objmodelexport->getDriverDescForKey($key);
|
||||
print '<td>'.$form->textwithpicto($objmodelexport->getDriverLabelForKey($key),$text).'</td>';
|
||||
$label=$listeall[$key];
|
||||
print '<td>'.$form->textwithpicto($label,$text).'</td>';
|
||||
print '<td>'.$objmodelexport->getLibLabelForKey($key).'</td><td align="right">'.$objmodelexport->getLibVersionForKey($key).'</td></tr>'."\n";
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
@@ -129,11 +129,17 @@ $liste=$model->liste_modeles($db); // This is not a static method for exports
|
||||
$var=true;
|
||||
foreach($liste as $key => $val)
|
||||
{
|
||||
if (preg_match('/__\(Disabled\)__/',$liste[$key]))
|
||||
{
|
||||
$liste[$key]=preg_replace('/__\(Disabled\)__/','('.$langs->transnoentitiesnoconv("Disabled").')',$liste[$key]);
|
||||
}
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td width="16">'.img_picto_common($model->getDriverLabelForKey($key),$model->getPictoForKey($key)).'</td>';
|
||||
$text=$model->getDriverDescForKey($key);
|
||||
print '<td>'.$form->textwithpicto($model->getDriverLabelForKey($key),$text).'</td>';
|
||||
$label=$liste[$key];
|
||||
print '<td>'.$form->textwithpicto($label,$text).'</td>';
|
||||
print '<td>'.$model->getLibLabelForKey($key).'</td>';
|
||||
print '<td class="nowrap" align="right">'.$model->getLibVersionForKey($key).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
* \brief File that include conf.php file and commons lib like functions.lib.php
|
||||
*/
|
||||
|
||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.5.2');
|
||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.5.3');
|
||||
if (! defined('EURO')) define('EURO',chr(128));
|
||||
|
||||
// Define syslog constants
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -113,12 +114,23 @@ if ($sall)
|
||||
}
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
|
||||
if (GETPOST('statut'))
|
||||
//Required triple check because statut=0 means draft filter
|
||||
if (GETPOST('statut', 'int') !== '')
|
||||
{
|
||||
$sql .= " AND fk_statut =".GETPOST('statut','int');
|
||||
}
|
||||
|
||||
$sql.= " ORDER BY $sortfield $sortorder ";
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
@@ -133,7 +145,7 @@ if ($resql)
|
||||
if ($search_nom) $param.="&search_nom=".$search_nom;
|
||||
if ($search_user) $param.="&search_user=".$search_user;
|
||||
if ($search_ttc) $param.="&search_ttc=".$search_ttc;
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num);
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num,$nbtotalofrecords);
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||
* Copyright (C) 2005 Marc Barilley <marc@ocebo.fr>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
@@ -461,6 +461,7 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer)
|
||||
$db->commit();
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
$outputlangs = $langs;
|
||||
$result=supplier_invoice_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result <= 0)
|
||||
{
|
||||
@@ -1314,7 +1315,10 @@ if ($action == 'create')
|
||||
print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">';
|
||||
|
||||
$txt=$langs->trans($classname);
|
||||
if ($classname=='CommandeFournisseur') $txt=$langs->trans("SupplierOrder");
|
||||
if ($classname=='CommandeFournisseur') {
|
||||
$langs->load('orders');
|
||||
$txt=$langs->trans("SupplierOrder");
|
||||
}
|
||||
print '<tr><td>'.$txt.'</td><td colspan="2">'.$objectsrc->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('TotalHT').'</td><td colspan="2">'.price($objectsrc->total_ht).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('TotalVAT').'</td><td colspan="2">'.price($objectsrc->total_tva)."</td></tr>";
|
||||
@@ -1454,7 +1458,7 @@ else
|
||||
//TODO: Possibly will have to control payment information into suppliers
|
||||
//$object->date_lim_reglement=$object->calculate_date_lim_reglement();
|
||||
}
|
||||
$numref = $object->getNextNumRef($soc);
|
||||
$numref = $object->getNextNumRef($societe);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
|
||||
if (! $user->rights->facture->lire) accessforbidden();
|
||||
if (! $user->rights->fournisseur->facture->lire) accessforbidden();
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("bills");
|
||||
|
||||
@@ -169,6 +169,14 @@ if (GETPOST("search_montant_ttc"))
|
||||
$sql .= " AND fac.total_ttc = '".$db->escape(price2num(GETPOST("search_montant_ttc")))."'";
|
||||
}
|
||||
|
||||
$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($limit+1, $offset);
|
||||
|
||||
@@ -193,7 +201,7 @@ if ($resql)
|
||||
if (GETPOST("search_montant_ht")) $param.='&search_montant_ht='.urlencode(GETPOST("search_montant_ht"));
|
||||
if (GETPOST("search_montant_ttc")) $param.='&search_montant_ttc='.urlencode(GETPOST("search_montant_ttc"));
|
||||
|
||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->nom":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num);
|
||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->nom":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@@ -60,18 +60,18 @@ $cp = new Holiday($db);
|
||||
if ($action == "add")
|
||||
{
|
||||
$message = '';
|
||||
$error = false;
|
||||
$error = 0;
|
||||
|
||||
// Option du groupe de validation
|
||||
/*if (!$cp->updateConfCP('userGroup',$_POST['userGroup']))
|
||||
{
|
||||
$error = true;
|
||||
$error++;
|
||||
}*/
|
||||
|
||||
// Option du délai pour faire une demande de congés payés
|
||||
if (!$cp->updateConfCP('delayForRequest',$_POST['delayForRequest']))
|
||||
{
|
||||
$error = true;
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Option du nombre de jours à ajouter chaque mois
|
||||
@@ -79,67 +79,69 @@ if ($action == "add")
|
||||
|
||||
if(!$cp->updateConfCP('nbHolidayEveryMonth',$nbHolidayEveryMonth))
|
||||
{
|
||||
$error = true;
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Option du nombre de jours pour un mariage
|
||||
$OptMariageCP = price2num($_POST['OptMariage'],5);
|
||||
|
||||
if(!$cp->updateConfCP('OptMariage',$OptMariageCP)) {
|
||||
$error = true;
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Option du nombre de jours pour un décés d'un proche
|
||||
$OptDecesProcheCP = price2num($_POST['OptDecesProche'],5);
|
||||
|
||||
if(!$cp->updateConfCP('OptDecesProche',$OptDecesProcheCP)) {
|
||||
$error = true;
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Option du nombre de jours pour un mariage d'un enfant
|
||||
$OptMariageProcheCP = price2num($_POST['OptMariageProche'],5);
|
||||
|
||||
if(!$cp->updateConfCP('OptMariageProche',$OptMariageProcheCP)) {
|
||||
$error = true;
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Option du nombre de jours pour un décés d'un parent
|
||||
$OptDecesParentsCP = price2num($_POST['OptDecesParents'],5);
|
||||
|
||||
if(!$cp->updateConfCP('OptDecesParents',$OptDecesParentsCP)) {
|
||||
$error = true;
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Option pour avertir le valideur si délai de demande incorrect
|
||||
if(isset($_POST['AlertValidatorDelay'])) {
|
||||
if(!$cp->updateConfCP('AlertValidatorDelay','1')) {
|
||||
$error = true;
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
if(!$cp->updateConfCP('AlertValidatorDelay','0')) {
|
||||
$error = true;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
// Option pour avertir le valideur si solde des congés de l'utilisateur inccorect
|
||||
if(isset($_POST['AlertValidatorSolde'])) {
|
||||
if(!$cp->updateConfCP('AlertValidatorSolde','1')) {
|
||||
$error = true;
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
if(!$cp->updateConfCP('AlertValidatorSolde','0')) {
|
||||
$error = true;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
// Option du nombre de jours à déduire pour 1 jour de congés
|
||||
$nbHolidayDeducted = price2num($_POST['nbHolidayDeducted'],2);
|
||||
|
||||
if(!$cp->updateConfCP('nbHolidayDeducted',$nbHolidayDeducted)) {
|
||||
$error = true;
|
||||
if(!$cp->updateConfCP('nbHolidayDeducted',$nbHolidayDeducted))
|
||||
{
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
if ($error)
|
||||
{
|
||||
$message = '<div class="error">'.$langs->trans('ErrorUpdateConfCP').'</div>';
|
||||
} else {
|
||||
$message = '<div class="ok">'.$langs->trans('UpdateConfCPOK').'</div>';
|
||||
@@ -151,8 +153,8 @@ if ($action == "add")
|
||||
|
||||
$result = $db->query($sql);
|
||||
$num = $db->num_rows($sql);
|
||||
|
||||
if($num < 1) {
|
||||
if($num < 1)
|
||||
{
|
||||
$cp->createCPusers();
|
||||
$message.= '<br /><div class="warning">'.$langs->trans('AddCPforUsers').'</div>';
|
||||
}
|
||||
@@ -202,7 +204,7 @@ elseif ($action == 'create_event')
|
||||
}
|
||||
elseif($action == 'event' && isset($_POST['update_event']))
|
||||
{
|
||||
$error = false;
|
||||
$error = 0;
|
||||
|
||||
$eventId = array_keys($_POST['update_event']);
|
||||
$eventId = $eventId[0];
|
||||
@@ -213,19 +215,21 @@ elseif($action == 'event' && isset($_POST['update_event']))
|
||||
$eventValue = $optValue;
|
||||
$eventValue = $eventValue[$eventId];
|
||||
|
||||
if(!empty($eventName)) {
|
||||
if (!empty($eventName))
|
||||
{
|
||||
$eventName = trim($eventName);
|
||||
} else {
|
||||
$error = true;
|
||||
$error++;
|
||||
}
|
||||
|
||||
if(!empty($eventValue)) {
|
||||
if (!empty($eventValue))
|
||||
{
|
||||
$eventValue = price2num($eventValue,2);
|
||||
} else {
|
||||
$error = true;
|
||||
$error++;
|
||||
}
|
||||
|
||||
if(!$error)
|
||||
if (!$error)
|
||||
{
|
||||
// Mise à jour des congés de l'utilisateur
|
||||
$update = $cp->updateEventCP($eventId,$eventName,$eventValue);
|
||||
|
||||
@@ -82,7 +82,7 @@ if ($action == 'update' && isset($_POST['update_cp']))
|
||||
$sql.= " value = '".dol_print_date($now,'%Y%m%d%H%M%S')."'";
|
||||
$sql.= " WHERE name = 'lastUpdate' and value IS NULL"; // Add value IS NULL to be sure to update only at init.
|
||||
dol_syslog('define_holiday update lastUpdate entry sql='.$sql);
|
||||
$result = $db->query($sql);
|
||||
$result = $db->query($sql);
|
||||
|
||||
$mesg='<div class="ok">'.$langs->trans('UpdateConfCPOK').'</div>';
|
||||
|
||||
@@ -91,21 +91,24 @@ if ($action == 'update' && isset($_POST['update_cp']))
|
||||
}
|
||||
elseif($action == 'add_event')
|
||||
{
|
||||
$error = false;
|
||||
$error = 0;
|
||||
|
||||
if(!empty($_POST['list_event']) && $_POST['list_event'] > 0) {
|
||||
$event = $_POST['list_event'];
|
||||
} else { $error = true;
|
||||
} else { $error++;
|
||||
}
|
||||
|
||||
if(!empty($_POST['userCP']) && $_POST['userCP'] > 0) {
|
||||
$userCP = $_POST['userCP'];
|
||||
} else { $error = true;
|
||||
} else { $erro++;
|
||||
}
|
||||
|
||||
if($error) {
|
||||
if ($error)
|
||||
{
|
||||
$message = '<div class="error">'.$langs->trans('ErrorAddEventToUserCP').'</div>';
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$nb_holiday = $holiday->getCPforUser($userCP);
|
||||
$add_holiday = $holiday->getValueEventCp($event);
|
||||
$new_holiday = $nb_holiday + $add_holiday;
|
||||
|
||||
@@ -482,7 +482,7 @@ if ($step == 3 && $datatoimport)
|
||||
if ($action == 'delete')
|
||||
{
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?urlfile='.urlencode(GETPOST('urlfile')).'&step=3'.$param, $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
print '<table width="100%" class="border">';
|
||||
@@ -824,7 +824,7 @@ if ($step == 4 && $datatoimport)
|
||||
}
|
||||
|
||||
print "</div>\n";
|
||||
print "<!-- End box container -->\n";
|
||||
print "<!-- End box left container -->\n";
|
||||
|
||||
|
||||
print '</td><td width="50%">';
|
||||
|
||||
@@ -136,9 +136,15 @@ class Segment implements IteratorAggregate, Countable
|
||||
if (strpos($this->xml, $this->odf->getConfig('DELIMITER_LEFT') . $key . $this->odf->getConfig('DELIMITER_RIGHT')) === false) {
|
||||
throw new SegmentException("var $key not found in {$this->getName()}");
|
||||
}
|
||||
|
||||
$value=$this->odf->htmlToUTFAndPreOdf($value);
|
||||
|
||||
$value = $encode ? htmlspecialchars($value) : $value;
|
||||
$value = ($charset == 'ISO-8859') ? utf8_encode($value) : $value;
|
||||
$this->vars[$this->odf->getConfig('DELIMITER_LEFT') . $key . $this->odf->getConfig('DELIMITER_RIGHT')] = str_replace("\n", "<text:line-break/>", $value);
|
||||
|
||||
$value=$this->odf->preOdfToOdf($value);
|
||||
|
||||
$this->vars[$this->odf->getConfig('DELIMITER_LEFT') . $key . $this->odf->getConfig('DELIMITER_RIGHT')] = $value;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -122,12 +122,68 @@ class Odf
|
||||
throw new OdfException("var $key not found in the document");
|
||||
//}
|
||||
}
|
||||
|
||||
$value=$this->htmlToUTFAndPreOdf($value);
|
||||
|
||||
$value = $encode ? htmlspecialchars($value) : $value;
|
||||
$value = ($charset == 'ISO-8859') ? utf8_encode($value) : $value;
|
||||
$this->vars[$tag] = str_replace("\n", "<text:line-break/>", $value);
|
||||
|
||||
$value=$this->preOdfToOdf($value);
|
||||
|
||||
$this->vars[$tag] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to convert a HTML string into an ODT string
|
||||
*
|
||||
* @param string $value String to convert
|
||||
*/
|
||||
public function htmlToUTFAndPreOdf($value)
|
||||
{
|
||||
// We decode into utf8, entities
|
||||
$value=dol_html_entity_decode($value, ENT_QUOTES);
|
||||
|
||||
// We convert html tags
|
||||
$ishtml=dol_textishtml($value);
|
||||
if ($ishtml)
|
||||
{
|
||||
// If string is "MYPODUCT - Desc <strong>bold</strong> with é accent<br />\n<br />\nUn texto en español ?"
|
||||
// Result after clean must be "MYPODUCT - Desc bold with é accent\n\nUn texto en español ?"
|
||||
|
||||
// We want to ignore \n and we want all <br> to be \n
|
||||
$value=preg_replace('/(\r\n|\r|\n)/i','',$value);
|
||||
$value=preg_replace('/<br>/i',"\n",$value);
|
||||
$value=preg_replace('/<br\s+[^<>\/]*>/i',"\n",$value);
|
||||
$value=preg_replace('/<br\s+[^<>\/]*\/>/i',"\n",$value);
|
||||
|
||||
//$value=preg_replace('/<strong>/','__lt__text:p text:style-name=__quot__bold__quot____gt__',$value);
|
||||
//$value=preg_replace('/<\/strong>/','__lt__/text:p__gt__',$value);
|
||||
|
||||
$value=dol_string_nohtmltag($value, 0);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to convert a HTML string into an ODT string
|
||||
*
|
||||
* @param string $value String to convert
|
||||
*/
|
||||
public function preOdfToOdf($value)
|
||||
{
|
||||
$value = str_replace("\n", "<text:line-break/>", $value);
|
||||
|
||||
//$value = str_replace("__lt__", "<", $value);
|
||||
//$value = str_replace("__gt__", ">", $value);
|
||||
//$value = str_replace("__quot__", '"', $value);
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluating php codes inside the ODT and output the buffer (print, echo) inplace of the code
|
||||
*
|
||||
@@ -422,25 +478,25 @@ IMG;
|
||||
public function exportAsAttachedPDF($name="")
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
if( $name == "" ) $name = md5(uniqid());
|
||||
|
||||
dol_syslog(get_class($this).'::exportAsAttachedPDF $name='.$name, LOG_DEBUG);
|
||||
$this->saveToDisk($name);
|
||||
|
||||
$execmethod=(empty($conf->global->MAIN_EXEC_USE_POPEN)?1:2); // 1 or 2
|
||||
|
||||
|
||||
$name=str_replace('.odt', '', $name);
|
||||
if (!empty($conf->global->MAIN_DOL_SCRIPTS_ROOT)) {
|
||||
$command = $conf->global->MAIN_DOL_SCRIPTS_ROOT.'/scripts/odt2pdf/odt2pdf.sh '.$name;
|
||||
}else {
|
||||
$command = '../../scripts/odt2pdf/odt2pdf.sh '.$name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//$dirname=dirname($name);
|
||||
//$command = DOL_DOCUMENT_ROOT.'/includes/odtphp/odt2pdf.sh '.$name.' '.$dirname;
|
||||
|
||||
|
||||
dol_syslog(get_class($this).'::exportAsAttachedPDF $execmethod='.$execmethod.' Run command='.$command,LOG_DEBUG);
|
||||
if ($execmethod == 1)
|
||||
{
|
||||
@@ -482,7 +538,7 @@ IMG;
|
||||
} else {
|
||||
dol_syslog(get_class($this).'::exportAsAttachedPDF $ret_val='.$retval, LOG_DEBUG);
|
||||
dol_syslog(get_class($this).'::exportAsAttachedPDF $output_arr='.var_export($output_arr,true), LOG_DEBUG);
|
||||
|
||||
|
||||
if ($retval==126) {
|
||||
throw new OdfException('Permission execute convert script : ' . $command);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user