forked from Wavyzz/dolibarr
Compare commits
246 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92cace6747 | ||
|
|
40b63be4b9 | ||
|
|
47d0b6583e | ||
|
|
c0e719e3d8 | ||
|
|
d3c0414b4f | ||
|
|
2c0eeaf8de | ||
|
|
1da7b154c1 | ||
|
|
54fb59d8db | ||
|
|
e66b266432 | ||
|
|
f339719ae9 | ||
|
|
adb70e0456 | ||
|
|
c0481be8d8 | ||
|
|
19c616756a | ||
|
|
f2ae3ee41d | ||
|
|
054d98a2ba | ||
|
|
1420149b95 | ||
|
|
4c0dc21ca0 | ||
|
|
bc7bd77cea | ||
|
|
5d4eda68e0 | ||
|
|
94b1d59f2b | ||
|
|
f307fecaf6 | ||
|
|
6feacab4f5 | ||
|
|
4c8af0ff50 | ||
|
|
b154357683 | ||
|
|
3b9aee7d4c | ||
|
|
9f6118ed52 | ||
|
|
c947502efa | ||
|
|
dbb9caa196 | ||
|
|
764646634d | ||
|
|
0ae02d76a3 | ||
|
|
e9bf6ed4ce | ||
|
|
54228b4f98 | ||
|
|
58589b8454 | ||
|
|
387dd967e2 | ||
|
|
5adeaf9d76 | ||
|
|
205e715b7f | ||
|
|
79562f8d5b | ||
|
|
b5fe953a64 | ||
|
|
df22a311c2 | ||
|
|
9253fed754 | ||
|
|
c8c550cd33 | ||
|
|
8000777864 | ||
|
|
0bd45dc64b | ||
|
|
d99535d9da | ||
|
|
0f51aa15d8 | ||
|
|
22d92c0540 | ||
|
|
a1ac285a25 | ||
|
|
7e8fda2d71 | ||
|
|
301f509611 | ||
|
|
550fc37e62 | ||
|
|
a14a3db2e9 | ||
|
|
e4d37c3e23 | ||
|
|
b2feac9d90 | ||
|
|
762ab74940 | ||
|
|
9471495dca | ||
|
|
58470e0913 | ||
|
|
f6ff6610e4 | ||
|
|
c7798d11ce | ||
|
|
25390e5f73 | ||
|
|
2e6c036ad8 | ||
|
|
61efda4cbd | ||
|
|
1331e8add7 | ||
|
|
0abe19c30d | ||
|
|
bbcf70cf4e | ||
|
|
70e75753f8 | ||
|
|
3ac413084f | ||
|
|
3d4e6c9169 | ||
|
|
56bc0dbd25 | ||
|
|
31b5d9df52 | ||
|
|
de305cb3b2 | ||
|
|
59a89b250d | ||
|
|
1c7b99d3dc | ||
|
|
b650ba21c4 | ||
|
|
b70dd36ffa | ||
|
|
6a62e13960 | ||
|
|
62f895e2ec | ||
|
|
4a5988accb | ||
|
|
b1ce3fc5c8 | ||
|
|
4ba039d229 | ||
|
|
ae7f8c3fe4 | ||
|
|
dc930dd6c5 | ||
|
|
3f6b3b51ca | ||
|
|
6900771c70 | ||
|
|
ca8ae3c723 | ||
|
|
b1f98b5903 | ||
|
|
2821459894 | ||
|
|
a020dbf3d7 | ||
|
|
aaadc6e001 | ||
|
|
0db03cfbcc | ||
|
|
ab558ee5fa | ||
|
|
a2f4afbf88 | ||
|
|
46770178d2 | ||
|
|
ef9468f78a | ||
|
|
48499fb506 | ||
|
|
f2e429e28f | ||
|
|
4017d09613 | ||
|
|
fd85088a6c | ||
|
|
1d9d8980a9 | ||
|
|
d3150ede42 | ||
|
|
f18edd5787 | ||
|
|
7e69a31dd6 | ||
|
|
3a181a5d28 | ||
|
|
59aa49076c | ||
|
|
e4725f4248 | ||
|
|
033016da7f | ||
|
|
12d0928244 | ||
|
|
3db4d10fc0 | ||
|
|
60fc500fa8 | ||
|
|
3ddc582edd | ||
|
|
5128ad6e24 | ||
|
|
eb03f8f08e | ||
|
|
b671edb116 | ||
|
|
09d3db145b | ||
|
|
8dc3d7323d | ||
|
|
9b9b5adf66 | ||
|
|
08abb1490a | ||
|
|
8a5c53550b | ||
|
|
049a038f56 | ||
|
|
e526162e8e | ||
|
|
1b16eb731d | ||
|
|
1bdffa961f | ||
|
|
6de3a40546 | ||
|
|
5f71165020 | ||
|
|
04327189f7 | ||
|
|
c4b2c3e697 | ||
|
|
8e1a9064cb | ||
|
|
95fa183fac | ||
|
|
bfc476a118 | ||
|
|
c90ece1188 | ||
|
|
c70dff89dd | ||
|
|
340287f073 | ||
|
|
365639a6c0 | ||
|
|
44e5566ee5 | ||
|
|
38be224665 | ||
|
|
29568287ef | ||
|
|
5fae19b4d6 | ||
|
|
c7d0e917fb | ||
|
|
9cafb08759 | ||
|
|
03fd69c3b9 | ||
|
|
a832bbb348 | ||
|
|
5308acdcde | ||
|
|
b2effa7cc8 | ||
|
|
b7f26ea788 | ||
|
|
d2135fd139 | ||
|
|
acd2d0121d | ||
|
|
9fa6bfd1a5 | ||
|
|
359e82fd3e | ||
|
|
dbde97f25f | ||
|
|
f04af6c1b3 | ||
|
|
c194538609 | ||
|
|
883c9dbf99 | ||
|
|
d0ab117488 | ||
|
|
3071796bc3 | ||
|
|
fa1bb9d672 | ||
|
|
a9e4fcfdca | ||
|
|
780e8ce470 | ||
|
|
2e9952439e | ||
|
|
5fef6478a5 | ||
|
|
61798d1af0 | ||
|
|
4cbcf5189a | ||
|
|
38c770ffb3 | ||
|
|
07cd1fb3c2 | ||
|
|
2493c2468d | ||
|
|
306dcf3600 | ||
|
|
c2f84309db | ||
|
|
314c30f489 | ||
|
|
1e4844fd1c | ||
|
|
e1344eb97c | ||
|
|
219e58d0e4 | ||
|
|
356f36c5bf | ||
|
|
9a75cb466a | ||
|
|
dc5127e619 | ||
|
|
a9bfe0f48f | ||
|
|
5d6555b9dd | ||
|
|
3f360601af | ||
|
|
35182066a8 | ||
|
|
a6e4e4ddb0 | ||
|
|
c3c14277e1 | ||
|
|
42b7d80567 | ||
|
|
fde33594a2 | ||
|
|
7f28c9fff6 | ||
|
|
57a6ada2a3 | ||
|
|
5741d4d67d | ||
|
|
4b90510b82 | ||
|
|
924cf871a7 | ||
|
|
77b6ef7396 | ||
|
|
388b90a94c | ||
|
|
f789714f14 | ||
|
|
e195cf0b95 | ||
|
|
a2c80a704f | ||
|
|
b5196b7164 | ||
|
|
1a5bbef266 | ||
|
|
05683bbf61 | ||
|
|
90615a8682 | ||
|
|
36b4d50cff | ||
|
|
d421b90376 | ||
|
|
356525730d | ||
|
|
d29233f553 | ||
|
|
5703c704f9 | ||
|
|
50ed463b9f | ||
|
|
3889941406 | ||
|
|
0d38e154cf | ||
|
|
22a3721dda | ||
|
|
2636c2470b | ||
|
|
1ea6df14d0 | ||
|
|
fe3ce78ae4 | ||
|
|
27ace14fb7 | ||
|
|
6eb2204c2b | ||
|
|
1d9873e1a9 | ||
|
|
bc9b816719 | ||
|
|
825ceeaa8d | ||
|
|
864af9cc3b | ||
|
|
d453961afc | ||
|
|
7d4b43f368 | ||
|
|
d3a0cff30a | ||
|
|
52421406ce | ||
|
|
eb4a5f6570 | ||
|
|
e992e4bea5 | ||
|
|
13667e4850 | ||
|
|
b58df17545 | ||
|
|
a291919cf7 | ||
|
|
03544f783a | ||
|
|
6ea69f421f | ||
|
|
310bf4bde4 | ||
|
|
ec3a07cd52 | ||
|
|
63a363080e | ||
|
|
323a0d7d0d | ||
|
|
b7cf434ebd | ||
|
|
555b37411f | ||
|
|
bd68b94411 | ||
|
|
141df52dd6 | ||
|
|
fb3f1ef667 | ||
|
|
4755197503 | ||
|
|
59df957181 | ||
|
|
192dc43b87 | ||
|
|
91fbb4da41 | ||
|
|
a6879775bb | ||
|
|
01a3787664 | ||
|
|
3db101ffdd | ||
|
|
2b966e630b | ||
|
|
892798bf79 | ||
|
|
007783cf76 | ||
|
|
0de1b878bd | ||
|
|
777d2f7027 | ||
|
|
78645c718f | ||
|
|
0b271cca46 |
67
ChangeLog
67
ChangeLog
@@ -2,9 +2,51 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
***** ChangeLog for 6.0.5 compared to 6.0.4 *****
|
||||
FIX: security vulnerability reported by ADLab of Venustech
|
||||
CVE-2017-17897, CVE-2017-17898, CVE-2017-17899, CVE-2017-17900
|
||||
FIX: #7379: Compatibility with PRODUCT_USE_OLD_PATH_FOR_PHOTO variable
|
||||
FIX: #7903
|
||||
FIX: #7933
|
||||
FIX: #8029 Unable to make leave request in holyday module
|
||||
FIX: #8093
|
||||
FIX: Bad name alias showing in name of third column
|
||||
FIX: Cashdesk should not sell to inactive third parties
|
||||
FIX: Edit accountancy account and warning message on loan
|
||||
FIX: $accounts[$bid] is a label !
|
||||
FIX: $oldvatrateclean & $newvatrateclean must be set if preg_match === false
|
||||
FIX: product best price on product list
|
||||
FIX: search on contact list
|
||||
FIX: stats trad for customerinvoice
|
||||
FIX: translate unactivate on contractline
|
||||
FIX: email sent was not in HTML
|
||||
FIX: missing hook invoice index
|
||||
FIX: subject mail sepa
|
||||
|
||||
|
||||
***** ChangeLog for 6.0.4 compared to 6.0.3 *****
|
||||
FIX: #7737
|
||||
FIX: #7751
|
||||
FIX: #7756 Add better error message
|
||||
FIX: #7786
|
||||
FIX: #7806
|
||||
FIX: #7824
|
||||
FIX: add line bad price and ref
|
||||
FIX: A lot of several fix on local taxes and NPR tax
|
||||
FIX: createfromorder
|
||||
FIX: CSS for IE10
|
||||
FIX: external user cannot be set as internal
|
||||
FIX: Filter type on actioncomm with multiselect doesn't work
|
||||
FIX: list of donation not filtered on multicompany
|
||||
FIX: list of module not complete when module mb_strlen not available
|
||||
FIX: Locatax were not propagated when cloning order or proposal
|
||||
FIX: Searching translation should not be case sensitive
|
||||
FIX: Search into language is ok for file into external modules two.
|
||||
FIX: test for filter fk_status
|
||||
FIX: too much users on holiday list
|
||||
FIX: Wrong alias sql
|
||||
|
||||
***** ChangeLog for 6.0.3 compared to 6.0.2 *****
|
||||
|
||||
FIX: #7211 Update qty dispatched on qty change
|
||||
FIX: #7458
|
||||
FIX: #7593
|
||||
@@ -18,8 +60,7 @@ FIX: API to get object does not return data of linked objects
|
||||
FIX: Bad localtax apply
|
||||
FIX: Bad ressource list in popup in gantt view
|
||||
FIX: bankentries search conciliated if val 0
|
||||
FIX: hook formObjectOptions() must use $expe and not $object which i…
|
||||
FIX: hook formObjectOptions() must use $expe and not $object which is an order here
|
||||
FIX: hook formObjectOptions() must use $expe and not $object
|
||||
FIX: make of link to other object during creation
|
||||
FIX: Missing function getLinesArray
|
||||
FIX: old batch not shown in multi shipping
|
||||
@@ -32,7 +73,6 @@ FIX: wrong key in selectarray
|
||||
FIX: wrong personnal project time spent
|
||||
|
||||
***** ChangeLog for 6.0.2 compared to 6.0.1 *****
|
||||
|
||||
FIX: #7148
|
||||
FIX: #7288
|
||||
FIX: #7366 renaming table with pgsql
|
||||
@@ -66,7 +106,6 @@ FIX: wrong basePath in the swagger view
|
||||
FIX: Implementation of a Luracast recommandation for the REST api server
|
||||
|
||||
***** ChangeLog for 6.0.1 compared to 6.0.* *****
|
||||
|
||||
FIX: #7000 Dashboard link for late pending payment supplier invoices do not work
|
||||
FIX: #7325 Default VAT rate when editing template invoices is 0%
|
||||
FIX: #7330
|
||||
@@ -108,7 +147,6 @@ FIX: CVE-2017-9840, CVE-2017-14238, CVE-2017-14239, CVE-2017-14240, CVE-2017-142
|
||||
CVE-2017-14242
|
||||
|
||||
***** ChangeLog for 6.0.0 compared to 5.0.* *****
|
||||
|
||||
NEW: Add experimental BlockeLog module (to log business events in a non reversible log file).
|
||||
NEW: Add a payment module for Stripe.
|
||||
NEW: Add module "Product variant" (like red, blue for the product shoes)
|
||||
@@ -257,6 +295,23 @@ Following changes may create regression for some external modules, but were nece
|
||||
content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow
|
||||
hook specifications so you must return output into "resprint".
|
||||
|
||||
|
||||
***** ChangeLog for 5.0.7 compared to 5.0.6 *****
|
||||
FIX: #7000 Dashboard link for late pending payment supplier invoices do not work
|
||||
FIX: #7148
|
||||
FIX: #7325 Default VAT rate when editing template invoices is 0%
|
||||
FIX: #7366 renaming table with pgsql
|
||||
FIX: #7391
|
||||
FIX: #7510 Bug: extrafield content disappear when generate pdf within intervention
|
||||
FIX: Agenda events are not exported in the ICAL, VCAL if begin exactly with the same $datestart
|
||||
FIX: Bad link to unpayed suppliers invoices
|
||||
FIX: bankentries search conciliated if val 0
|
||||
FIX: multicompany better accuracy in rounding and with revenue stamp.
|
||||
FIX: PDF output was sharing 2 different currencies in same total
|
||||
FIX: Upgrade missing on field
|
||||
FIX: wrong key in selectarray
|
||||
FIX: wrong personnal project time spent
|
||||
|
||||
***** ChangeLog for 5.0.6 compared to 5.0.5 *****
|
||||
FIX: Removed a bad symbolic link into custom directory.
|
||||
FIX: Renaming a resource ref rename also the directory of attached files.
|
||||
|
||||
@@ -353,7 +353,7 @@ begin
|
||||
begin
|
||||
// TODO Copy file or ask to install package ?
|
||||
//CustomMessage('YouWillInstallDoliWamp')+#13#13
|
||||
MsgBox('The package vcredist_x86.exe must have been installed first. It seems it is not. Please install it first from <a href="http://www.microsoft.com/en-us/download/details.aspx?id=30679">http://www.microsoft.com/en-us/download/details.aspx?id=30679</a> then restart DoliWamp installation/upgrade.',mbInformation,MB_OK);
|
||||
MsgBox('The Visual C++ Redistributable package should be installed, it seems it is not. Please install the 32-bit version from http://www.microsoft.com/en-us/download/details.aspx?id=30679, then restart the DoliWAMP installation/upgrade.',mbInformation,MB_OK);
|
||||
end;
|
||||
// Pb seems similar with msvcp110.dll
|
||||
//vcredist_x64.exe
|
||||
|
||||
@@ -131,7 +131,7 @@ $iterator1 = new RecursiveIteratorIterator($dir_iterator1);
|
||||
$files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
|
||||
*/
|
||||
$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
|
||||
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install)$'; // Exclude dirs
|
||||
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
|
||||
$files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
|
||||
$dir='';
|
||||
$needtoclose=0;
|
||||
|
||||
@@ -19,7 +19,7 @@ use Term::ANSIColor;
|
||||
# Change this to defined target for option 98 and 99
|
||||
$PROJECT="dolibarr";
|
||||
$PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
|
||||
$PUBLISHBETARC="ldestailleur\@vmprod.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
|
||||
$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
|
||||
|
||||
|
||||
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||
@@ -556,9 +556,6 @@ if ($nboftargetok) {
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.pl`; # Avoid errors into rpmlint
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/template`; # Package not valid for most linux distributions (errors reported into compile.js). Package should be embed by modules to avoid problems.
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpmailer`; # Package not valid for most linux distributions (errors reported into file LICENSE). Package should be embed by modules to avoid problems.
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries
|
||||
#$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball
|
||||
@@ -571,6 +568,7 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/.gitmodules`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/parsedown/LICENSE.txt`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/.gitattributes`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/license.md`;
|
||||
@@ -579,6 +577,7 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Examples`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/unitTests`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/ae_fonts_*`;
|
||||
@@ -590,6 +589,8 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
|
||||
|
||||
|
||||
print "Remove subdir of custom dir\n";
|
||||
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
|
||||
|
||||
@@ -99,7 +99,7 @@ JQUERYFILETREE:
|
||||
RESTLER:
|
||||
--------
|
||||
|
||||
* Add 2 lines into function
|
||||
* Add 2 lines into file AutoLoader.php to complete function
|
||||
private function alias($className, $currentClass)
|
||||
{
|
||||
...
|
||||
@@ -110,4 +110,25 @@ to get
|
||||
if ($className == 'Luracast\Restler\string') return;
|
||||
if ($className == 'Luracast\Restler\mixed') return;
|
||||
...
|
||||
|
||||
|
||||
|
||||
PARSEDOWN
|
||||
---------
|
||||
|
||||
* Fix to avoid fatal error when mb_strlen not available:
|
||||
|
||||
// @CHANGE LDR Fix when mb_strlen is not available
|
||||
//$shortage = 4 - mb_strlen($line, 'utf-8') % 4;
|
||||
if (function_exists('mb_strlen')) $len = mb_strlen($line, 'utf-8');
|
||||
else $len = strlen($line);
|
||||
$shortage = 4 - $len % 4;
|
||||
|
||||
|
||||
|
||||
JEDITABLE.JS
|
||||
------------
|
||||
|
||||
* <button type="submit" /> => <button class="button" type="submit" />
|
||||
* <button type="cancel" /> => <button class="button" type="cancel" />
|
||||
|
||||
|
||||
|
||||
@@ -631,7 +631,7 @@ if ($action == 'create') {
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
if ($total_debit != $total_credit)
|
||||
if (price2num($total_debit) != price2num($total_credit))
|
||||
{
|
||||
setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_credit, $total_debit)), 'warnings');
|
||||
}
|
||||
|
||||
@@ -85,6 +85,9 @@ if ($user->societe_id > 0)
|
||||
if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('accountancycustomerlist'));
|
||||
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$accounting = new AccountingAccount($db);
|
||||
$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1);
|
||||
@@ -98,26 +101,33 @@ $aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOU
|
||||
if (GETPOST('cancel')) { $action='list'; $massaction=''; }
|
||||
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
$search_lineid = '';
|
||||
$search_ref = '';
|
||||
$search_invoice = '';
|
||||
$search_label = '';
|
||||
$search_desc = '';
|
||||
$search_amount = '';
|
||||
$search_account = '';
|
||||
$search_vat = '';
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$search_lineid = '';
|
||||
$search_ref = '';
|
||||
$search_invoice = '';
|
||||
$search_label = '';
|
||||
$search_desc = '';
|
||||
$search_amount = '';
|
||||
$search_account = '';
|
||||
$search_vat = '';
|
||||
}
|
||||
|
||||
// Mass actions
|
||||
$objectclass='AccountingAccount';
|
||||
$permtoread = $user->rights->accounting->read;
|
||||
$permtodelete = $user->rights->accounting->delete;
|
||||
$uploaddir = $conf->accounting->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
|
||||
// Mass actions
|
||||
$objectclass='Skeleton';
|
||||
$objectlabel='Skeleton';
|
||||
$permtoread = $user->rights->accounting->read;
|
||||
$permtodelete = $user->rights->accounting->delete;
|
||||
$uploaddir = $conf->accounting->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
if ($massaction == 'ventil') {
|
||||
$msg='';
|
||||
@@ -182,6 +192,9 @@ $sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype,";
|
||||
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
|
||||
$sql .= " aa.rowid as aarowid";
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
@@ -223,6 +236,11 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
}
|
||||
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
|
||||
@@ -85,6 +85,9 @@ if ($user->societe_id > 0)
|
||||
if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('accountancysupplierlist'));
|
||||
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$accounting = new AccountingAccount($db);
|
||||
// TODO: we should need to check if result is a really exist accountaccount rowid.....
|
||||
@@ -99,26 +102,32 @@ $aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUN
|
||||
if (GETPOST('cancel')) { $action='list'; $massaction=''; }
|
||||
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$search_lineid = '';
|
||||
$search_ref = '';
|
||||
$search_invoice = '';
|
||||
$search_label = '';
|
||||
$search_desc = '';
|
||||
$search_amount = '';
|
||||
$search_account = '';
|
||||
$search_vat = '';
|
||||
}
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
// Mass actions
|
||||
$objectclass='Skeleton';
|
||||
$objectlabel='Skeleton';
|
||||
$permtoread = $user->rights->accounting->read;
|
||||
$permtodelete = $user->rights->accounting->delete;
|
||||
$uploaddir = $conf->accounting->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
if (empty($reshook))
|
||||
{
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$search_lineid = '';
|
||||
$search_ref = '';
|
||||
$search_invoice = '';
|
||||
$search_label = '';
|
||||
$search_desc = '';
|
||||
$search_amount = '';
|
||||
$search_account = '';
|
||||
$search_vat = '';
|
||||
}
|
||||
|
||||
// Mass actions
|
||||
$objectclass='AccountingAccount';
|
||||
$permtoread = $user->rights->accounting->read;
|
||||
$permtodelete = $user->rights->accounting->delete;
|
||||
$uploaddir = $conf->accounting->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
|
||||
if ($massaction == 'ventil') {
|
||||
$msg='';
|
||||
@@ -184,6 +193,9 @@ $sql = "SELECT f.rowid as facid, f.ref, f.ref_supplier, f.libelle as invoice_lab
|
||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht as price, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod,";
|
||||
$sql.= " aa.rowid as aarowid";
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
@@ -220,6 +232,11 @@ if (strlen(trim($search_vat))) {
|
||||
}
|
||||
$sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
|
||||
@@ -15,6 +15,15 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC;
|
||||
$format = $conf->global->ACCOUNTING_EXPORT_FORMAT;
|
||||
$nodateexport = $conf->global->ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME;
|
||||
|
||||
@@ -14,8 +14,15 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE ADHERENTCARD_CREATE.TPL.PHP DEFAULT -->
|
||||
|
||||
@@ -14,9 +14,16 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$contact = $GLOBALS['objcanvas']->control->object;
|
||||
|
||||
?>
|
||||
|
||||
@@ -14,10 +14,18 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$contact = $GLOBALS['objcanvas']->control->object;
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE ADHERENTCARD_VIEW.TPL.PHP DEFAULT -->
|
||||
|
||||
@@ -36,7 +36,7 @@ $langs->load("users");
|
||||
if (!$user->rights->adherent->lire)
|
||||
accessforbidden();
|
||||
|
||||
$rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"];
|
||||
$rowid=GETPOST("rowid",'int');
|
||||
|
||||
|
||||
|
||||
@@ -44,10 +44,10 @@ $rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"];
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
llxHeader();
|
||||
|
||||
$object = new Subscription($db);
|
||||
$result = $object->fetch($rowid);
|
||||
|
||||
|
||||
@@ -15,8 +15,15 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE -->
|
||||
@@ -33,7 +40,7 @@ $var=true;
|
||||
$total=0;
|
||||
foreach($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
|
||||
|
||||
?>
|
||||
<tr <?php echo $GLOBALS['bc'][$var]; ?> >
|
||||
<td><?php echo $langs->trans("Subscription"); ?></td>
|
||||
|
||||
@@ -212,7 +212,7 @@ if ($xml)
|
||||
|
||||
// Defined qualified files (must be same than into generate_filelist_xml.php)
|
||||
$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
|
||||
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install)$'; // Exclude dirs
|
||||
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
|
||||
$scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude);
|
||||
|
||||
// Fill file_list with files in signature, new files, modified files
|
||||
|
||||
@@ -338,6 +338,9 @@ if ($mode == 'searchkey')
|
||||
|
||||
$recordtoshow=array();
|
||||
|
||||
// Search modules dirs
|
||||
$modulesdir = dolGetModulesDirs();
|
||||
|
||||
$nbempty=0;
|
||||
/*var_dump($langcode);
|
||||
var_dump($transkey);
|
||||
@@ -351,29 +354,38 @@ if ($mode == 'searchkey')
|
||||
}
|
||||
else
|
||||
{
|
||||
// Load all translations keys
|
||||
foreach($conf->file->dol_document_root as $keydir => $searchdir)
|
||||
// Search into dir of modules (the $modulesdir is already a list that loop on $conf->file->dol_document_root)
|
||||
foreach($modulesdir as $keydir => $tmpsearchdir)
|
||||
{
|
||||
// Directory of translation files
|
||||
$dir_lang = $searchdir."/langs/".$langcode;
|
||||
$dir_lang_osencoded=dol_osencode($dir_lang);
|
||||
$searchdir = $tmpsearchdir; // $searchdir can be '.../htdocs/core/modules/' or '.../htdocs/custom/mymodule/core/modules/'
|
||||
|
||||
$filearray=dol_dir_list($dir_lang_osencoded,'files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1);
|
||||
// Directory of translation files
|
||||
$dir_lang = dirname(dirname($searchdir))."/langs/".$langcode; // The 2 dirname is to go up in dir for 2 levels
|
||||
$dir_lang_osencoded=dol_osencode($dir_lang);
|
||||
|
||||
foreach($filearray as $file)
|
||||
{
|
||||
$tmpfile=preg_replace('/.lang/i', '', basename($file['name']));
|
||||
$newlang->load($tmpfile, 0, 0, '', 0); // Load translation files + database overwrite
|
||||
$newlangfileonly->load($tmpfile, 0, 0, '', 1); // Load translation files only
|
||||
//print 'After loading lang '.$tmpfile.', newlang has '.count($newlang->tab_translate).' records<br>'."\n";
|
||||
}
|
||||
$filearray=dol_dir_list($dir_lang_osencoded,'files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1);
|
||||
foreach($filearray as $file)
|
||||
{
|
||||
$tmpfile=preg_replace('/.lang/i', '', basename($file['name']));
|
||||
//Detect if trans coming from extranl module
|
||||
foreach ($conf->file->dol_document_root as $keyconf=>$dirconfalt) {
|
||||
if (($keyconf!='main') && (preg_match('$'.preg_quote($dirconfalt).'$i', $file['fullname']))) {
|
||||
//In this case load modulename@nmodulename
|
||||
$tmpfile=$tmpfile.'@'.$tmpfile;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$newlang->load($tmpfile, 0, 0, '', 0); // Load translation files + database overwrite
|
||||
$newlangfileonly->load($tmpfile, 0, 0, '', 1); // Load translation files only
|
||||
//print 'After loading lang '.$tmpfile.', newlang has '.count($newlang->tab_translate).' records<br>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Now search into translation array
|
||||
foreach($newlang->tab_translate as $key => $val)
|
||||
{
|
||||
if ($transkey && ! preg_match('/'.preg_quote($transkey).'/', $key)) continue;
|
||||
if ($transvalue && ! preg_match('/'.preg_quote($transvalue).'/', $val)) continue;
|
||||
if ($transkey && ! preg_match('/'.preg_quote($transkey).'/i', $key)) continue;
|
||||
if ($transvalue && ! preg_match('/'.preg_quote($transvalue).'/i', $val)) continue;
|
||||
$recordtoshow[$key]=$val;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class Login
|
||||
*
|
||||
* Request the API token for a couple username / password.
|
||||
* Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass into server log file).
|
||||
* Both methods are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "api_key" into field at the top right of page (Note: "api_key" can be found/set on the user page).
|
||||
* Both methods are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "DOLAPIKEY" into field at the top right of page. Note: Tha API key (DOLAPIKEY) can be found/set on the user page.
|
||||
*
|
||||
* @param string $login User login
|
||||
* @param string $password User password
|
||||
|
||||
@@ -128,7 +128,7 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' |
|
||||
foreach ($modulesdir as $dir)
|
||||
{
|
||||
// Search available module
|
||||
dol_syslog("Scan directory ".$dir." for module descriptor to after search for API files");
|
||||
dol_syslog("Scan directory ".$dir." for module descriptor files, then search for API files");
|
||||
|
||||
$handle=@opendir(dol_osencode($dir));
|
||||
if (is_resource($handle))
|
||||
@@ -139,14 +139,14 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' |
|
||||
{
|
||||
$module = strtolower($regmod[1]);
|
||||
$moduledirforclass = getModuleDirForApiClass($module);
|
||||
$moduleforperm = $module;
|
||||
if ($module == 'propale') { $moduleforperm='propal'; }
|
||||
$modulenameforenabled = $module;
|
||||
if ($module == 'propale') { $modulenameforenabled='propal'; }
|
||||
|
||||
//dol_syslog("Found module file ".$file." - module=".$module." - moduledirforclass=".$moduledirforclass);
|
||||
dol_syslog("Found module file ".$file." - module=".$module." - moduledirforclass=".$moduledirforclass);
|
||||
|
||||
// Defined if module is enabled
|
||||
$enabled=true;
|
||||
if (empty($conf->$moduleforperm->enabled)) $enabled=false;
|
||||
if (empty($conf->$modulenameforenabled->enabled)) $enabled=false;
|
||||
|
||||
if ($enabled)
|
||||
{
|
||||
@@ -235,7 +235,13 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/resources.json'
|
||||
if ($module == 'order') { $classname='Commande'; }
|
||||
//var_dump($classfile);var_dump($classname);exit;
|
||||
|
||||
require_once $dir_part_file;
|
||||
$res = include_once $dir_part_file;
|
||||
if (! $res)
|
||||
{
|
||||
print 'API not found (failed to include API file)';
|
||||
header('HTTP/1.1 501 API not found (failed to include API file)');
|
||||
exit(0);
|
||||
}
|
||||
if (class_exists($classname.'Api')) $api->r->addAPIClass($classname.'Api', '/');
|
||||
}
|
||||
else
|
||||
@@ -246,7 +252,14 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/resources.json'
|
||||
$dir_part_file = dol_buildpath('/'.$moduledirforclass.'/class/api_'.$classfile.'.class.php');
|
||||
$classname=ucwords($module);
|
||||
|
||||
require_once $dir_part_file;
|
||||
$res = include_once $dir_part_file;
|
||||
if (! $res)
|
||||
{
|
||||
print 'API not found (failed to include API file)';
|
||||
header('HTTP/1.1 501 API not found (failed to include API file)');
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (class_exists($classname)) $api->r->addAPIClass($classname);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -103,7 +103,7 @@ print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,0,1,array(),0);
|
||||
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3) AND s.status = 1',1,0,1,array(),0);
|
||||
print '</td></tr>';
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
|
||||
@@ -114,10 +114,13 @@ switch($action)
|
||||
{
|
||||
if (count($prodcustprice->lines) > 0)
|
||||
{
|
||||
$pu_ht = price($prodcustprice->lines [0]->price);
|
||||
$pu_ttc = price($prodcustprice->lines [0]->price_ttc);
|
||||
$price_base_type = $prodcustprice->lines [0]->price_base_type;
|
||||
$tva_tx = $prodcustprice->lines [0]->tva_tx;
|
||||
$pu_ht = price($prodcustprice->lines[0]->price);
|
||||
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
||||
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
||||
$tva_tx = $prodcustprice->lines[0]->tva_tx;
|
||||
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
|
||||
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
|
||||
if (empty($tva_tx)) $tva_npr=0;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -105,7 +105,7 @@ print '<td>';
|
||||
$disabled=0;
|
||||
$langs->load("companies");
|
||||
if (! empty($conf->global->CASHDESK_ID_THIRDPARTY)) $disabled=1; // If a particular third party is defined, we disable choice
|
||||
print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):$conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',!$disabled,$disabled,1);
|
||||
print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):$conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3) AND s.status = 1',!$disabled,$disabled,1);
|
||||
//print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -19,6 +19,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($langs) || ! is_object($langs))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$langs->load("main");
|
||||
$langs->load("bills");
|
||||
$langs->load("cashdesk");
|
||||
|
||||
@@ -17,6 +17,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($langs) || ! is_object($langs))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
* Copyright (C) 2008-2010 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2017 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -19,6 +19,14 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($langs) || ! is_object($langs))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||
@@ -71,7 +79,7 @@ print '<li class="menu_choix0">'.$langs->trans("User").': '.$_SESSION['firstname
|
||||
print ' <a href="deconnexion.php">'.img_picto($langs->trans('Logout'), 'logout.png').'</a><br>';
|
||||
print '<form id="frmThirdparty" class="formulaire1 inline-block" method="post" action="facturation_verif.php?action=change_thirdparty">';
|
||||
print $langs->trans("CashDeskThirdParty").': ';
|
||||
print $form->select_company($_SESSION["CASHDESK_ID_THIRDPARTY"], 'CASHDESK_ID_THIRDPARTY', 's.client IN (1,3)', '', 0, 0, null, 0, 'valignmiddle inline-block');
|
||||
print $form->select_company($_SESSION["CASHDESK_ID_THIRDPARTY"], 'CASHDESK_ID_THIRDPARTY', 's.client IN (1,3) AND s.status = 1', '', 0, 0, null, 0, 'valignmiddle inline-block');
|
||||
print '<input class="button bouton_change_thirdparty inline-block valignmiddle" type="submit" id="bouton_change_thirdparty" value="'.$langs->trans("Modify").'">';
|
||||
//print $companyLink;
|
||||
print '<br>';
|
||||
|
||||
@@ -16,6 +16,15 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($langs) || ! is_object($langs))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
|
||||
$langs->load("main");
|
||||
|
||||
@@ -16,6 +16,14 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($langs) || ! is_object($langs))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$langs->load("main");
|
||||
$langs->load("bills");
|
||||
$langs->load("banks");
|
||||
|
||||
@@ -17,6 +17,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($langs) || ! is_object($langs))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$langs->load("main");
|
||||
$langs->load("bills");
|
||||
|
||||
|
||||
@@ -1329,6 +1329,8 @@ if ($id > 0)
|
||||
print '</div>';
|
||||
if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))
|
||||
{
|
||||
//var_dump($object->userassigned);
|
||||
//var_dump($listofuserid);
|
||||
print '<div class="myavailability">';
|
||||
print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
|
||||
print '</div>';
|
||||
|
||||
@@ -225,11 +225,11 @@ class ActionComm extends CommonObject
|
||||
if ($this->elementtype=='commande') $this->elementtype='order';
|
||||
if ($this->elementtype=='contrat') $this->elementtype='contract';
|
||||
|
||||
if (! is_array($this->userassigned) && ! empty($this->userassigned)) // For backward compatibility
|
||||
if (! is_array($this->userassigned) && ! empty($this->userassigned)) // For backward compatibility when userassigned was an int instead fo array
|
||||
{
|
||||
$tmpid=$this->userassigned;
|
||||
$this->userassigned=array();
|
||||
$this->userassigned[$tmpid]=array('id'=>$tmpid);
|
||||
$this->userassigned[$tmpid]=array('id'=>$tmpid, 'transparency'=>$this->transparency);
|
||||
}
|
||||
|
||||
if (is_object($this->contact) && isset($this->contact->id) && $this->contact->id > 0 && ! ($this->contactid > 0)) $this->contactid = $this->contact->id; // For backward compatibility. Using this->contact->xx is deprecated
|
||||
@@ -240,7 +240,7 @@ class ActionComm extends CommonObject
|
||||
|
||||
// Be sure assigned user is defined as an array of array('id'=>,'mandatory'=>,...).
|
||||
if (empty($this->userassigned) || count($this->userassigned) == 0 || ! is_array($this->userassigned))
|
||||
$this->userassigned = array($userownerid=>array('id'=>$userownerid));
|
||||
$this->userassigned = array($userownerid=>array('id'=>$userownerid, 'transparency'=>$this->transparency));
|
||||
|
||||
if (! $this->type_id || ! $this->type_code)
|
||||
{
|
||||
|
||||
@@ -297,7 +297,11 @@ if ($status == 'done') $title=$langs->trans("DoneActions");
|
||||
if ($status == 'todo') $title=$langs->trans("ToDoActions");
|
||||
|
||||
$param='';
|
||||
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode;
|
||||
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) {
|
||||
if(is_array($actioncode)) {
|
||||
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
|
||||
} else $param.="&actioncode=".$actioncode;
|
||||
}
|
||||
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
|
||||
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
|
||||
if ($filter) $param.="&filter=".$filter;
|
||||
@@ -482,7 +486,14 @@ if (! empty($actioncode))
|
||||
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'";
|
||||
else
|
||||
{
|
||||
$sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')";
|
||||
if (is_array($actioncode))
|
||||
{
|
||||
$sql.=" AND ca.code IN ('".implode("','", $actioncode)."')";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.=" AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +169,11 @@ $listofextcals=array();
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
if ($actioncode != '') $param.="&actioncode=".$actioncode;
|
||||
if ($actioncode != '') {
|
||||
if(is_array($actioncode)) {
|
||||
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
|
||||
} else $param.="&actioncode=".$actioncode;
|
||||
}
|
||||
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
|
||||
if ($status != '' && $status > -1) $param.="&status=".$status;
|
||||
if ($filter) $param.="&filter=".$filter;
|
||||
@@ -227,7 +231,14 @@ if (! empty($actioncode))
|
||||
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND c.type = 'systemauto'";
|
||||
else
|
||||
{
|
||||
$sql.=" AND c.code IN ('".implode("','", explode(',',$actioncode))."')";
|
||||
if (is_array($actioncode))
|
||||
{
|
||||
$sql.=" AND c.code IN ('".implode("','", $actioncode)."')";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.=" AND c.code IN ('".implode("','", explode(',', $actioncode))."')";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,7 +203,11 @@ if ($status == 'done') $title=$langs->trans("DoneActions");
|
||||
if ($status == 'todo') $title=$langs->trans("ToDoActions");
|
||||
|
||||
$param='';
|
||||
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode;
|
||||
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) {
|
||||
if(is_array($actioncode)) {
|
||||
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
|
||||
} else $param.="&actioncode=".$actioncode;
|
||||
}
|
||||
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
|
||||
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
|
||||
if ($filter) $param.="&filter=".$filter;
|
||||
@@ -394,7 +398,14 @@ if (! empty($actioncode))
|
||||
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'";
|
||||
else
|
||||
{
|
||||
$sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')";
|
||||
if (is_array($actioncode))
|
||||
{
|
||||
$sql.=" AND ca.code IN ('".implode("','", $actioncode)."')";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.=" AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
$langs->load("orders");
|
||||
$langs->load("companies");
|
||||
|
||||
$_socid = $_GET["id"];
|
||||
$id = GETPOST('id','int');
|
||||
$_socid = GETPOST("id",'int');
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
@@ -45,10 +46,10 @@ if ($user->societe_id > 0)
|
||||
if ($_POST["action"] == 'setpricelevel')
|
||||
{
|
||||
$soc = New Societe($db);
|
||||
$soc->fetch($_GET["id"]);
|
||||
$soc->fetch($id);
|
||||
$soc->set_price_level($_POST["price_level"],$user);
|
||||
|
||||
header("Location: multiprix.php?id=".$_GET["id"]);
|
||||
header("Location: multiprix.php?id=".$id);
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -87,7 +88,7 @@ if ($_socid > 0)
|
||||
print '<form method="POST" action="multiprix.php?id='.$objsoc->id.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="setpricelevel">';
|
||||
|
||||
|
||||
dol_fiche_head($head, $tabchoice, $langs->trans("ThirdParty"), 0, 'company');
|
||||
|
||||
print '<table width="100%" border="0">';
|
||||
@@ -122,12 +123,12 @@ if ($_socid > 0)
|
||||
print "</table>";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
print '<div align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||
|
||||
print "</form>";
|
||||
|
||||
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
|
||||
|
||||
@@ -805,6 +805,9 @@ if (empty($reshook))
|
||||
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
||||
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
||||
$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx . ' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
|
||||
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
|
||||
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
|
||||
if (empty($tva_tx)) $tva_npr=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -864,13 +867,33 @@ if (empty($reshook))
|
||||
// Add custom code and origin country into description
|
||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
|
||||
{
|
||||
$tmptxt = '(';
|
||||
if (! empty($prod->customcode))
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
||||
$tmptxt .= ' - ';
|
||||
if (! empty($prod->country_code))
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
|
||||
// Define output language
|
||||
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
if (empty($newlang) && GETPOST('lang_id','alpha'))
|
||||
$newlang = GETPOST('lang_id','alpha');
|
||||
if (empty($newlang))
|
||||
$newlang = $object->thirdparty->default_lang;
|
||||
if (! empty($newlang)) {
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
$outputlangs->load('products');
|
||||
}
|
||||
if (! empty($prod->customcode))
|
||||
$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
||||
$tmptxt .= ' - ';
|
||||
if (! empty($prod->country_code))
|
||||
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0);
|
||||
} else {
|
||||
if (! empty($prod->customcode))
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
||||
$tmptxt .= ' - ';
|
||||
if (! empty($prod->country_code))
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
|
||||
}
|
||||
$tmptxt .= ')';
|
||||
$desc = dol_concatdesc($desc, $tmptxt);
|
||||
}
|
||||
|
||||
@@ -371,12 +371,12 @@ class Propal extends CommonObject
|
||||
* by whose calling the method get_default_tva (societe_vendeuse, societe_acheteuse, '' product)
|
||||
* and desc must already have the right value (it's up to the caller to manage multilanguage)
|
||||
*
|
||||
* @param string $desc Description de la ligne
|
||||
* @param float $pu_ht Prix unitaire
|
||||
* @param float $qty Quantite
|
||||
* @param float $txtva Taux de tva
|
||||
* @param float $txlocaltax1 Local tax 1 rate
|
||||
* @param float $txlocaltax2 Local tax 2 rate
|
||||
* @param string $desc Description of line
|
||||
* @param float $pu_ht Unit price
|
||||
* @param float $qty Quantity
|
||||
* @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
|
||||
* @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
|
||||
* @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
|
||||
* @param int $fk_product Id du produit/service predefini
|
||||
* @param float $remise_percent Pourcentage de remise de la ligne
|
||||
* @param string $price_base_type HT or TTC
|
||||
@@ -836,8 +836,9 @@ class Propal extends CommonObject
|
||||
if (empty($this->availability_id)) $this->availability_id=0;
|
||||
if (empty($this->demand_reason_id)) $this->demand_reason_id=0;
|
||||
|
||||
// Multicurrency
|
||||
if (!empty($this->multicurrency_code)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date);
|
||||
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
|
||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date);
|
||||
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||
if (empty($this->fk_multicurrency))
|
||||
{
|
||||
$this->multicurrency_code = $conf->currency;
|
||||
@@ -1017,11 +1018,15 @@ class Propal extends CommonObject
|
||||
$fk_parent_line = 0;
|
||||
}
|
||||
|
||||
// Complete vat rate with code
|
||||
$vatrate = $this->lines[$i]->tva_tx;
|
||||
if ($this->lines[$i]->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$this->lines[$i]->vat_src_code.')';
|
||||
|
||||
$result = $this->addline(
|
||||
$this->lines[$i]->desc,
|
||||
$this->lines[$i]->subprice,
|
||||
$this->lines[$i]->qty,
|
||||
$this->lines[$i]->tva_tx,
|
||||
$vatrate,
|
||||
$this->lines[$i]->localtax1_tx,
|
||||
$this->lines[$i]->localtax2_tx,
|
||||
$this->lines[$i]->fk_product,
|
||||
@@ -1226,7 +1231,6 @@ class Propal extends CommonObject
|
||||
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = '';
|
||||
|
||||
// Create clone
|
||||
|
||||
$result=$clonedObj->create($user);
|
||||
if ($result < 0) $error++;
|
||||
else
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -31,6 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
$langs->load('compta');
|
||||
$langs->load('other');
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -27,6 +28,9 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
$langs->load('propal');
|
||||
$langs->load('compta');
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -28,6 +29,9 @@
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
$langs->load('propal');
|
||||
$langs->load('compta');
|
||||
|
||||
@@ -22,6 +22,14 @@
|
||||
* \ingroup propal
|
||||
* \brief Template to show objects linked to proposals
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE -->
|
||||
@@ -40,7 +48,7 @@ $var=true;
|
||||
foreach($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
$ilink++;
|
||||
|
||||
|
||||
$trclass=($var?'pair':'impair');
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
@@ -71,7 +79,7 @@ if (count($linkedObjectBlock) > 1)
|
||||
<td align="right"></td>
|
||||
<td align="right"></td>
|
||||
</tr>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -766,10 +766,13 @@ if (empty($reshook))
|
||||
{
|
||||
if (count($prodcustprice->lines) > 0)
|
||||
{
|
||||
$pu_ht = price($prodcustprice->lines [0]->price);
|
||||
$pu_ttc = price($prodcustprice->lines [0]->price_ttc);
|
||||
$price_base_type = $prodcustprice->lines [0]->price_base_type;
|
||||
$tva_tx = $prodcustprice->lines [0]->tva_tx;
|
||||
$pu_ht = price($prodcustprice->lines[0]->price);
|
||||
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
||||
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
||||
$tva_tx = $prodcustprice->lines[0]->tva_tx;
|
||||
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
|
||||
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
|
||||
if (empty($tva_tx)) $tva_npr=0;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -821,12 +824,33 @@ if (empty($reshook))
|
||||
// Add custom code and origin country into description
|
||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
|
||||
$tmptxt = '(';
|
||||
if (! empty($prod->customcode))
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
||||
$tmptxt .= ' - ';
|
||||
if (! empty($prod->country_code))
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
|
||||
// Define output language
|
||||
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
if (empty($newlang) && GETPOST('lang_id','alpha'))
|
||||
$newlang = GETPOST('lang_id','alpha');
|
||||
if (empty($newlang))
|
||||
$newlang = $object->thirdparty->default_lang;
|
||||
if (! empty($newlang)) {
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
$outputlangs->load('products');
|
||||
}
|
||||
if (! empty($prod->customcode))
|
||||
$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
||||
$tmptxt .= ' - ';
|
||||
if (! empty($prod->country_code))
|
||||
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0);
|
||||
} else {
|
||||
if (! empty($prod->customcode))
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
||||
$tmptxt .= ' - ';
|
||||
if (! empty($prod->country_code))
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
|
||||
}
|
||||
$tmptxt .= ')';
|
||||
$desc = dol_concatdesc($desc, $tmptxt);
|
||||
}
|
||||
|
||||
@@ -709,7 +709,7 @@ class Commande extends CommonOrder
|
||||
// $date_commande is deprecated
|
||||
$date = ($this->date_commande ? $this->date_commande : $this->date);
|
||||
|
||||
// Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate)
|
||||
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
|
||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date);
|
||||
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||
if (empty($this->fk_multicurrency))
|
||||
@@ -821,11 +821,15 @@ class Commande extends CommonOrder
|
||||
$fk_parent_line = 0;
|
||||
}
|
||||
|
||||
// Complete vat rate with code
|
||||
$vatrate = $line->tva_tx;
|
||||
if ($line->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$line->vat_src_code.')';
|
||||
|
||||
$result = $this->addline(
|
||||
$line->desc,
|
||||
$line->subprice,
|
||||
$line->qty,
|
||||
$line->tva_tx,
|
||||
$vatrate,
|
||||
$line->localtax1_tx,
|
||||
$line->localtax2_tx,
|
||||
$line->fk_product,
|
||||
@@ -1211,9 +1215,9 @@ class Commande extends CommonOrder
|
||||
* @param string $desc Description of line
|
||||
* @param float $pu_ht Unit price (without tax)
|
||||
* @param float $qty Quantite
|
||||
* @param float $txtva Taux de tva force, sinon -1
|
||||
* @param float $txlocaltax1 Local tax 1 rate
|
||||
* @param float $txlocaltax2 Local tax 2 rate
|
||||
* @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
|
||||
* @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
|
||||
* @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
|
||||
* @param int $fk_product Id of product
|
||||
* @param float $remise_percent Pourcentage de remise de la ligne
|
||||
* @param int $info_bits Bits de type de lignes
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -31,6 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php';
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
|
||||
$langs->load('companies');
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -26,6 +27,9 @@ require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
if (!$user->rights->commande->lire) accessforbidden();
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -27,6 +28,9 @@
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php';
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
|
||||
$langs->load("companies");
|
||||
|
||||
@@ -15,8 +15,15 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE -->
|
||||
@@ -36,7 +43,7 @@ $var=true;
|
||||
foreach($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
$ilink++;
|
||||
|
||||
|
||||
$trclass=($var?'pair':'impair');
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
@@ -76,7 +83,7 @@ if (count($linkedObjectBlock) > 1)
|
||||
<td align="right"></td>
|
||||
<td align="right"></td>
|
||||
</tr>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ if ($action == 'add')
|
||||
$object->owner_address = trim($_POST["owner_address"]);
|
||||
|
||||
$account_number = GETPOST('account_number','alpha');
|
||||
if ($account_number <= 0) { $object->account_number = ''; } else { $object->account_number = $account_number; }
|
||||
if (empty($account_number) || $account_number == '-1') { $object->account_number = ''; } else { $object->account_number = $account_number; }
|
||||
$fk_accountancy_journal = GETPOST('fk_accountancy_journal','int');
|
||||
if ($fk_accountancy_journal <= 0) { $object->fk_accountancy_journal = ''; } else { $object->fk_accountancy_journal = $fk_accountancy_journal; }
|
||||
|
||||
@@ -656,7 +656,7 @@ else
|
||||
print '<td>';
|
||||
if (! empty($conf->accounting->enabled)) {
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch('',$object->account_number);
|
||||
$accountingaccount->fetch('',$object->account_number, 1);
|
||||
|
||||
print $accountingaccount->getNomUrl(0,1,1,'',1);
|
||||
} else {
|
||||
|
||||
@@ -83,6 +83,11 @@ if ($action == 'add_confirm')
|
||||
$accountto=new Account($db);
|
||||
$accountto->fetch(GETPOST('account_to','int'));
|
||||
|
||||
if ($accountto->currency_code != $accountfrom->currency_code) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorTransferBetweenDifferentCurrencyNotPossible"), null, 'errors');
|
||||
}
|
||||
|
||||
if ($accountto->id != $accountfrom->id)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
@@ -1075,6 +1075,7 @@ if (empty($reshook))
|
||||
$TTotalByTva = array();
|
||||
foreach ($srcobject->lines as &$line)
|
||||
{
|
||||
if(! empty($line->special_code)) continue;
|
||||
$TTotalByTva[$line->tva_tx] += $line->total_ttc ;
|
||||
}
|
||||
|
||||
@@ -1588,6 +1589,9 @@ if (empty($reshook))
|
||||
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
||||
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
||||
$tva_tx = $prodcustprice->lines[0]->tva_tx;
|
||||
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
|
||||
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
|
||||
if (empty($tva_tx)) $tva_npr=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1640,12 +1644,32 @@ if (empty($reshook))
|
||||
// Add custom code and origin country into description
|
||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
|
||||
$tmptxt = '(';
|
||||
if (! empty($prod->customcode))
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
||||
$tmptxt .= ' - ';
|
||||
if (! empty($prod->country_code))
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
|
||||
// Define output language
|
||||
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
if (empty($newlang) && GETPOST('lang_id','alpha'))
|
||||
$newlang = GETPOST('lang_id','alpha');
|
||||
if (empty($newlang))
|
||||
$newlang = $object->thirdparty->default_lang;
|
||||
if (! empty($newlang)) {
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
if (! empty($prod->customcode))
|
||||
$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
||||
$tmptxt .= ' - ';
|
||||
if (! empty($prod->country_code))
|
||||
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0);
|
||||
} else {
|
||||
if (! empty($prod->customcode))
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
||||
$tmptxt .= ' - ';
|
||||
if (! empty($prod->country_code))
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
|
||||
}
|
||||
$tmptxt .= ')';
|
||||
$desc = dol_concatdesc($desc, $tmptxt);
|
||||
}
|
||||
@@ -2510,10 +2534,10 @@ if ($action == 'create')
|
||||
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3);
|
||||
print $desc;
|
||||
|
||||
print '<div id="credit_note_options" class="clearboth">';
|
||||
print ' <input data-role="none" type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
|
||||
print '<br> <input data-role="none" type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
|
||||
print '</div>';
|
||||
print '<div id="credit_note_options" class="clearboth">';
|
||||
print ' <input data-role="none" type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="$(\'#credit_note_options input[type=checkbox]\').not(this).prop(\'checked\', false);" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
|
||||
print '<br> <input data-role="none" type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="$(\'#credit_note_options input[type=checkbox]\').not(this).prop(\'checked\', false);" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
|
||||
print '</div>';
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ class Facture extends CommonInvoice
|
||||
$this->brouillon = 1;
|
||||
if (empty($this->entity)) $this->entity = $conf->entity;
|
||||
|
||||
// Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate)
|
||||
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
|
||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
|
||||
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||
if (empty($this->fk_multicurrency))
|
||||
@@ -575,11 +575,15 @@ class Facture extends CommonInvoice
|
||||
$fk_parent_line = 0;
|
||||
}
|
||||
|
||||
// Complete vat rate with code
|
||||
$vatrate = $line->tva_tx;
|
||||
if ($line->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$line->vat_src_code.')';
|
||||
|
||||
$result = $this->addline(
|
||||
$line->desc,
|
||||
$line->subprice,
|
||||
$line->qty,
|
||||
$line->tva_tx,
|
||||
$vatrate,
|
||||
$line->localtax1_tx,
|
||||
$line->localtax2_tx,
|
||||
$line->fk_product,
|
||||
@@ -935,7 +939,8 @@ class Facture extends CommonInvoice
|
||||
{
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
@@ -985,6 +990,8 @@ class Facture extends CommonInvoice
|
||||
$line->special_code = $object->lines[$i]->special_code;
|
||||
$line->fk_parent_line = $object->lines[$i]->fk_parent_line;
|
||||
$line->fk_unit = $object->lines[$i]->fk_unit;
|
||||
$line->date_start = $object->lines[$i]->date_start;
|
||||
$line->date_end = $object->lines[$i]->date_end;
|
||||
|
||||
$line->fk_fournprice = $object->lines[$i]->fk_fournprice;
|
||||
$marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht);
|
||||
@@ -2190,6 +2197,7 @@ class Facture extends CommonInvoice
|
||||
else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num));
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$this->error = $mouvP->error;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2427,8 +2435,8 @@ class Facture extends CommonInvoice
|
||||
* @param double $pu_ht Unit price without tax (> 0 even for credit note)
|
||||
* @param double $qty Quantity
|
||||
* @param double $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
|
||||
* @param double $txlocaltax1 Local tax 1 rate (deprecated)
|
||||
* @param double $txlocaltax2 Local tax 2 rate (deprecated)
|
||||
* @param double $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
|
||||
* @param double $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
|
||||
* @param int $fk_product Id of predefined product/service
|
||||
* @param double $remise_percent Percent of discount on line
|
||||
* @param int $date_start Date start of service
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2005-2009 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -30,6 +31,9 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
$langs->load("bills");
|
||||
$langs->load("companies");
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2017 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -32,6 +34,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
$langs->load('propal');
|
||||
$langs->load('compta');
|
||||
@@ -189,6 +194,6 @@ else
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -530,6 +530,9 @@ if (empty($reshook))
|
||||
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
||||
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
||||
$tva_tx = $prodcustprice->lines[0]->tva_tx;
|
||||
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
|
||||
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
|
||||
if (empty($tva_tx)) $tva_npr=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -27,6 +28,9 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("bills");
|
||||
|
||||
@@ -552,14 +552,14 @@ if ($resql)
|
||||
if ($search_societe) $param.='&search_societe=' .urlencode($search_societe);
|
||||
if ($search_sale > 0) $param.='&search_sale=' .urlencode($search_sale);
|
||||
if ($search_user > 0) $param.='&search_user=' .urlencode($search_user);
|
||||
if ($search_product_category > 0) $param.='$search_product_category=' .urlencode($search_product_category);
|
||||
if ($search_product_category > 0) $param.='&search_product_category=' .urlencode($search_product_category);
|
||||
if ($search_montant_ht != '') $param.='&search_montant_ht='.urlencode($search_montant_ht);
|
||||
if ($search_montant_vat != '') $param.='&search_montant_vat='.urlencode($search_montant_vat);
|
||||
if ($search_montant_localtax1 != '') $param.='&search_montant_localtax1='.urlencode($search_montant_localtax1);
|
||||
if ($search_montant_localtax2 != '') $param.='&search_montant_localtax2='.urlencode($search_montant_localtax2);
|
||||
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.urlencode($search_montant_ttc);
|
||||
if ($search_status != '') $param.='&search_status='.urlencode($search_status);
|
||||
if ($search_paymentmode > 0) $param.='search_paymentmode='.urlencode($search_paymentmode);
|
||||
if ($search_paymentmode > 0) $param.='&search_paymentmode='.urlencode($search_paymentmode);
|
||||
if ($show_files) $param.='&show_files=' .$show_files;
|
||||
if ($option) $param.="&option=".$option;
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
@@ -785,7 +785,8 @@ if ($resql)
|
||||
Facture::TYPE_STANDARD=>$langs->trans("InvoiceStandard"),
|
||||
Facture::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"),
|
||||
Facture::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"),
|
||||
Facture::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"),
|
||||
Facture::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"),
|
||||
Facture::TYPE_SITUATION=>$langs->trans("InvoiceSituation"),
|
||||
);
|
||||
//$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order.
|
||||
print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth100');
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -28,6 +29,9 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("bills");
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -30,6 +31,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
if (!$user->rights->facture->lire) accessforbidden();
|
||||
|
||||
|
||||
@@ -15,8 +15,15 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE -->
|
||||
@@ -36,7 +43,7 @@ $var=true;
|
||||
foreach($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
$ilink++;
|
||||
|
||||
|
||||
$trclass=($var?'pair':'impair');
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
@@ -54,7 +61,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
||||
$total = $total + $sign * $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
echo '<strike>'.price($objectlink->total_ht).'</strike>';
|
||||
}
|
||||
@@ -76,7 +83,7 @@ if (count($linkedObjectBlock) > 1)
|
||||
<td align="right"></td>
|
||||
<td align="right"></td>
|
||||
</tr>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -15,8 +15,15 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE -->
|
||||
@@ -36,7 +43,7 @@ $var=true;
|
||||
foreach($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
$ilink++;
|
||||
|
||||
|
||||
$trclass=($var?'pair':'impair');
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
|
||||
@@ -63,6 +63,7 @@ if ($user->societe_id > 0)
|
||||
|
||||
$max=3;
|
||||
|
||||
$hookmanager->initHooks(array('invoiceindex'));
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@@ -152,7 +153,11 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
{
|
||||
$sql .= " AND f.fk_soc = $socid";
|
||||
}
|
||||
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerDraft',$parameters);
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
if ( $resql )
|
||||
@@ -228,9 +233,12 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhereSupplierDraft',$parameters);
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$resql = $db->query($sql);
|
||||
|
||||
|
||||
if ( $resql )
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
@@ -310,6 +318,11 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerLastModified',$parameters);
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql.= " GROUP BY f.rowid, f.facnumber, f.fk_statut, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement, s.nom, s.rowid, s.code_client";
|
||||
$sql.= " ORDER BY f.tms DESC ";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
@@ -419,6 +432,11 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
||||
$sql.= " AND ff.entity = ".$conf->entity;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
if ($socid) $sql.= " AND ff.fk_soc = ".$socid;
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhereSupplierLastModified',$parameters);
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.tms, ff.paye, s.nom, s.rowid, s.code_fournisseur";
|
||||
$sql.= " ORDER BY ff.tms DESC ";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
@@ -498,6 +516,11 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire)
|
||||
$sql = "SELECT d.rowid, d.lastname, d.firstname, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."don as d";
|
||||
$sql.= " WHERE d.entity = ".$conf->entity;
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhereLastDonations',$parameters);
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql.= $db->order("d.tms","DESC");
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
@@ -569,6 +592,11 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
||||
$sql.= " WHERE c.fk_type = cc.id";
|
||||
$sql.= " AND c.entity = ".$conf->entity;
|
||||
$sql.= " AND c.paye = 0";
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhereSocialContributions',$parameters);
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql.= " GROUP BY c.rowid, c.amount, c.date_ech, c.paye, cc.libelle";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
@@ -652,6 +680,11 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
|
||||
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
|
||||
$sql.= " AND c.fk_statut = 3";
|
||||
$sql.= " AND c.facture = 0";
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerOrderToBill',$parameters);
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql.= " GROUP BY s.nom, s.rowid, s.code_client, c.rowid, c.ref, c.facture, c.fk_statut, c.tva, c.total_ht, c.total_ttc";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
@@ -756,6 +789,11 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerUnpaid',$parameters);
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql.= " GROUP BY f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement, s.nom, s.rowid, s.code_client";
|
||||
$sql.= " ORDER BY f.datef ASC, f.facnumber ASC";
|
||||
|
||||
@@ -879,6 +917,11 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
||||
$sql.= " AND ff.fk_statut = 1";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
if ($socid) $sql.= " AND ff.fk_soc = ".$socid;
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhereSupplierUnpaid',$parameters);
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.paye,";
|
||||
$sql.= " s.nom, s.rowid, s.code_client, s.code_fournisseur, ff.date_lim_reglement";
|
||||
$sql.= " ORDER BY ff.date_lim_reglement ASC";
|
||||
|
||||
@@ -102,7 +102,7 @@ if (empty($reshook))
|
||||
$tmpinvoice=new Facture($db);
|
||||
foreach ($_POST as $key => $value)
|
||||
{
|
||||
if (substr($key,0,7) == 'amount_')
|
||||
if (substr($key,0,7) == 'amount_' && GETPOST($key) != '')
|
||||
{
|
||||
$cursorfacid = substr($key,7);
|
||||
$amounts[$cursorfacid] = price2num(trim(GETPOST($key)));
|
||||
|
||||
@@ -46,14 +46,14 @@ $confirm=GETPOST('confirm', 'alpha');
|
||||
// Security check
|
||||
$fieldname = (! empty($ref)?'ref':'rowid');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque','','',$fieldname);
|
||||
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque','','fk_user_author',$fieldname);
|
||||
|
||||
$sortfield=GETPOST('sortfield', 'alpha');
|
||||
$sortorder=GETPOST('sortorder', 'alpha');
|
||||
$page=GETPOST('page', 'int');
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="b.dateo,b.rowid";
|
||||
if ($page < 0) { $page = 0 ; }
|
||||
if (empty($page) || $page == -1) { $page = 0; }
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
@@ -490,53 +490,55 @@ if ($action == 'new')
|
||||
|
||||
if (count($lines[$bid]))
|
||||
{
|
||||
foreach ($lines[$bid] as $lid => $value)
|
||||
{
|
||||
$account_id = $bid;
|
||||
if (! isset($accounts[$bid]))
|
||||
$accounts[$bid]=0;
|
||||
$accounts[$bid] += 1;
|
||||
foreach ($lines[$bid] as $lid => $value)
|
||||
{
|
||||
//$account_id = $bid; FIXME not used
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.dol_print_date($value["date"],'day').'</td>';
|
||||
print '<td>'.$value["numero"]."</td>\n";
|
||||
print '<td>'.$value["emetteur"]."</td>\n";
|
||||
print '<td>'.$value["banque"]."</td>\n";
|
||||
print '<td align="right">'.price($value["amount"], 0, $langs, 1, -1, -1, $conf->currency).'</td>';
|
||||
// FIXME $accounts[$bid] is a label !
|
||||
/*if (! isset($accounts[$bid]))
|
||||
$accounts[$bid]=0;
|
||||
$accounts[$bid] += 1;*/
|
||||
|
||||
// Link to payment
|
||||
print '<td align="center">';
|
||||
$paymentstatic->id=$value["paymentid"];
|
||||
$paymentstatic->ref=$value["paymentid"];
|
||||
if ($paymentstatic->id)
|
||||
{
|
||||
print $paymentstatic->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
// Link to bank transaction
|
||||
print '<td align="center">';
|
||||
$accountlinestatic->rowid=$value["id"];
|
||||
if ($accountlinestatic->rowid)
|
||||
{
|
||||
print $accountlinestatic->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.dol_print_date($value["date"],'day').'</td>';
|
||||
print '<td>'.$value["numero"]."</td>\n";
|
||||
print '<td>'.$value["emetteur"]."</td>\n";
|
||||
print '<td>'.$value["banque"]."</td>\n";
|
||||
print '<td align="right">'.price($value["amount"], 0, $langs, 1, -1, -1, $conf->currency).'</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
print '<input id="'.$value["id"].'" class="flat checkforremise_'.$bid.'" checked type="checkbox" name="toRemise[]" value="'.$value["id"].'">';
|
||||
print '</td>' ;
|
||||
print '</tr>';
|
||||
// Link to payment
|
||||
print '<td align="center">';
|
||||
$paymentstatic->id=$value["paymentid"];
|
||||
$paymentstatic->ref=$value["paymentid"];
|
||||
if ($paymentstatic->id)
|
||||
{
|
||||
print $paymentstatic->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
// Link to bank transaction
|
||||
print '<td align="center">';
|
||||
$accountlinestatic->rowid=$value["id"];
|
||||
if ($accountlinestatic->rowid)
|
||||
{
|
||||
print $accountlinestatic->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
$i++;
|
||||
}
|
||||
print '<td align="center">';
|
||||
print '<input id="'.$value["id"].'" class="flat checkforremise_'.$bid.'" checked type="checkbox" name="toRemise[]" value="'.$value["id"].'">';
|
||||
print '</td>' ;
|
||||
print '</tr>';
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
@@ -688,10 +690,12 @@ else
|
||||
{
|
||||
while ($objp = $db->fetch_object($resql))
|
||||
{
|
||||
$account_id = $objp->bid;
|
||||
if (! isset($accounts[$objp->bid]))
|
||||
//$account_id = $objp->bid; FIXME not used
|
||||
|
||||
// FIXME $accounts[$objp->bid] is a label
|
||||
/*if (! isset($accounts[$objp->bid]))
|
||||
$accounts[$objp->bid]=0;
|
||||
$accounts[$objp->bid] += 1;
|
||||
$accounts[$objp->bid] += 1;*/
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td align="center">'.$i.'</td>';
|
||||
|
||||
@@ -1114,5 +1114,31 @@ class Paiement extends CommonObject
|
||||
}*/
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the third party of object, from id into this->thirdparty
|
||||
*
|
||||
* @param int $force_thirdparty_id Force thirdparty id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch_thirdparty($force_thirdparty_id=0)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
|
||||
if (empty($force_thirdparty_id))
|
||||
{
|
||||
$billsarray = $this->getBillsArray(); // From payment, the fk_soc isn't available, we should load the first invoice to get him
|
||||
if (!empty($billsarray))
|
||||
{
|
||||
$supplier_invoice = new FactureFournisseur($this->db);
|
||||
if ($supplier_invoice->fetch($billsarray[0]) > 0)
|
||||
{
|
||||
$force_thirdparty_id = $supplier_invoice->fk_soc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return parent::fetch_thirdparty($force_thirdparty_id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -236,10 +236,10 @@ class RejetPrelevement
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
|
||||
$subject = $langs->trans("InfoRejectSubject");
|
||||
$subject = $langs->transnoentities("InfoRejectSubject");
|
||||
$sendto = $emuser->getFullName($langs)." <".$emuser->email.">";
|
||||
$from = $this->user->getFullName($langs)." <".$this->user->email.">";
|
||||
$msgishtml=0;
|
||||
$msgishtml=1;
|
||||
|
||||
$arr_file = array();
|
||||
$arr_mime = array();
|
||||
|
||||
@@ -13,8 +13,15 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE CONTACTCARD_CREATE.TPL.PHP DEFAULT -->
|
||||
|
||||
@@ -13,9 +13,16 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$contact = $GLOBALS['objcanvas']->control->object;
|
||||
|
||||
?>
|
||||
|
||||
@@ -13,9 +13,16 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$contact = $GLOBALS['objcanvas']->control->object;
|
||||
?>
|
||||
|
||||
|
||||
@@ -58,9 +58,7 @@ $result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'ro
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) {
|
||||
$page = 0;
|
||||
}
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
@@ -108,7 +106,7 @@ if ($object->id)
|
||||
}
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
{
|
||||
@@ -120,11 +118,11 @@ if ($object->id)
|
||||
else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
@@ -147,7 +145,7 @@ if ($object->id)
|
||||
print '</td></tr>';
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
// Civility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
||||
print $object->getCivilityLabel();
|
||||
@@ -160,7 +158,7 @@ if ($object->id)
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
$modulepart = 'contact';
|
||||
$permission = $user->rights->societe->contact->creer;
|
||||
$permtoedit = $user->rights->societe->contact->creer;
|
||||
|
||||
@@ -68,6 +68,9 @@ $search_categ_thirdparty=GETPOST("search_categ_thirdparty",'int');
|
||||
$search_categ_supplier=GETPOST("search_categ_supplier",'int');
|
||||
$search_status=GETPOST("search_status",'int');
|
||||
$search_type=GETPOST('search_type','alpha');
|
||||
$search_zip=GETPOST('search_zip','alpha');
|
||||
$search_town=GETPOST('search_town','alpha');
|
||||
|
||||
if ($search_status=='') $search_status=1; // always display activ customer first
|
||||
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
@@ -289,7 +292,7 @@ if (strlen($search_poste)) $sql.= natural_search('p.poste', $search_pos
|
||||
if (strlen($search_phone_perso)) $sql.= natural_search('p.phone_perso', $search_phone_perso);
|
||||
if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone);
|
||||
if (strlen($search_phone_mobile)) $sql.= natural_search('p.phone_mobile', $search_phone_mobile);
|
||||
if (strlen($search_fax)) $sql.= natural_search('p.phone_fax', $search_fax);
|
||||
if (strlen($search_fax)) $sql.= natural_search('p.fax', $search_fax);
|
||||
if (strlen($search_skype)) $sql.= natural_search('p.skype', $search_skype);
|
||||
if (strlen($search_email)) $sql.= natural_search('p.email', $search_email);
|
||||
if ($search_status != '' && $search_status >= 0) $sql.= " AND p.statut = ".$db->escape($search_status);
|
||||
@@ -396,6 +399,7 @@ if ($search_email != '') $param.='&search_email='.urlencode($search_email);
|
||||
if ($search_status != '') $param.='&search_status='.urlencode($search_status);
|
||||
if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".urlencode($search_priv);
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
|
||||
// Add $param from extra fields
|
||||
foreach ($search_array_options as $key => $val)
|
||||
{
|
||||
@@ -491,12 +495,6 @@ if (! empty($arrayfields['p.firstname']['checked']))
|
||||
print '<input class="flat" type="text" name="search_firstname" size="6" value="'.dol_escape_htmltag($search_firstname).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['p.poste']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_poste" size="5" value="'.dol_escape_htmltag($search_poste).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['p.zip']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
@@ -509,6 +507,12 @@ if (! empty($arrayfields['p.town']['checked']))
|
||||
print '<input class="flat" type="text" name="search_town" size="5" value="'.dol_escape_htmltag($search_town).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['p.poste']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_poste" size="5" value="'.dol_escape_htmltag($search_poste).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['p.phone']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
|
||||
@@ -509,6 +509,9 @@ if (empty($reshook))
|
||||
$pu_ttc = price($prodcustprice->lines [0]->price_ttc);
|
||||
$price_base_type = $prodcustprice->lines [0]->price_base_type;
|
||||
$tva_tx = $prodcustprice->lines [0]->tva_tx;
|
||||
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
|
||||
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
|
||||
if (empty($tva_tx)) $tva_npr=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1837,7 +1840,7 @@ else
|
||||
{
|
||||
$tmpaction='unactivateline';
|
||||
$tmpactionpicto='playstop';
|
||||
$tmpactiontext=$langs->trans("Unactivate");
|
||||
$tmpactiontext=$langs->trans("Disable");
|
||||
}
|
||||
if (($tmpaction=='activateline' && $user->rights->contrat->activer) || ($tmpaction=='unactivateline' && $user->rights->contrat->desactiver))
|
||||
{
|
||||
@@ -1979,7 +1982,7 @@ else
|
||||
print '<tr '.$bc[false].'>';
|
||||
print '<td class="nohover">'.$langs->trans("Comment").'</td><td class="nohover"><input size="70" type="text" class="flat" name="comment" value="'.dol_escape_htmltag(GETPOST('comment', 'alpha')).'"></td>';
|
||||
print '<td class="nohover right">';
|
||||
print '<input type="submit" class="button" name="close" value="'.$langs->trans("Unactivate").'"> ';
|
||||
print '<input type="submit" class="button" name="close" value="'.$langs->trans("Disable").'"> ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -322,7 +322,11 @@ class Contrat extends CommonObject
|
||||
$result=$this->thirdparty->set_as_client();
|
||||
|
||||
// Define new ref
|
||||
if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life
|
||||
if ($force_number)
|
||||
{
|
||||
$num = $force_number;
|
||||
}
|
||||
else if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life
|
||||
{
|
||||
$num = $this->getNextNumRef($this->thirdparty);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
|
||||
* Copyright (C) 2005-2009 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -28,6 +29,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
|
||||
$langs->load("contracts");
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -32,6 +33,9 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
$langs->load("other");
|
||||
$langs->load("products");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -25,6 +26,9 @@ require ("../main.inc.php");
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
$langs->load("contracts");
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -26,6 +27,9 @@
|
||||
require ("../main.inc.php");
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("contracts");
|
||||
|
||||
@@ -14,6 +14,14 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE -->
|
||||
@@ -33,7 +41,7 @@ $var=true;
|
||||
foreach($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
$ilink++;
|
||||
|
||||
|
||||
$trclass=($var?'pair':'impair');
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
// Build doc
|
||||
if ($action == 'builddoc' && $permissioncreate)
|
||||
{
|
||||
|
||||
|
||||
if (is_numeric(GETPOST('model')))
|
||||
{
|
||||
$error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Model"));
|
||||
@@ -48,13 +48,13 @@ if ($action == 'builddoc' && $permissioncreate)
|
||||
dol_print_error('Object must have been loaded by a fetch');
|
||||
exit;
|
||||
}*/
|
||||
|
||||
|
||||
// Save last template used to generate document
|
||||
if (GETPOST('model'))
|
||||
{
|
||||
$object->setDocModel($user, GETPOST('model','alpha'));
|
||||
}
|
||||
|
||||
|
||||
// Special case to force bank account
|
||||
//if (property_exists($object, 'fk_bank'))
|
||||
//{
|
||||
@@ -76,13 +76,13 @@ if ($action == 'builddoc' && $permissioncreate)
|
||||
$outputlangs = new Translate("",$conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
|
||||
|
||||
// To be sure vars is defined
|
||||
if (empty($hidedetails)) $hidedetails=0;
|
||||
if (empty($hidedesc)) $hidedesc=0;
|
||||
if (empty($hideref)) $hideref=0;
|
||||
if (empty($moreparams)) $moreparams=null;
|
||||
|
||||
|
||||
$result= $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
|
||||
if ($result <= 0)
|
||||
{
|
||||
@@ -91,11 +91,15 @@ if ($action == 'builddoc' && $permissioncreate)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (empty($donotredirect)) // This is se when include is done by bulk action "Bill Orders"
|
||||
if (empty($donotredirect)) // This is set when include is done by bulk action "Bill Orders"
|
||||
{
|
||||
setEventMessages($langs->trans("FileGenerated"), null);
|
||||
|
||||
header('Location: '.$_SERVER['REQUEST_URI'].'#builddoc');
|
||||
$urltoredirect = $_SERVER['REQUEST_URI'];
|
||||
$urltoredirect = preg_replace('/#builddoc$/', '', $urltoredirect);
|
||||
$urltoredirect = preg_replace('/action=builddoc&?/', '', $urltoredirect); // To avoid infinite loop
|
||||
|
||||
header('Location: '.$urltoredirect.'#builddoc');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||
{
|
||||
if ($object->id)
|
||||
{
|
||||
$urlfile = GETPOST('urlfile', 'alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$urlfile = GETPOST('urlfile', 'alpha', 0, null, null, 1); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
if (GETPOST('section', 'alpha')) $file = $upload_dir . "/" . $urlfile; // For a delete of GED module urlfile contains full path from upload_dir
|
||||
else // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile.
|
||||
{
|
||||
|
||||
@@ -413,6 +413,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
$object->trackid = $trackid;
|
||||
$object->fk_element = $object->id;
|
||||
$object->elementtype = $object->element;
|
||||
$object->attachedfiles = $attachedfiles;
|
||||
|
||||
// Call of triggers
|
||||
if (! empty($trigger_name))
|
||||
|
||||
@@ -94,10 +94,30 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($
|
||||
}
|
||||
else $newelement = $element;
|
||||
|
||||
$_POST['action']='update'; // Hack so restrictarea will test permissions on write too
|
||||
$feature = $newelement;
|
||||
$feature2 = $subelement;
|
||||
$object_id = $fk_element;
|
||||
if ($feature == 'expedition' || $feature == 'shipping')
|
||||
{
|
||||
$feature = 'commande';
|
||||
$object_id = 0;
|
||||
}
|
||||
if ($feature == 'shipping') $feature = 'commande';
|
||||
if ($feature == 'payment') { $feature = 'facture'; }
|
||||
if ($feature == 'payment_supplier') { $feature = 'fournisseur'; $feature2 = 'facture'; }
|
||||
//var_dump(GETPOST('action','aZ09'));
|
||||
//var_dump($newelement.'-'.$subelement."-".$feature."-".$object_id);
|
||||
$check_access = restrictedArea($user, $feature, $object_id, '', $feature2);
|
||||
//var_dump($user->rights);
|
||||
/*
|
||||
if (! empty($user->rights->$newelement->creer) || ! empty($user->rights->$newelement->create) || ! empty($user->rights->$newelement->write)
|
||||
|| (isset($subelement) && (! empty($user->rights->$newelement->$subelement->creer) || ! empty($user->rights->$newelement->$subelement->write)))
|
||||
|| ($element == 'payment' && $user->rights->facture->paiement)
|
||||
|| ($element == 'payment_supplier' && $user->rights->fournisseur->facture->creer))
|
||||
|| (isset($subelement) && (! empty($user->rights->$newelement->$subelement->creer) || ! empty($user->rights->$newelement->$subelement->write)))
|
||||
|| ($element == 'payment' && $user->rights->facture->paiement)
|
||||
|| ($element == 'payment_supplier' && $user->rights->fournisseur->facture->creer))
|
||||
*/
|
||||
|
||||
if ($check_access)
|
||||
{
|
||||
// Clean parameters
|
||||
$newvalue = trim($value);
|
||||
|
||||
@@ -49,92 +49,92 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
|
||||
//global $hookmanager;
|
||||
$hookmanager->initHooks(array('searchform'));
|
||||
|
||||
$search_boxvalue=GETPOST('q', 'none');
|
||||
$search_boxvalue=GETPOST('q');
|
||||
|
||||
$arrayresult=array();
|
||||
|
||||
// Define $searchform
|
||||
if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire)
|
||||
{
|
||||
$arrayresult['searchintothirdparty']=array('position'=>10, 'shortcut'=>'T', 'img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php?sall='.urlencode($search_boxvalue));
|
||||
$arrayresult['searchintothirdparty']=array('img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php?sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
|
||||
if (! empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTACT_DISABLED) && $user->rights->societe->lire)
|
||||
{
|
||||
$arrayresult['searchintocontact']=array('position'=>15, 'shortcut'=>'A', 'img'=>'object_contact', 'label'=>$langs->trans("SearchIntoContacts", $search_boxvalue), 'text'=>img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php?sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
|
||||
if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire)
|
||||
{
|
||||
$arrayresult['searchintomember']=array('position'=>20, 'shortcut'=>'M', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue));
|
||||
$arrayresult['searchintocontact']=array('img'=>'object_contact', 'label'=>$langs->trans("SearchIntoContacts", $search_boxvalue), 'text'=>img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php?sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
|
||||
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire))
|
||||
&& empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED))
|
||||
{
|
||||
$arrayresult['searchintoproduct']=array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue),'text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php?sall='.urlencode($search_boxvalue));
|
||||
$arrayresult['searchintoproduct']=array('img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue),'text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php?sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
|
||||
if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire)
|
||||
{
|
||||
$arrayresult['searchintoprojects']=array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_projectpub', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue));
|
||||
$arrayresult['searchintoprojects']=array('img'=>'object_projectpub', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue));
|
||||
}
|
||||
if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire)
|
||||
{
|
||||
$arrayresult['searchintotasks']=array('position'=>45, 'img'=>'object_task', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('','object_task').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php?search_all='.urlencode($search_boxvalue));
|
||||
$arrayresult['searchintotasks']=array('img'=>'object_task', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('','object_task').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php?search_all='.urlencode($search_boxvalue));
|
||||
}
|
||||
|
||||
if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire)
|
||||
{
|
||||
$arrayresult['searchintomember']=array('img'=>'object_user', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
|
||||
if (! empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->rights->user->user->lire)
|
||||
{
|
||||
$arrayresult['searchintouser']=array('img'=>'object_user', 'label'=>$langs->trans("SearchIntoUsers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/index.php?sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
|
||||
if (! empty($conf->propal->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED) && $user->rights->propal->lire)
|
||||
{
|
||||
$arrayresult['searchintopropal']=array('position'=>60, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php?sall='.urlencode($search_boxvalue));
|
||||
$arrayresult['searchintopropal']=array('img'=>'object_propal', 'label'=>$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php?sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
if (! empty($conf->commande->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_ORDER_DISABLED) && $user->rights->commande->lire)
|
||||
{
|
||||
$arrayresult['searchintoorder']=array('position'=>70, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php?sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
if (! empty($conf->expedition->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->rights->expedition->lire)
|
||||
{
|
||||
$arrayresult['searchintoshipment']=array('position'=>80, 'img'=>'object_sending', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('','object_sending').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php?sall='.urlencode($search_boxvalue));
|
||||
$arrayresult['searchintoorder']=array('img'=>'object_order', 'label'=>$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php?sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
if (! empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire)
|
||||
{
|
||||
$arrayresult['searchintoinvoice']=array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php?sall='.urlencode($search_boxvalue));
|
||||
$arrayresult['searchintoinvoice']=array('img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php?sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
if (! empty($conf->expedition->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->rights->expedition->lire)
|
||||
{
|
||||
$arrayresult['searchintoshipment']=array('img'=>'object_sending', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('','object_sending').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php?sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
|
||||
if (! empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->supplier_proposal->lire)
|
||||
{
|
||||
$arrayresult['searchintosupplierpropal']=array('position'=>100, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php?sall='.urlencode($search_boxvalue));
|
||||
$arrayresult['searchintosupplierpropal']=array('img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php?sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED) && $user->rights->fournisseur->commande->lire)
|
||||
{
|
||||
$arrayresult['searchintosupplierorder']=array('position'=>110, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php?search_all='.urlencode($search_boxvalue));
|
||||
$arrayresult['searchintosupplierorder']=array('img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php?search_all='.urlencode($search_boxvalue));
|
||||
}
|
||||
if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) && $user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$arrayresult['searchintosupplierinvoice']=array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php?sall='.urlencode($search_boxvalue));
|
||||
$arrayresult['searchintosupplierinvoice']=array('img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php?sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
|
||||
if (! empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->rights->contrat->lire)
|
||||
{
|
||||
$arrayresult['searchintocontract']=array('position'=>130, 'img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('','object_contract').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php?sall='.urlencode($search_boxvalue));
|
||||
$arrayresult['searchintocontract']=array('img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('','object_contract').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php?sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
if (! empty($conf->ficheinter->enabled) && empty($conf->global->MAIN_SEARCHFORM_FICHINTER_DISABLED) && $user->rights->ficheinter->lire)
|
||||
{
|
||||
$arrayresult['searchintointervention']=array('position'=>140, 'img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('','object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php?sall='.urlencode($search_boxvalue));
|
||||
$arrayresult['searchintointervention']=array('img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('','object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php?sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
|
||||
// HR
|
||||
if (! empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->rights->user->user->lire)
|
||||
{
|
||||
$arrayresult['searchintouser']=array('position'=>200, 'shortcut'=>'U', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoUsers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/index.php?sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
if (! empty($conf->expensereport->enabled) && empty($conf->global->MAIN_SEARCHFORM_EXPENSEREPORT_DISABLED) && $user->rights->expensereport->lire)
|
||||
{
|
||||
$arrayresult['searchintoexpensereport']=array('position'=>210, 'img'=>'object_trip', 'label'=>$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'text'=>img_picto('','object_trip').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue));
|
||||
$arrayresult['searchintoexpensereport']=array('img'=>'object_trip', 'label'=>$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'text'=>img_picto('','object_trip').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
if (! empty($conf->holiday->enabled) && empty($conf->global->MAIN_SEARCHFORM_HOLIDAY_DISABLED) && $user->rights->holiday->read)
|
||||
{
|
||||
$arrayresult['searchintoleaves']=array('position'=>220, 'img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('','object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue));
|
||||
$arrayresult['searchintoleaves']=array('img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('','object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue));
|
||||
}
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLO
|
||||
*/
|
||||
|
||||
// Execute hook addSearchEntry
|
||||
$parameters=array('search_boxvalue'=>$search_boxvalue, 'arrayresult'=>$arrayresult);
|
||||
$parameters=array('search_boxvalue'=>$search_boxvalue);
|
||||
$reshook=$hookmanager->executeHooks('addSearchEntry',$parameters);
|
||||
if (empty($reshook))
|
||||
{
|
||||
@@ -155,8 +155,6 @@ if (empty($reshook))
|
||||
}
|
||||
else $arrayresult=$hookmanager->resArray;
|
||||
|
||||
// Sort on position
|
||||
$arrayresult = dol_sort_array($arrayresult, 'position');
|
||||
|
||||
// Print output if called by ajax or do nothing (var $arrayresult will be used) if called by an include
|
||||
if (! isset($usedbyinclude) || empty($usedbyinclude))
|
||||
|
||||
@@ -3748,6 +3748,7 @@ abstract class CommonObject
|
||||
|
||||
// VAT Rate
|
||||
$this->tpl['vat_rate'] = vatrate($line->tva_tx, true);
|
||||
$this->tpl['vat_rate'] .= (($line->info_bits & 1) == 1) ? '*' : '';
|
||||
if (! empty($line->vat_src_code) && ! preg_match('/\(/', $this->tpl['vat_rate'])) $this->tpl['vat_rate'].=' ('.$line->vat_src_code.')';
|
||||
|
||||
$this->tpl['price'] = price($line->subprice);
|
||||
|
||||
@@ -83,8 +83,8 @@ class Conf
|
||||
$this->file = new stdClass();
|
||||
$this->db = new stdClass();
|
||||
$this->global = new stdClass();
|
||||
$this->mycompany = new stdClass();
|
||||
$this->admin = new stdClass();
|
||||
$this->mycompany = new stdClass();
|
||||
$this->admin = new stdClass();
|
||||
$this->user = new stdClass();
|
||||
$this->syslog = new stdClass();
|
||||
$this->browser = new stdClass();
|
||||
|
||||
@@ -1651,9 +1651,16 @@ class ExtraFields
|
||||
$error_field_required[] = $value;
|
||||
}
|
||||
|
||||
if (in_array($key_type,array('date','datetime')))
|
||||
if (in_array($key_type,array('date')))
|
||||
{
|
||||
// Clean parameters
|
||||
// TODO GMT date in memory must be GMT so we should add gm=true in parameters
|
||||
$value_key=dol_mktime(0, 0, 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]);
|
||||
}
|
||||
elseif (in_array($key_type,array('datetime')))
|
||||
{
|
||||
// Clean parameters
|
||||
// TODO GMT date in memory must be GMT so we should add gm=true in parameters
|
||||
$value_key=dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]);
|
||||
}
|
||||
else if (in_array($key_type,array('checkbox','chkbxlst')))
|
||||
@@ -1692,12 +1699,12 @@ class ExtraFields
|
||||
}
|
||||
|
||||
/**
|
||||
* return array_options array for object by extrafields value (using for data send by forms)
|
||||
* return array_options array of data of extrafields value of object sent by a search form
|
||||
*
|
||||
* @param array $extralabels $array of extrafields
|
||||
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
|
||||
* @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names)
|
||||
* @return int 1 if array_options set / 0 if no value
|
||||
* @return array|int array_options set or 0 if no value
|
||||
*/
|
||||
function getOptionalsFromPost($extralabels,$keyprefix='',$keysuffix='')
|
||||
{
|
||||
|
||||
@@ -166,7 +166,7 @@ class Form
|
||||
$ret.='<input type="hidden" name="action" value="set'.$htmlname.'">';
|
||||
$ret.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$ret.='<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
if (empty($notabletag)) $ret.='<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||
if (empty($notabletag)) $ret.='<table class="nobordernopadding centpercent" cellpadding="0" cellspacing="0">';
|
||||
if (empty($notabletag)) $ret.='<tr><td>';
|
||||
if (preg_match('/^(string|email)/',$typeofdata))
|
||||
{
|
||||
@@ -189,7 +189,7 @@ class Form
|
||||
$morealt=' style="width: '.$cols.'"';
|
||||
$cols='';
|
||||
}
|
||||
$ret.='<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.($tmp[1]?$tmp[1]:'20').'"'.($cols?' cols="'.$cols.'"':'').$morealt.'">'.($editvalue?$editvalue:$value).'</textarea>';
|
||||
$ret.='<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.($tmp[1]?$tmp[1]:'20').'"'.($cols?' cols="'.$cols.'"':'class="quatrevingtpercent"').$morealt.'">'.($editvalue?$editvalue:$value).'</textarea>';
|
||||
}
|
||||
else if ($typeofdata == 'day' || $typeofdata == 'datepicker')
|
||||
{
|
||||
@@ -4170,12 +4170,12 @@ class Form
|
||||
{
|
||||
print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency));
|
||||
}
|
||||
elseif ($filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%'))")
|
||||
elseif ($filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%'))")
|
||||
{
|
||||
// Replace trans key with CompanyHasDownPaymentOrCommercialDiscount
|
||||
print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency));
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency));
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
|
||||
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2016-2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -938,9 +938,9 @@ class FormFile
|
||||
if ($object->element == 'project_task') $relativepath='Call_not_supported_._Call_function_using_a_defined_relative_path_.';
|
||||
}
|
||||
// For backward compatiblity, we detect file is stored into an old path
|
||||
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO) && $file['level1name'] == 'photos')
|
||||
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO) && $filearray[0]['level1name'] == 'photos')
|
||||
{
|
||||
$relativepath=preg_replace('/^.*\/produit\//','',$file['path']).'/';
|
||||
$relativepath=preg_replace('/^.*\/produit\//','',$filearray[0]['path']).'/';
|
||||
}
|
||||
// Defined relative dir to DOL_DATA_ROOT
|
||||
$relativedir = '';
|
||||
|
||||
@@ -89,6 +89,7 @@ abstract class DoliDB implements Database
|
||||
*/
|
||||
function idate($param)
|
||||
{
|
||||
// TODO GMT $param should be gmt, so we should add tzouptut to 'gmt'
|
||||
return dol_print_date($param,"%Y%m%d%H%M%S");
|
||||
}
|
||||
|
||||
@@ -238,16 +239,16 @@ abstract class DoliDB implements Database
|
||||
else $return.=', ';
|
||||
|
||||
$return.=preg_replace('/[^0-9a-z_\.]/i','',$val);
|
||||
|
||||
|
||||
$tmpsortorder = trim($orders[$i]);
|
||||
|
||||
|
||||
// Only ASC and DESC values are valid SQL
|
||||
if (strtoupper($tmpsortorder) === 'ASC') {
|
||||
$return .= ' ASC';
|
||||
} elseif (strtoupper($tmpsortorder) === 'DESC') {
|
||||
$return .= ' DESC';
|
||||
}
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
return $return;
|
||||
@@ -279,6 +280,7 @@ abstract class DoliDB implements Database
|
||||
*/
|
||||
function jdate($string, $gm=false)
|
||||
{
|
||||
// TODO GMT must set param gm to true by default
|
||||
if ($string==0 || $string=="0000-00-00 00:00:00") return '';
|
||||
$string=preg_replace('/([^0-9])/i','',$string);
|
||||
$tmp=$string.'000000';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright (C) 2011-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
// Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
// Copyright (C) 2011-2017 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
|
||||
@@ -26,6 +26,50 @@ $(document).ready(function() {
|
||||
var table_element = $('#jeditable_table_element').html();
|
||||
var fk_element = $('#jeditable_fk_element').html();
|
||||
|
||||
|
||||
if ($('.editval_string').length > 0) {
|
||||
$('.editval_string').editable(urlSaveInPlace, {
|
||||
type : 'text',
|
||||
id : 'field',
|
||||
width : withInPlace, /* Size of string area in px ? */
|
||||
tooltip : tooltipInPlace,
|
||||
placeholder : placeholderInPlace,
|
||||
cancel : cancelInPlace,
|
||||
submit : submitInPlace,
|
||||
indicator : indicatorInPlace,
|
||||
submitdata : function(result, settings) {
|
||||
return getParameters(this, 'string');
|
||||
},
|
||||
callback : function(result, settings) {
|
||||
getResult(this, result);
|
||||
},
|
||||
onreset : function(result, settings) {
|
||||
getDefault(settings);
|
||||
}
|
||||
});
|
||||
$('.editkey_string').hover(
|
||||
function () {
|
||||
console.log("We are hover (entry) an editkey_string");
|
||||
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
|
||||
},
|
||||
function () {
|
||||
console.log("We are no more hover an editkey_string");
|
||||
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
|
||||
}
|
||||
);
|
||||
$('.editkey_string').click(function() {
|
||||
console.log("We click on the edit field");
|
||||
$('#viewval_' + $(this).attr('id')).click();
|
||||
$('#viewval_' + $(this).attr('id')).hide();
|
||||
$('#editval_' + $(this).attr('id')).show().click();
|
||||
});
|
||||
$('.viewval_string.active').click(function() {
|
||||
console.log("We click on the viewed value");
|
||||
$('#viewval_' + $(this).attr('id').substr(8)).hide();
|
||||
$('#editval_' + $(this).attr('id').substr(8)).show().click();
|
||||
});
|
||||
}
|
||||
|
||||
if ($('.editval_textarea').length > 0) {
|
||||
$('.editval_textarea').editable(urlSaveInPlace, {
|
||||
type : 'textarea',
|
||||
@@ -127,49 +171,6 @@ $(document).ready(function() {
|
||||
});
|
||||
}
|
||||
|
||||
if ($('.editval_string').length > 0) {
|
||||
$('.editval_string').editable(urlSaveInPlace, {
|
||||
type : 'text',
|
||||
id : 'field',
|
||||
width : withInPlace, /* Size of string area in px ? */
|
||||
tooltip : tooltipInPlace,
|
||||
placeholder : placeholderInPlace,
|
||||
cancel : cancelInPlace,
|
||||
submit : submitInPlace,
|
||||
indicator : indicatorInPlace,
|
||||
submitdata : function(result, settings) {
|
||||
return getParameters(this, 'string');
|
||||
},
|
||||
callback : function(result, settings) {
|
||||
getResult(this, result);
|
||||
},
|
||||
onreset : function(result, settings) {
|
||||
getDefault(settings);
|
||||
}
|
||||
});
|
||||
$('.editkey_string').hover(
|
||||
function () {
|
||||
console.log("We are hover (entry) an editkey_string");
|
||||
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
|
||||
},
|
||||
function () {
|
||||
console.log("We are no more hover an editkey_string");
|
||||
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
|
||||
}
|
||||
);
|
||||
$('.editkey_string').click(function() {
|
||||
$( '#viewval_' + $(this).attr('id') ).click();
|
||||
});
|
||||
$('.viewval_string.active').click(function() {
|
||||
$('#viewval_' + $(this).attr('id').substr(8)).hide();
|
||||
$('#editval_' + $(this).attr('id').substr(8)).show().click();
|
||||
});
|
||||
$('.editkey_string').click(function() {
|
||||
$('#viewval_' + $(this).attr('id')).hide();
|
||||
$('#editval_' + $(this).attr('id')).show().click();
|
||||
});
|
||||
}
|
||||
|
||||
if ($('.editval_numeric').length > 0) {
|
||||
$('.editval_numeric').editable(urlSaveInPlace, {
|
||||
type : 'text',
|
||||
|
||||
@@ -414,7 +414,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $
|
||||
if ($forcefocus) $msg.= '.select2(\'focus\')';
|
||||
$msg.= ';'."\n";
|
||||
|
||||
if (count($events)) // If an array of js events to do were provided.
|
||||
if (is_array($events) && count($events)) // If an array of js events to do were provided.
|
||||
{
|
||||
$msg.= '
|
||||
jQuery("#'.$htmlname.'").change(function () {
|
||||
|
||||
@@ -1359,10 +1359,10 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
||||
else $out.='-'.dol_print_date($histo[$key]['dateend'],'dayhour');
|
||||
}
|
||||
$late=0;
|
||||
if ($histo[$key]['percent'] == 0 && $histo[$key]['datestart'] && $db->jdate($histo[$key]['datestart']) < ($now - $delay_warning)) $late=1;
|
||||
if ($histo[$key]['percent'] == 0 && ! $histo[$key]['datestart'] && $histo[$key]['dateend'] && $db->jdate($histo[$key]['datestart']) < ($now - $delay_warning)) $late=1;
|
||||
if ($histo[$key]['percent'] > 0 && $histo[$key]['percent'] < 100 && $histo[$key]['dateend'] && $db->jdate($histo[$key]['dateend']) < ($now - $delay_warning)) $late=1;
|
||||
if ($histo[$key]['percent'] > 0 && $histo[$key]['percent'] < 100 && ! $histo[$key]['dateend'] && $histo[$key]['datestart'] && $db->jdate($histo[$key]['datestart']) < ($now - $delay_warning)) $late=1;
|
||||
if ($histo[$key]['percent'] == 0 && $histo[$key]['datestart'] && $histo[$key]['datestart'] < ($now - $delay_warning)) $late=1;
|
||||
if ($histo[$key]['percent'] == 0 && ! $histo[$key]['datestart'] && $histo[$key]['dateend'] && $histo[$key]['datestart'] < ($now - $delay_warning)) $late=1;
|
||||
if ($histo[$key]['percent'] > 0 && $histo[$key]['percent'] < 100 && $histo[$key]['dateend'] && $histo[$key]['dateend'] < ($now - $delay_warning)) $late=1;
|
||||
if ($histo[$key]['percent'] > 0 && $histo[$key]['percent'] < 100 && ! $histo[$key]['dateend'] && $histo[$key]['datestart'] && $histo[$key]['datestart'] < ($now - $delay_warning)) $late=1;
|
||||
if ($late) $out.=img_warning($langs->trans("Late")).' ';
|
||||
$out.="</td>\n";
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ function dol_basename($pathfile)
|
||||
* @param int $recursive Determines whether subdirectories are searched
|
||||
* @param string $filter Regex filter to restrict list. This regex value must be escaped for '/' by doing preg_quote($var,'/'), since this char is used for preg_match function,
|
||||
* but must not contains the start and end '/'. Filter is checked into basename only.
|
||||
* @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). Exclude is checked into fullpath.
|
||||
* @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). Exclude is checked both into fullpath and into basename (So '^xxx' may exclude 'xxx/dirscanned/...' and dirscanned/xxx').
|
||||
* @param string $sortcriteria Sort criteria ("","fullname","relativename","name","date","size")
|
||||
* @param string $sortorder Sort order (SORT_ASC, SORT_DESC)
|
||||
* @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only
|
||||
@@ -107,6 +107,7 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
|
||||
while (false !== ($file = readdir($dir))) // $file is always a basename (into directory $newpath)
|
||||
{
|
||||
if (! utf8_check($file)) $file=utf8_encode($file); // To be sure data is stored in utf8 in memory
|
||||
$fullpathfile=($newpath?$newpath.'/':'').$file;
|
||||
|
||||
$qualified=1;
|
||||
|
||||
@@ -120,10 +121,11 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
|
||||
// Check if file is qualified
|
||||
foreach($excludefilterarray as $filt)
|
||||
{
|
||||
if (preg_match('/'.$filt.'/i',$file)) {
|
||||
if (preg_match('/'.$filt.'/i', $file) || preg_match('/'.$filt.'/i', $fullpathfile)) {
|
||||
$qualified=0; break;
|
||||
}
|
||||
}
|
||||
//print $fullpathfile.' '.$file.' '.$qualified.'<br>';
|
||||
|
||||
if ($qualified)
|
||||
{
|
||||
@@ -968,7 +970,11 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
|
||||
$file_name_osencoded=dol_osencode($file_name);
|
||||
|
||||
// Check if destination dir is writable
|
||||
// TODO
|
||||
if (! is_writable(dirname($file_name_osencoded)))
|
||||
{
|
||||
dol_syslog("Files.lib::dol_move_uploaded_file Dir ".dirname($file_name_osencoded)." is not writable. Return 'ErrorDirNotWritable'", LOG_WARNING);
|
||||
return 'ErrorDirNotWritable';
|
||||
}
|
||||
|
||||
// Check if destination file already exists
|
||||
if (! $allowoverwrite)
|
||||
|
||||
@@ -238,6 +238,17 @@ function dol_shutdown()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if we are in a context of submitting a parameter
|
||||
*
|
||||
* @param string $paramname Name or parameter to test
|
||||
* @return boolean True if we have just submit a POST or GET request with the parameter provided (even if param is empty)
|
||||
*/
|
||||
function GETPOSTISSET($paramname)
|
||||
{
|
||||
return (isset($_POST[$paramname]) || isset($_GET[$paramname]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return value of a param into GET or POST supervariable.
|
||||
* Use the property $user->default_values[path]['creatform'] and/or $user->default_values[path]['filters'] and/or $user->default_values[path]['sortorder']
|
||||
@@ -257,12 +268,13 @@ function dol_shutdown()
|
||||
* 'custom'= custom filter specify $filter and $options)
|
||||
* @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie)
|
||||
* @param int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails)
|
||||
* @param mixed $options Options to pass to filter_var when $check is set to 'custom'.
|
||||
* @param mixed $options Options to pass to filter_var when $check is set to 'custom'
|
||||
* @param string $noreplace Force disable of replacement of __xxx__ strings.
|
||||
* @return string|string[] Value found (string or array), or '' if check fails
|
||||
*
|
||||
* @TODO Set default value for check to alpha. Check all WYSIWYG edition (email and description...) is still ok with rich text.
|
||||
*/
|
||||
function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL)
|
||||
function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
|
||||
{
|
||||
global $mysoc,$user,$conf;
|
||||
|
||||
@@ -366,7 +378,7 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL)
|
||||
// Substitution variables for GETPOST (used to get final url with variable parameters or final default value with variable paramaters)
|
||||
// Example of variables: __DAY__, __MONTH__, __YEAR__, __MYCOUNTRYID__, __USERID__, __ENTITYID__, ...
|
||||
// We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text.
|
||||
if (! is_array($out) && empty($_POST[$paramname]))
|
||||
if (! is_array($out) && empty($_POST[$paramname]) && empty($noreplace))
|
||||
{
|
||||
$maxloop=20; $loopnb=0; // Protection against infinite loop
|
||||
while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side.
|
||||
@@ -1236,7 +1248,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
||||
&& (! file_exists($fileimagebis) || (filemtime($fileimagebis) < filemtime($file)))
|
||||
)
|
||||
{
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experienc trouble with pdf thumb generation and imagick, you can disable here.
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experience trouble with pdf thumb generation and imagick, you can disable here.
|
||||
{
|
||||
$ret = dol_convert_file($file, 'png', $fileimage);
|
||||
if ($ret < 0) $error++;
|
||||
@@ -1769,11 +1781,13 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
|
||||
if (empty($localtz)) {
|
||||
$localtz = new DateTimeZone('UTC');
|
||||
}
|
||||
|
||||
//var_dump($localtz);
|
||||
//var_dump($year.'-'.$month.'-'.$day.'-'.$hour.'-'.$minute);
|
||||
$dt = new DateTime(null,$localtz);
|
||||
$dt->setDate($year,$month,$day);
|
||||
$dt->setTime((int) $hour, (int) $minute, (int) $second);
|
||||
$date=$dt->getTimestamp(); // should include daylight saving time
|
||||
//var_dump($date);
|
||||
return $date;
|
||||
}
|
||||
else
|
||||
@@ -4305,6 +4319,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr
|
||||
{
|
||||
$product->get_buyprice($idprodfournprice,0,0,0);
|
||||
$ret=$product->vatrate_supplier;
|
||||
if ($product->default_vat_code) $ret.=' ('.$product->default_vat_code.')';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1822,7 +1822,7 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0)
|
||||
function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = null)
|
||||
{
|
||||
if (empty($hookmanager)) global $hookmanager;
|
||||
|
||||
|
||||
$reshook=0;
|
||||
$result='';
|
||||
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) )
|
||||
@@ -1841,10 +1841,14 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm
|
||||
if ($object->lines[$i]->special_code == 3) return '';
|
||||
if (empty($hidedetails) || $hidedetails > 1)
|
||||
{
|
||||
if($conf->global->SITUATION_DISPLAY_DIFF_ON_PDF)
|
||||
if ($conf->global->SITUATION_DISPLAY_DIFF_ON_PDF)
|
||||
{
|
||||
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
|
||||
$result = ( $object->lines[$i]->situation_percent - $prev_progress) . '%';
|
||||
$prev_progress = 0;
|
||||
if (method_exists($object, 'get_prev_progress'))
|
||||
{
|
||||
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
|
||||
}
|
||||
$result = ($object->lines[$i]->situation_percent - $prev_progress) . '%';
|
||||
}
|
||||
else
|
||||
$result = $object->lines[$i]->situation_percent . '%';
|
||||
@@ -1891,12 +1895,17 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0)
|
||||
if (empty($hidedetails) || $hidedetails > 1)
|
||||
{
|
||||
$total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ht : $object->lines[$i]->total_ht);
|
||||
if ($object->lines[$i]->situation_percent > 0 )
|
||||
if ($object->lines[$i]->situation_percent > 0)
|
||||
{
|
||||
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
|
||||
$progress = ( $object->lines[$i]->situation_percent - $prev_progress) /100;
|
||||
$result.=price($sign * ($total_ht/($object->lines[$i]->situation_percent/100)) * $progress, 0, $outputlangs);
|
||||
}
|
||||
$prev_progress = 0;
|
||||
$progress = 1;
|
||||
if (method_exists($object, 'get_prev_progress'))
|
||||
{
|
||||
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
|
||||
$progress = ($object->lines[$i]->situation_percent - $prev_progress) / 100;
|
||||
}
|
||||
$result.=price($sign * ($total_ht/($object->lines[$i]->situation_percent/100)) * $progress, 0, $outputlangs);
|
||||
}
|
||||
else
|
||||
$result.=price($sign * $total_ht, 0, $outputlangs);
|
||||
}
|
||||
|
||||
@@ -477,3 +477,42 @@ function measuring_units_string($unit,$measuring_style='')
|
||||
|
||||
return $measuring_units[$unit];
|
||||
}
|
||||
|
||||
/**
|
||||
* Transform a given unit into the square of that unit, if known
|
||||
*
|
||||
* @param int $unit Unit key (-3,-2,-1,0,98,99...)
|
||||
* @return int Squared unit key (-6,-4,-2,0,98,99...)
|
||||
* @see formproduct->load_measuring_units
|
||||
*/
|
||||
function measuring_units_squared($unit)
|
||||
{
|
||||
$measuring_units=array();
|
||||
$measuring_units[0] = 0; // m -> m3
|
||||
$measuring_units[-1] = -2; // dm-> dm2
|
||||
$measuring_units[-2] = -4; // cm -> cm2
|
||||
$measuring_units[-3] = -6; // mm -> mm2
|
||||
$measuring_units[98] = 98; // foot -> foot2
|
||||
$measuring_units[99] = 99; // inch -> inch2
|
||||
return $measuring_units[$unit];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Transform a given unit into the cube of that unit, if known
|
||||
*
|
||||
* @param int $unit Unit key (-3,-2,-1,0,98,99...)
|
||||
* @return int Cubed unit key (-9,-6,-3,0,88,89...)
|
||||
* @see formproduct->load_measuring_units
|
||||
*/
|
||||
function measuring_units_cubed($unit)
|
||||
{
|
||||
$measuring_units=array();
|
||||
$measuring_units[0] = 0; // m -> m2
|
||||
$measuring_units[-1] = -3; // dm-> dm3
|
||||
$measuring_units[-2] = -6; // cm -> cm3
|
||||
$measuring_units[-3] = -9; // mm -> mm3
|
||||
$measuring_units[98] = 88; // foot -> foot3
|
||||
$measuring_units[99] = 89; // inch -> inch3
|
||||
return $measuring_units[$unit];
|
||||
}
|
||||
|
||||
@@ -242,9 +242,9 @@ function restrictedArea($user, $features, $objectid=0, $tableandshare='', $featu
|
||||
{
|
||||
foreach($feature2 as $subfeature)
|
||||
{
|
||||
if (empty($user->rights->$feature->$subfeature->creer)
|
||||
&& empty($user->rights->$feature->$subfeature->write)
|
||||
&& empty($user->rights->$feature->$subfeature->create)) { $createok=0; $nbko++; }
|
||||
if (empty($user->rights->$feature->$subfeature->creer)
|
||||
&& empty($user->rights->$feature->$subfeature->write)
|
||||
&& empty($user->rights->$feature->$subfeature->create)) { $createok=0; $nbko++; }
|
||||
else { $createok=1; break; } // Break to bypass second test if the first is ok
|
||||
}
|
||||
}
|
||||
@@ -306,6 +306,9 @@ function restrictedArea($user, $features, $objectid=0, $tableandshare='', $featu
|
||||
else if ($feature == 'ftp')
|
||||
{
|
||||
if (! $user->rights->ftp->write) $deleteok=0;
|
||||
}else if ($feature == 'salaries')
|
||||
{
|
||||
if (! $user->rights->salaries->delete) $deleteok=0;
|
||||
}
|
||||
else if (! empty($feature2)) // This should be used for future changes
|
||||
{
|
||||
@@ -379,7 +382,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandsh
|
||||
$checkother = array('contact','agenda'); // Test on entity and link to third party. Allowed if link is empty (Ex: contacts...).
|
||||
$checkproject = array('projet','project'); // Test for project object
|
||||
$checktask = array('projet_task');
|
||||
$nocheck = array('barcode','stock','fournisseur'); // No test
|
||||
$nocheck = array('barcode','stock'); // No test
|
||||
$checkdefault = 'all other not already defined'; // Test on entity and link to third party. Not allowed if link is empty (Ex: invoice, orders...).
|
||||
|
||||
// If dbtablename not defined, we use same name for table than module name
|
||||
@@ -499,7 +502,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandsh
|
||||
$sql.= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
|
||||
}
|
||||
}
|
||||
else if (! in_array($feature,$nocheck)) // By default we check with link to third party
|
||||
else if (! in_array($feature,$nocheck)) // By default (case of $checkdefault), we check on object entity + link to third party on field $dbt_keyfield
|
||||
{
|
||||
// If external user: Check permission for external users
|
||||
if ($user->societe_id > 0)
|
||||
@@ -521,7 +524,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandsh
|
||||
$sql.= " WHERE dbt.".$dbt_select." = ".$objectid;
|
||||
$sql.= " AND sc.fk_soc = dbt.".$dbt_keyfield;
|
||||
$sql.= " AND dbt.".$dbt_keyfield." = s.rowid";
|
||||
$sql.= " AND s.entity IN (".getEntity($sharedelement, 1).")";
|
||||
$sql.= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
|
||||
$sql.= " AND sc.fk_user = ".$user->id;
|
||||
}
|
||||
// If multicompany and internal users with all permissions, check user is in correct entity
|
||||
|
||||
@@ -667,13 +667,13 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->SetFont('','B', $default_font_size - 2);
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$titre = $outputlangs->transnoentities("PaymentConditions").':';
|
||||
$pdf->MultiCell(80, 4, $titre, 0, 'L');
|
||||
$pdf->MultiCell(43, 4, $titre, 0, 'L');
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY($posxval, $posy);
|
||||
$lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc);
|
||||
$lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement);
|
||||
$pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L');
|
||||
$pdf->MultiCell(67, 4, $lib_condition_paiement,0,'L');
|
||||
|
||||
$posy=$pdf->GetY()+3;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -280,14 +281,14 @@ class doc_generic_contract_odt extends ModelePDFContract
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
|
||||
else {
|
||||
$socobject = $object->client;
|
||||
$socobject = $object->thirdparty;
|
||||
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
|
||||
$contactobject = $object->contact;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$socobject=$object->client;
|
||||
$socobject=$object->thirdparty;
|
||||
}
|
||||
// Make substitution
|
||||
$substitutionarray=array(
|
||||
|
||||
@@ -892,13 +892,13 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->SetFont('','B', $default_font_size - 2);
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$titre = $outputlangs->transnoentities("PaymentConditions").':';
|
||||
$pdf->MultiCell(80, 4, $titre, 0, 'L');
|
||||
$pdf->MultiCell(43, 4, $titre, 0, 'L');
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY($posxval, $posy);
|
||||
$lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc);
|
||||
$lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement);
|
||||
$pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L');
|
||||
$pdf->MultiCell(67, 4, $lib_condition_paiement,0,'L');
|
||||
|
||||
$posy=$pdf->GetY()+3;
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/modules/import/import_csv.modules.php
|
||||
* \file htdocs/core/modules/import/import_xlsx.modules.php
|
||||
* \ingroup import
|
||||
* \brief File to load import files with CSV format
|
||||
* \brief File to load import files with Excel format
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/modules/import/modules_import.php';
|
||||
@@ -54,10 +54,10 @@ class ImportXlsx extends ModeleImports
|
||||
|
||||
var $cacheconvert=array(); // Array to cache list of value found after a convertion
|
||||
var $cachefieldtable=array(); // Array to cache list of value found into fields@tables
|
||||
|
||||
|
||||
var $workbook; // temporary import file
|
||||
var $record; // current record
|
||||
var $headers;
|
||||
var $headers;
|
||||
|
||||
|
||||
/**
|
||||
@@ -95,7 +95,7 @@ class ImportXlsx extends ModeleImports
|
||||
if (preg_match('/^societe_/',$datatoimport)) $this->thirpartyobject=new Societe($this->db);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Output header of an example file for this format
|
||||
*
|
||||
@@ -144,7 +144,7 @@ class ImportXlsx extends ModeleImports
|
||||
foreach($headerlinefields as $field) {
|
||||
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($col, 1, $outputlangs->transnoentities($field));
|
||||
// set autowidth
|
||||
//$this->workbook->getActiveSheet()->getColumnDimension($this->column2Letter($col + 1))->setAutoSize(true);
|
||||
//$this->workbook->getActiveSheet()->getColumnDimension($this->column2Letter($col + 1))->setAutoSize(true);
|
||||
$col++;
|
||||
}
|
||||
return ''; // final output will be generated in footer
|
||||
@@ -211,10 +211,10 @@ class ImportXlsx extends ModeleImports
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return nb of records. File must be closed.
|
||||
*
|
||||
*
|
||||
* @param string $file Path of filename
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
@@ -222,15 +222,15 @@ class ImportXlsx extends ModeleImports
|
||||
{
|
||||
$reader = new PHPExcel_Reader_Excel2007();
|
||||
$this->workbook = $reader->load($file);
|
||||
|
||||
|
||||
$rowcount = $this->workbook->getActiveSheet()->getHighestDataRow();
|
||||
|
||||
|
||||
$this->workbook->disconnectWorksheets();
|
||||
unset($this->workbook);
|
||||
|
||||
|
||||
return $rowcount;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Input header line from file
|
||||
@@ -399,7 +399,7 @@ class ImportXlsx extends ModeleImports
|
||||
if (! is_numeric($newval) && $newval != '' && ! preg_match('/^id:/i',$newval)) $isidorref='ref';
|
||||
$newval=preg_replace('/^(id|ref):/i','',$newval); // Remove id: or ref: that was used to force if field is id or ref
|
||||
//print 'Val is now '.$newval.' and is type '.$isidorref."<br>\n";
|
||||
|
||||
|
||||
if ($isidorref == 'ref') // If value into input import file is a ref, we apply the function defined into descriptor
|
||||
{
|
||||
$file=(empty($objimport->array_import_convertvalue[0][$val]['classfile'])?$objimport->array_import_convertvalue[0][$val]['file']:$objimport->array_import_convertvalue[0][$val]['classfile']);
|
||||
@@ -502,9 +502,9 @@ class ImportXlsx extends ModeleImports
|
||||
}
|
||||
if (is_numeric($defaultref) && $defaultref <= 0) $defaultref='';
|
||||
$newval=$defaultref;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='numeric')
|
||||
{
|
||||
$newval = price2num($newval);
|
||||
@@ -616,7 +616,7 @@ class ImportXlsx extends ModeleImports
|
||||
// We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields)
|
||||
if (empty($lastinsertid)) {
|
||||
$sqlSelect = 'SELECT rowid FROM '.$tablename;
|
||||
|
||||
|
||||
$data = array_combine($listfields, $listvalues);
|
||||
$where = array();
|
||||
$filters = array();
|
||||
@@ -627,7 +627,7 @@ class ImportXlsx extends ModeleImports
|
||||
$filters[] = $col.' = '.$data[$key];
|
||||
}
|
||||
$sqlSelect.= ' WHERE '.implode(' AND ', $where);
|
||||
|
||||
|
||||
$resql=$this->db->query($sqlSelect);
|
||||
if($resql) {
|
||||
$res = $this->db->fetch_object($resql);
|
||||
@@ -650,23 +650,23 @@ class ImportXlsx extends ModeleImports
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!empty($lastinsertid)) {
|
||||
// Build SQL UPDATE request
|
||||
$sqlstart = 'UPDATE '.$tablename;
|
||||
|
||||
|
||||
$data = array_combine($listfields, $listvalues);
|
||||
$set = array();
|
||||
foreach ($data as $key => $val) {
|
||||
$set[] = $key.' = '.$val;
|
||||
}
|
||||
$sqlstart.= ' SET '.implode(', ', $set);
|
||||
|
||||
|
||||
if(empty($keyfield)) $keyfield = 'rowid';
|
||||
$sqlend = ' WHERE '.$keyfield.' = '.$lastinsertid;
|
||||
|
||||
|
||||
$sql = $sqlstart.$sqlend;
|
||||
|
||||
|
||||
// Run update request
|
||||
$resql=$this->db->query($sql);
|
||||
if($resql) {
|
||||
@@ -691,14 +691,14 @@ class ImportXlsx extends ModeleImports
|
||||
if (! empty($tablewithentity_cache[$tablename])) {
|
||||
$sqlstart.= ', entity';
|
||||
$sqlend.= ', '.$conf->entity;
|
||||
}
|
||||
}
|
||||
if (! empty($objimport->array_import_tables_creator[0][$alias])) {
|
||||
$sqlstart.= ', '.$objimport->array_import_tables_creator[0][$alias];
|
||||
$sqlend.=', '.$user->id;
|
||||
}
|
||||
$sql = $sqlstart.$sqlend.')';
|
||||
dol_syslog("import_xlsx.modules", LOG_DEBUG);
|
||||
|
||||
|
||||
// Run insert request
|
||||
if ($sql)
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ class mailing_fraise extends MailingTargets
|
||||
*/
|
||||
function getSqlArrayForStats()
|
||||
{
|
||||
global $langs;
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load("members");
|
||||
|
||||
@@ -73,7 +73,7 @@ class mailing_fraise extends MailingTargets
|
||||
$statssql=array();
|
||||
|
||||
$statssql[0] ="SELECT '".$this->db->escape($langs->trans("FundationMembers"))."' as label, count(*) as nb";
|
||||
$statssql[0].=" FROM ".MAIN_DB_PREFIX."adherent where statut = 1";
|
||||
$statssql[0].=" FROM ".MAIN_DB_PREFIX."adherent where statut = 1 and entity IN (".getEntity('member').")";
|
||||
|
||||
return $statssql;
|
||||
}
|
||||
@@ -89,9 +89,11 @@ class mailing_fraise extends MailingTargets
|
||||
*/
|
||||
function getNbOfRecipients($sql='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT count(distinct(a.email)) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
||||
$sql .= " WHERE (a.email IS NOT NULL AND a.email != '')";
|
||||
$sql .= " WHERE (a.email IS NOT NULL AND a.email != '') AND a.entity IN (".getEntity('member').")";
|
||||
|
||||
// La requete doit retourner un champ "nb" pour etre comprise
|
||||
// par parent::getNbOfRecipients
|
||||
@@ -201,7 +203,7 @@ class mailing_fraise extends MailingTargets
|
||||
$sql.= " a.lastname, a.firstname,";
|
||||
$sql.= " a.datefin, a.civility as civility_id, a.login, a.societe"; // Other fields
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta";
|
||||
$sql.= " WHERE a.email <> ''"; // Note that null != '' is false
|
||||
$sql.= " WHERE a.entity IN (".getEntity('member').") AND a.email <> ''"; // Note that null != '' is false
|
||||
$sql.= " AND a.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
|
||||
if (isset($_POST["filter"]) && $_POST["filter"] == '-1') $sql.= " AND a.statut=-1";
|
||||
if (isset($_POST["filter"]) && $_POST["filter"] == '1a') $sql.= " AND a.statut=1 AND a.datefin >= '".$this->db->idate($now)."'";
|
||||
|
||||
@@ -307,14 +307,14 @@ class doc_generic_product_odt extends ModelePDFProduct
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
|
||||
else {
|
||||
$socobject = $object->client;
|
||||
$socobject = $object->thirdparty;
|
||||
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
|
||||
$contactobject = $object->contact;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$socobject=$object->client;
|
||||
$socobject=$object->thirdparty;
|
||||
}
|
||||
// Make substitution
|
||||
$substitutionarray=array(
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user