mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 17:02:34 +01:00
Compare commits
132 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8aa8051dc | ||
|
|
a7e1a45571 | ||
|
|
60486417c3 | ||
|
|
c9ee9c7a38 | ||
|
|
8f3f28c28f | ||
|
|
ac8a21a3d9 | ||
|
|
769c30de9d | ||
|
|
2b926978ae | ||
|
|
6540451078 | ||
|
|
3ea1345a5b | ||
|
|
0d35892003 | ||
|
|
8a8c2170cc | ||
|
|
599300dfec | ||
|
|
1e6e7af9f7 | ||
|
|
56cd154258 | ||
|
|
2f476aa0a0 | ||
|
|
47d7ea1813 | ||
|
|
47d5c5baad | ||
|
|
91fdb6a569 | ||
|
|
1997b029c7 | ||
|
|
753400ccf5 | ||
|
|
b83a4d4815 | ||
|
|
8127ced19b | ||
|
|
8bd2f9cfb5 | ||
|
|
0b3a2b744e | ||
|
|
cd992d553e | ||
|
|
db00ca9dd7 | ||
|
|
542dc8f98f | ||
|
|
497aa9c453 | ||
|
|
c80badafe0 | ||
|
|
3aebd50d39 | ||
|
|
85f03913fe | ||
|
|
a3260f3e14 | ||
|
|
825130d633 | ||
|
|
1d66d97032 | ||
|
|
df4bfc77a4 | ||
|
|
8fe8a1a6fd | ||
|
|
6fe9a8ee0d | ||
|
|
7e94d8ae52 | ||
|
|
878d5612a1 | ||
|
|
377d6dc290 | ||
|
|
2b9f4fed8d | ||
|
|
890579d13d | ||
|
|
3dab78afb7 | ||
|
|
d9ebc43cb6 | ||
|
|
6d85629495 | ||
|
|
0e12931d0f | ||
|
|
9690a0bc69 | ||
|
|
8b02d9e912 | ||
|
|
399aaf1459 | ||
|
|
e707f73067 | ||
|
|
8506df28d7 | ||
|
|
2868961661 | ||
|
|
ae945732be | ||
|
|
10e72d70ae | ||
|
|
fa1d8a3f34 | ||
|
|
6600993796 | ||
|
|
bcc92dbd62 | ||
|
|
ad3fd83478 | ||
|
|
2763374ff1 | ||
|
|
a2fecc2616 | ||
|
|
4ecf7d9493 | ||
|
|
f9dfe1bcfb | ||
|
|
a119cd3f36 | ||
|
|
c019857bda | ||
|
|
b020dbf96f | ||
|
|
1185e0f731 | ||
|
|
d6243a33af | ||
|
|
e9128db1aa | ||
|
|
e8c9a9c87d | ||
|
|
80c6716581 | ||
|
|
9de912ba12 | ||
|
|
930f492a14 | ||
|
|
665526a6e7 | ||
|
|
0ac5f38e02 | ||
|
|
4a9bf30bd1 | ||
|
|
89908052c0 | ||
|
|
53c1672b9f | ||
|
|
8b13f2ab81 | ||
|
|
f1870ae37d | ||
|
|
592d70d4ea | ||
|
|
218ae3dbd5 | ||
|
|
b7163bea5d | ||
|
|
01b361a98b | ||
|
|
fd0cd7257c | ||
|
|
b36b56b7a1 | ||
|
|
4a111234a0 | ||
|
|
e2d71b3215 | ||
|
|
0fbd626822 | ||
|
|
a79d440a9b | ||
|
|
78deb405b2 | ||
|
|
5046c20b81 | ||
|
|
8b28893fbe | ||
|
|
c4f3e872ca | ||
|
|
f0cfbb8b0d | ||
|
|
0511ba87f4 | ||
|
|
04d5a41e9c | ||
|
|
62c3f04392 | ||
|
|
feaf5266e9 | ||
|
|
2b75c81af9 | ||
|
|
d3986b4936 | ||
|
|
9c08abb52c | ||
|
|
185c03eea5 | ||
|
|
9614881bed | ||
|
|
dbb62f010d | ||
|
|
8de657a215 | ||
|
|
e20b0b2e7b | ||
|
|
21ad42afab | ||
|
|
99b33a70a3 | ||
|
|
dfda863b7e | ||
|
|
37f866c31f | ||
|
|
7a3f6b9acc | ||
|
|
de7b060e12 | ||
|
|
f25802520a | ||
|
|
a7d6289d4b | ||
|
|
d12700aeab | ||
|
|
77688cf988 | ||
|
|
b66aeabb88 | ||
|
|
49ae52c708 | ||
|
|
9fbd6f0b58 | ||
|
|
433ca88c43 | ||
|
|
aa65ebe136 | ||
|
|
43a8b9176f | ||
|
|
6e12d84f14 | ||
|
|
1eac98dc43 | ||
|
|
6691bef701 | ||
|
|
24cc745ae8 | ||
|
|
7a42514833 | ||
|
|
749f371d4e | ||
|
|
bee6b92a7b | ||
|
|
36ff4abe3c | ||
|
|
6012dff11e |
16
ChangeLog
16
ChangeLog
@@ -3,8 +3,20 @@ English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
|
||||
***** ChangeLog for 3.2.2 compared to 3.2.1 *****
|
||||
|
||||
- Fix: Modify spanish VAT to new rates.
|
||||
- Fix: Add error message when creating already existing product.
|
||||
- Fix: Edition of percentage of an event.
|
||||
- Fix: Minor look fix for theme bureau2crea.
|
||||
- Fix: Start and end date not saved at project creation
|
||||
- Fix: Default vat is zero for customer invoices if company does not use vat
|
||||
- Fix: Localtaxes unit prices precision
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.2.1 compared to 3.2.0 *****
|
||||
|
||||
- Fix: Edit of projects.
|
||||
- Fix: Activation of modules does not fails if directory install was removed.
|
||||
- Fix: [ bug #444 ] Regression on auto-closing for proposals and orders.
|
||||
@@ -30,7 +42,10 @@ English Dolibarr ChangeLog
|
||||
- Fix: [ bug #506 ] Can't set percentage of a started event
|
||||
- Fix: Bad assignation of const for pdf delivery module name
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.2.0 compared to 3.1.3 *****
|
||||
|
||||
WARNING: PHP lower than 5.x are no more supported.
|
||||
WARNING: Because of a major datastructure change onto supplier prices tables, be aware
|
||||
to make a backup of your database before making upgrade.
|
||||
@@ -169,6 +184,7 @@ Fix: bug #405 - Late icon always displayed on comm/propal.php
|
||||
|
||||
|
||||
***** ChangeLog for 3.1 compared to 3.0 *****
|
||||
|
||||
WARNING: IE6 browser is no more supported in this version.
|
||||
For users:
|
||||
- New: War against number of clicks:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
dolibarr (3.2.1+nmu1) unstable; urgency=low
|
||||
dolibarr (3.2.3+nmu1) unstable; urgency=low
|
||||
|
||||
* Non-maintainer upload.
|
||||
* New upstream release.
|
||||
|
||||
@@ -180,11 +180,17 @@ case "$1" in
|
||||
|
||||
# Now run the drop user
|
||||
if eval $mysqlcmd -f -e "\"DROP USER '$dbuser'@'localhost';\"" ; then
|
||||
echo postrm Database login $dbuser removed
|
||||
echo postrm Database login $dbuser@localhost removed
|
||||
else
|
||||
error="Unable to run $mysqlcmd -f -e \"DROP USER '$dbuser'@'localhost';\""
|
||||
echo postrm $error
|
||||
fi
|
||||
if eval $mysqlcmd -f -e "\"DROP USER '$dbuser'@'%';\"" ; then
|
||||
echo postrm Database login $dbuser@% removed
|
||||
else
|
||||
error="Unable to run $mysqlcmd -f -e \"DROP USER '$dbuser'@'%';\""
|
||||
echo postrm $error
|
||||
fi
|
||||
|
||||
# Now run the drop commands
|
||||
if eval $mysqlcmd -f -e "\"show databases;\"" | grep -e "^$dbname" > /dev/null 2>&1 ; then
|
||||
|
||||
@@ -31,7 +31,7 @@ PROJECT_NAME = dolibarr
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 3.2.0
|
||||
PROJECT_NUMBER = 3.2.3
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
; ----- Change this -----
|
||||
AppName=DoliWamp
|
||||
; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
|
||||
AppVerName=DoliWamp-3.2.1
|
||||
AppVerName=DoliWamp-3.2.3
|
||||
; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
|
||||
OutputBaseFilename=DoliWamp-3.2.1
|
||||
OutputBaseFilename=DoliWamp-3.2.3
|
||||
; Define full path from wich all relative path are defined
|
||||
; You must modify this to put here your dolibarr root directory
|
||||
;SourceDir=C:\Documents and Settings\ldestail\git\dolibarr_old
|
||||
|
||||
@@ -10,7 +10,7 @@ use Cwd;
|
||||
$PROJECT="dolibarr";
|
||||
$MAJOR="3";
|
||||
$MINOR="2";
|
||||
$BUILD="1"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
|
||||
$BUILD="3"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
|
||||
$RPMSUBVERSION="auto"; # auto use value found into BUILD
|
||||
|
||||
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||
|
||||
@@ -34,7 +34,7 @@ This files describe steps made by Dolibarr packaging team to make a
|
||||
complete release of Dolibarr, step by step.
|
||||
|
||||
- Check all files are commited.
|
||||
- Update version/info in /ChangeLog and /filefunc.inc.php
|
||||
- Update version/info in /ChangeLog
|
||||
- Update version number with x.x.x-y in build/makepack-dolibarr.pl
|
||||
- Update version number with x.x.x-y in build/exe/doliwamp/doliwamp.iss
|
||||
- Update version number with x.x.x-y in htdocs/filefunc.inc.php
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<CompanyName />
|
||||
<Program_Info>
|
||||
<Program_Name>DoliWamp</Program_Name>
|
||||
<Program_Version>3.2.1</Program_Version>
|
||||
<Program_Release_Month>05</Program_Release_Month>
|
||||
<Program_Version>3.2.2</Program_Version>
|
||||
<Program_Release_Month>09</Program_Release_Month>
|
||||
<Program_Release_Day>10</Program_Release_Day>
|
||||
<Program_Release_Year>2012</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<CompanyName />
|
||||
<Program_Info>
|
||||
<Program_Name>Dolibarr</Program_Name>
|
||||
<Program_Version>3.2.1</Program_Version>
|
||||
<Program_Release_Month>05</Program_Release_Month>
|
||||
<Program_Version>3.2.2</Program_Version>
|
||||
<Program_Release_Month>09</Program_Release_Month>
|
||||
<Program_Release_Day>10</Program_Release_Day>
|
||||
<Program_Release_Year>2012</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
</Company_Info>
|
||||
<Program_Info>
|
||||
<Program_Name>Dolibarr</Program_Name>
|
||||
<Program_Version>3.2.1</Program_Version>
|
||||
<Program_Release_Month>08</Program_Release_Month>
|
||||
<Program_Release_Day>10</Program_Release_Day>
|
||||
<Program_Version>3.2.3</Program_Version>
|
||||
<Program_Release_Month>09</Program_Release_Month>
|
||||
<Program_Release_Day>24</Program_Release_Day>
|
||||
<Program_Release_Year>2012</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
<Program_Cost_Other_Code />
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
</Company_Info>
|
||||
<Program_Info>
|
||||
<Program_Name>DoliWamp</Program_Name>
|
||||
<Program_Version>3.2.1</Program_Version>
|
||||
<Program_Release_Month>08</Program_Release_Month>
|
||||
<Program_Release_Day>10</Program_Release_Day>
|
||||
<Program_Version>3.2.3</Program_Version>
|
||||
<Program_Release_Month>09</Program_Release_Month>
|
||||
<Program_Release_Day>24</Program_Release_Day>
|
||||
<Program_Release_Year>2012</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
<Program_Cost_Other_Code />
|
||||
|
||||
@@ -30,7 +30,7 @@ return "Regis Houssin";
|
||||
# script_dolibarr_versions()
|
||||
sub script_dolibarr_versions
|
||||
{
|
||||
return ( "3.2.0", "3.1.1", "3.0.1", "2.9.0" );
|
||||
return ( "3.2.1", "3.1.1", "3.0.1", "2.9.0" );
|
||||
}
|
||||
|
||||
sub script_dolibarr_category
|
||||
@@ -362,7 +362,9 @@ sub script_dolibarr_check_latest
|
||||
{
|
||||
local ($ver) = @_;
|
||||
local @vers = &osdn_package_versions("dolibarr",
|
||||
$ver >= 3 ? "dolibarr\\-(3\\.[0-9\\.]+)\\.tgz" :
|
||||
$ver >= 3.2 ? "dolibarr\\-(3\\.[0-9\\.]+)\\.tgz" :
|
||||
$ver >= 3.1 ? "dolibarr\\-(3\\.1\\.[0-9\\.]+)\\.tgz" :
|
||||
$ver >= 3 ? "dolibarr\\-(3\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||
$ver >= 2.9 ? "dolibarr\\-(2\\.9\\.[0-9\\.]+)\\.tgz" :
|
||||
"dolibarr\\-(2\\.8\\.[0-9\\.]+)\\.tgz");
|
||||
return "Failed to find versions" if (!@vers);
|
||||
|
||||
@@ -312,5 +312,5 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Jul 23 2012 Laurent Destailleur 3.2.1-0.3
|
||||
* Mon Sep 24 2012 Laurent Destailleur 3.2.3-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@@ -368,5 +368,5 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Jul 23 2012 Laurent Destailleur 3.2.1-0.3
|
||||
* Mon Sep 24 2012 Laurent Destailleur 3.2.3-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@@ -301,5 +301,5 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Jul 23 2012 Laurent Destailleur 3.2.1-0.3
|
||||
* Mon Sep 24 2012 Laurent Destailleur 3.2.3-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@@ -306,5 +306,5 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Jul 23 2012 Laurent Destailleur 3.2.1-0.3
|
||||
* Mon Sep 24 2012 Laurent Destailleur 3.2.3-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@@ -1763,290 +1763,6 @@ LOCK TABLES `llx_c_ziptown` WRITE;
|
||||
/*!40000 ALTER TABLE `llx_c_ziptown` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `llx_cabinetmed_c_banques`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `llx_cabinetmed_c_banques`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `llx_cabinetmed_c_banques` (
|
||||
`rowid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(8) NOT NULL,
|
||||
`label` varchar(64) NOT NULL,
|
||||
`active` tinyint(4) NOT NULL DEFAULT '1',
|
||||
PRIMARY KEY (`rowid`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `llx_cabinetmed_c_banques`
|
||||
--
|
||||
|
||||
LOCK TABLES `llx_cabinetmed_c_banques` WRITE;
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_c_banques` DISABLE KEYS */;
|
||||
INSERT INTO `llx_cabinetmed_c_banques` (`rowid`, `code`, `label`, `active`) VALUES (1,'HSBC','HSBC',1);
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_c_banques` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `llx_cabinetmed_c_examconclusion`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `llx_cabinetmed_c_examconclusion`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `llx_cabinetmed_c_examconclusion` (
|
||||
`rowid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(8) NOT NULL,
|
||||
`label` varchar(64) NOT NULL,
|
||||
`active` tinyint(4) NOT NULL DEFAULT '1',
|
||||
PRIMARY KEY (`rowid`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `llx_cabinetmed_c_examconclusion`
|
||||
--
|
||||
|
||||
LOCK TABLES `llx_cabinetmed_c_examconclusion` WRITE;
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_c_examconclusion` DISABLE KEYS */;
|
||||
INSERT INTO `llx_cabinetmed_c_examconclusion` (`rowid`, `code`, `label`, `active`) VALUES (1,'AUTRE','Autre',1);
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_c_examconclusion` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `llx_cabinetmed_cons`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `llx_cabinetmed_cons`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `llx_cabinetmed_cons` (
|
||||
`rowid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`fk_soc` int(11) DEFAULT NULL,
|
||||
`fk_user_creation` int(11) NOT NULL,
|
||||
`datecons` date NOT NULL,
|
||||
`typepriseencharge` varchar(8) DEFAULT NULL,
|
||||
`motifconsprinc` varchar(64) DEFAULT NULL,
|
||||
`diaglesprinc` varchar(64) DEFAULT NULL,
|
||||
`motifconssec` text,
|
||||
`diaglessec` text,
|
||||
`hdm` text,
|
||||
`examenclinique` text,
|
||||
`examenprescrit` text,
|
||||
`traitementprescrit` text,
|
||||
`comment` text,
|
||||
`typevisit` varchar(8) NOT NULL,
|
||||
`infiltration` varchar(256) DEFAULT NULL,
|
||||
`codageccam` varchar(16) DEFAULT NULL,
|
||||
`montant_cheque` double(24,8) DEFAULT NULL,
|
||||
`montant_espece` double(24,8) DEFAULT NULL,
|
||||
`montant_carte` double(24,8) DEFAULT NULL,
|
||||
`montant_tiers` double(24,8) DEFAULT NULL,
|
||||
`banque` varchar(128) DEFAULT NULL,
|
||||
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`rowid`),
|
||||
KEY `idx_cabinetmed_cons_fk_soc` (`fk_soc`),
|
||||
KEY `idx_cabinetmed_cons_datecons` (`datecons`),
|
||||
CONSTRAINT `fk_cabinetmed_cons_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `llx_cabinetmed_cons`
|
||||
--
|
||||
|
||||
LOCK TABLES `llx_cabinetmed_cons` WRITE;
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_cons` DISABLE KEYS */;
|
||||
INSERT INTO `llx_cabinetmed_cons` (`rowid`, `fk_soc`, `fk_user_creation`, `datecons`, `typepriseencharge`, `motifconsprinc`, `diaglesprinc`, `motifconssec`, `diaglessec`, `hdm`, `examenclinique`, `examenprescrit`, `traitementprescrit`, `comment`, `typevisit`, `infiltration`, `codageccam`, `montant_cheque`, `montant_espece`, `montant_carte`, `montant_tiers`, `banque`, `tms`) VALUES (2,2,1,'2011-04-17',NULL,'Cervicalgies Inflammatoires','Arthrite Microcristalline','','','','rrrr','','','','CS','','',NULL,55.00000000,NULL,NULL,'','2011-05-25 13:59:03'),(3,2,1,'2011-05-01',NULL,'Cervicalgies Mécaniques','Arthrite Goutteuse','yyyykk\r\nDorsalgie\r\nDorsalgies Inflammatoires\r\nDouleur Chevillep\r\nDouleur Genou\r\nDouleur Genou','','lll','','','','','CS','','',NULL,NULL,NULL,50.00000000,'','2011-05-25 13:59:03'),(4,4,1,'2011-05-02',NULL,'Autre','Arthrite Goutteuse','','','','','','','','CCAM','inf','ccam',50.00000000,NULL,NULL,NULL,'HSBC','2011-05-25 13:59:03'),(5,5,1,'2011-05-02',NULL,'Cervicalgies Inflammatoires','Arthrite Microcristalline','','dgdfg','','','','','','CCAM','ingg','pp',50.00000000,NULL,NULL,NULL,'HSBC','2011-05-28 15:22:22'),(6,5,1,'2011-05-02',NULL,'Cervicalgies Inflammatoires','Arthrose FémoroPatellaire','','','','','','kk','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-05-25 13:59:03'),(7,4,1,'2011-05-03',NULL,'Cervicalgies Mécaniques','Arthrite Goutteuse','Douleur Cheville','Arthrite Microcristalline','fd','fd','Bilan Phosphocalcique','fdf','fdfd','CCAM','lllll','kkk',NULL,NULL,NULL,0.00000000,'','2011-06-14 23:13:42'),(8,5,1,'2011-05-03',NULL,'Cervicalgies Mécaniques','gggg','','','pppljklj','','','','','CS','kmlkmlkml mlmlkmkm mk ml mlk','',50.00000000,NULL,NULL,NULL,'HSBC','2011-05-28 15:00:27'),(10,3,1,'2011-05-07',NULL,'dfgdf','gfdgd','','','','','','','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-05-25 13:59:03'),(11,9,1,'2011-05-25',NULL,'Dérobement Membres Inférieurs','Arthrite Goutteuse','Dorsalgie\r\nDorsalgies Mécaniques','Lomboradiculalgie Discale\r\nLombosciatique L5 gauche','','','ArthroScanner Genou\r\nIRM Genou\r\nIRM Rachis Lombaire','1\r\n2\r\n3\r\n4\r\n5\r\n6','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-05-28 15:58:29'),(12,32,1,'2011-06-08',NULL,'Cervicalgies Inflammatoires','Arthrite Goutteuse','','','','','','','','CS','','',NULL,NULL,NULL,50.00000000,'','2011-06-08 14:38:10'),(13,26,1,'2011-06-13',NULL,'Cervicalgies Mécaniques','Arthrite Microcristalline','','','','','ArthroScanner Hanche','Traitement prescrit.','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-06-13 15:25:39'),(14,26,1,'2011-06-13',NULL,'Douleur Membre inférieur Gauche','Lombosciatique L5 gauche','','Lombalgie Discale','','','','AINS (biprohénide), murolaxan\r\ndoliprane\r\n+ rééduction','','CCAM','infiltr épidurale','AHLB001',90.00000000,NULL,NULL,NULL,'HSBC','2011-06-13 16:16:43'),(15,1,1,'2011-06-13',NULL,'Cervicalgies Mécaniques','Arthrite Microcristalline','','','','','','','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-06-13 18:07:26'),(16,36,1,'2011-06-15',NULL,'gdfgfd','gdfgdfgdf','','','','','ArthroScanner Epaule','','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-06-15 00:28:43'),(17,36,1,'2011-06-15',NULL,'hfghfg','hgfhfghf','','','','','','','','CS','','',NULL,10.00000000,NULL,NULL,'','2011-06-15 00:31:57'),(18,65,1,'2011-07-06',NULL,'Cervicalgies Inflammatoires','aaaaa','','','','','','','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-07-06 20:17:20'),(19,67,1,'2011-07-11',NULL,'Cervicalgies Inflammatoires','Canal Carpien','','','','','','','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-07-10 21:23:30'),(20,68,1,'2011-07-13',NULL,'Cervicalgies Mécaniques','Autre','','','','','','','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-07-13 16:26:21'),(21,68,1,'2011-07-13',NULL,'aaaa','bbbb','','','','','','','','CS','','',NULL,NULL,50.00000000,NULL,'','2011-07-13 18:18:29'),(22,68,1,'2011-07-13',NULL,'lll','llll','','','','','','','','CS','','',NULL,NULL,10.00000000,NULL,'','2011-07-13 18:21:57'),(23,68,1,'2011-07-13',NULL,'oo','oo','','','','','','','','CS','','',NULL,NULL,NULL,5.00000000,'','2011-07-13 18:26:18');
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_cons` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `llx_cabinetmed_diaglec`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `llx_cabinetmed_diaglec`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `llx_cabinetmed_diaglec` (
|
||||
`rowid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(8) NOT NULL,
|
||||
`label` varchar(64) NOT NULL,
|
||||
`active` tinyint(4) NOT NULL DEFAULT '1',
|
||||
PRIMARY KEY (`rowid`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `llx_cabinetmed_diaglec`
|
||||
--
|
||||
|
||||
LOCK TABLES `llx_cabinetmed_diaglec` WRITE;
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_diaglec` DISABLE KEYS */;
|
||||
INSERT INTO `llx_cabinetmed_diaglec` (`rowid`, `code`, `label`, `active`) VALUES (1,'AUTRE','Autre',1),(2,'LOMBL5D','Lombosciatique L5 droite',1),(3,'LOMBL5G','Lombosciatique L5 gauche',1),(4,'LOMBS1D','Lombosciatique S1 droite',1),(5,'LOMBS1G','Lombosciatique S1 gauche',1),(6,'NCB','Névralgie cervico-brachiale',1),(7,'PR','Polyarthrite rhumatoide',1),(8,'SA','Spondylarthrite ankylosante',1),(9,'GFTI','Gonarthrose fémoro-tibaile interne',1),(10,'GFTE','Gonarthrose fémoro-tibiale externe',1),(11,'COX','Coxarthrose',1),(12,'CC','Canal Carpien',1),(16,'CLER','Canal Lombaire Etroit et/ou Rétréci',1),(22,'RH PSO','Rhumatisme Psoriasique',1),(23,'LEAD','Lupus',1),(24,'LBDISC','Lombalgie Discale',1),(25,'LBRADD','Lomboradiculalgie Discale',1),(26,'LBRADND','Lomboradiculalgie Non Discale',1),(27,'CH ROT','Chondropathie Rotulienne',1),(28,'AFP','Arthrose FémoroPatellaire',1),(29,'PPR','Pseudo Polyarthrite Rhizomélique',1),(30,'SHARP','Maladie de Sharp',1),(31,'SAPHO','SAPHO',1),(32,'OMARTHC','Omarthrose Centrée',1),(33,'RH CCA','Rhumatisme Chondro Calcinosique',1),(34,'GOUTTE','Arthrite Goutteuse',1),(35,'CCA','Arthrite Chondro Calcinosique',1),(36,'ARTH MCR','Arthrite Microcristalline',1),(37,'CSA','Conflit Sous Acromial',1),(38,'TDCALCE','Tendinopathie Calcifiante d\'Epaule',1),(39,'TDCALCH','Tendinopathie Calcifiante de Hanche',1),(40,'TBT','TendinoBursite Trochantérienne',1),(41,'OMARTHE','Omarthrose Excentrée',1);
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_diaglec` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `llx_cabinetmed_examaut`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `llx_cabinetmed_examaut`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `llx_cabinetmed_examaut` (
|
||||
`rowid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`fk_soc` int(11) DEFAULT NULL,
|
||||
`dateexam` date NOT NULL,
|
||||
`examprinc` varchar(64) DEFAULT NULL,
|
||||
`examsec` text,
|
||||
`concprinc` varchar(64) DEFAULT NULL,
|
||||
`concsec` text,
|
||||
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`rowid`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `llx_cabinetmed_examaut`
|
||||
--
|
||||
|
||||
LOCK TABLES `llx_cabinetmed_examaut` WRITE;
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_examaut` DISABLE KEYS */;
|
||||
INSERT INTO `llx_cabinetmed_examaut` (`rowid`, `fk_soc`, `dateexam`, `examprinc`, `examsec`, `concprinc`, `concsec`, `tms`) VALUES (1,2,'2011-05-08','ArthroScanner Genou','ArthroScanner EpauleeeeArthroScanner HancheIRM EpauleggggBilan Radio ScolioseuuuuqqqqlIRM Rachis Cervical','Autre','','2011-05-01 14:47:57'),(2,2,'2011-05-02','dd','ArthroScanner Hanche\r\nBilan Radio Scoliose\r\neeee\r\nElectromiogramme','dd','','2011-05-01 23:49:59'),(3,32,'2011-06-08','ArthroScanner Genou','gdfgdfgdfgdfgdfgdfgd','Autre','','2011-06-08 14:54:45'),(4,32,'2011-06-08','IRM SacroIliaques','','fsdfsdfsdfsd','','2011-06-08 14:57:01'),(5,26,'2011-06-13','Bilan Radio Rhumatisme Inflammatoire','','Autre','','2011-06-13 15:27:39'),(6,26,'2011-06-13','ArthroScanner Genou','Autre','Autre','','2011-06-13 15:29:31'),(7,26,'2011-06-13','Scanner Lombaire','','Hernie discale L4-L5 gauche','','2011-06-13 16:20:47'),(8,65,'2011-07-06','ArthroScanner Hanche','','Autre','','2011-07-06 20:17:54');
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_examaut` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `llx_cabinetmed_exambio`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `llx_cabinetmed_exambio`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `llx_cabinetmed_exambio` (
|
||||
`rowid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`fk_soc` int(11) DEFAULT NULL,
|
||||
`dateexam` date NOT NULL,
|
||||
`resultat` text,
|
||||
`conclusion` text,
|
||||
`comment` text,
|
||||
`suivipr_ad` int(11) DEFAULT NULL,
|
||||
`suivipr_ag` int(11) DEFAULT NULL,
|
||||
`suivipr_vs` int(11) DEFAULT NULL,
|
||||
`suivipr_eva` int(11) DEFAULT NULL,
|
||||
`suivipr_err` int(11) DEFAULT NULL,
|
||||
`suivisa_fat` int(11) DEFAULT NULL,
|
||||
`suivisa_dax` int(11) DEFAULT NULL,
|
||||
`suivisa_dpe` int(11) DEFAULT NULL,
|
||||
`suivisa_dpa` int(11) DEFAULT NULL,
|
||||
`suivisa_rno` int(11) DEFAULT NULL,
|
||||
`suivisa_dma` int(11) DEFAULT NULL,
|
||||
`suivisa_basdai` double DEFAULT NULL,
|
||||
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`suivisa_das28` double DEFAULT NULL,
|
||||
`suivipr_das28` double DEFAULT NULL,
|
||||
PRIMARY KEY (`rowid`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `llx_cabinetmed_exambio`
|
||||
--
|
||||
|
||||
LOCK TABLES `llx_cabinetmed_exambio` WRITE;
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_exambio` DISABLE KEYS */;
|
||||
INSERT INTO `llx_cabinetmed_exambio` (`rowid`, `fk_soc`, `dateexam`, `resultat`, `conclusion`, `comment`, `suivipr_ad`, `suivipr_ag`, `suivipr_vs`, `suivipr_eva`, `suivipr_err`, `suivisa_fat`, `suivisa_dax`, `suivisa_dpe`, `suivisa_dpa`, `suivisa_rno`, `suivisa_dma`, `suivisa_basdai`, `tms`, `suivisa_das28`, `suivipr_das28`) VALUES (1,2,'2011-05-01','aaajhkh','bbb','ccc',NULL,NULL,NULL,NULL,NULL,1,2,3,4,5,6,NULL,'2011-05-01 14:45:54',NULL,NULL),(3,2,'2011-05-01','dd','hfghfg','',1,2,6,9,NULL,2,2,2,2,2,2,NULL,'2011-05-01 15:24:06',NULL,NULL),(4,2,'2011-05-01','gdfgdf','1111','',NULL,NULL,NULL,NULL,NULL,1,7,8,9,10,11,NULL,'2011-05-01 15:25:17',NULL,NULL),(5,2,'2011-05-01','fdsfsdfsdfsd','ccccc','fsdfsdfs',1,2,4,3,NULL,1,2,3,4,5,6,NULL,'2011-05-01 16:37:51',NULL,NULL),(6,2,'2011-05-01','gfdgdfgdf','gdfgdf','',5,NULL,NULL,NULL,NULL,1,NULL,1,1,NULL,NULL,NULL,'2011-05-01 16:43:49',NULL,NULL),(8,1,'2011-05-01','lkjljkl','','',1,2,4,3,NULL,5,10,5,6,5,5,6.2,'2011-05-01 16:46:00',NULL,1.97),(9,32,'2011-06-08','retert','trete','',1,2,4,1,NULL,2,5,2,5,4,6,NULL,'2011-06-08 14:47:30',NULL,NULL),(10,32,'2011-06-08','fgdfgdfg','gfgdfgdf','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2011-06-08 14:54:23',NULL,NULL),(11,26,'2011-06-13','result bio 1','conclusion bio 1','',1,2,4,4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2011-06-13 15:27:15',NULL,NULL),(12,26,'2011-06-13','result bio 2','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2011-06-13 15:27:25',NULL,NULL),(13,26,'2011-06-13','VS8\r\nCRP inférieur ) 5','Pas de syndrome inflammatoire.','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2011-06-13 16:19:08',NULL,NULL),(14,26,'2011-06-13','','','',NULL,NULL,NULL,NULL,NULL,1,2,2,4,5,6,NULL,'2011-06-13 16:19:38',NULL,NULL),(15,26,'2011-06-13','','','',1,2,4,3,NULL,1,2,3,4,5,6,0.31,'2011-06-13 17:50:25',NULL,1.97),(16,36,'2011-06-15','gdfgddfhghghhfghf','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2011-06-15 08:02:03',NULL,NULL),(17,65,'2011-07-06','hfghfghgf','Zob','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2011-07-06 20:17:33',NULL,NULL),(18,67,'2011-07-11','gfdg','gfdg','gfd',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2011-07-10 22:23:21',NULL,NULL),(19,62,'2011-07-13','dfgdf','gdfd','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2011-07-13 15:56:27',NULL,NULL);
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_exambio` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `llx_cabinetmed_examenprescrit`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `llx_cabinetmed_examenprescrit`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `llx_cabinetmed_examenprescrit` (
|
||||
`rowid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(8) NOT NULL,
|
||||
`label` varchar(64) NOT NULL,
|
||||
`biorad` varchar(8) NOT NULL,
|
||||
`active` tinyint(4) NOT NULL DEFAULT '1',
|
||||
PRIMARY KEY (`rowid`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `llx_cabinetmed_examenprescrit`
|
||||
--
|
||||
|
||||
LOCK TABLES `llx_cabinetmed_examenprescrit` WRITE;
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_examenprescrit` DISABLE KEYS */;
|
||||
INSERT INTO `llx_cabinetmed_examenprescrit` (`rowid`, `code`, `label`, `biorad`, `active`) VALUES (1,'AUTRE','Autre','AUTRE',1),(2,'IRMLOMB','IRM lombaire','RADIO',1),(5,'TDMLOMB','TDM lombaires','RADIO',1),(6,'RX BRL','Radios Bassin-Rachis Lombaire','RADIO',1),(7,'RX RL','Radios Rachis Lombaire','RADIO',1),(8,'RX BASS','Radios Bassin','RADIO',1),(9,'RX BH','Radios Bassin et Hanches','RADIO',1),(10,'RX GEN','Radios Genoux','RADIO',1),(11,'RX CHEV','Radios Chevilles','RADIO',1),(12,'RX AVPD','Radios Avants-Pieds','RADIO',1),(13,'RX EP','Radio Epaule','RADIO',1),(14,'RX MAINS','Radios Mains','RADIO',1),(15,'RX COUDE','Radios Coude','RADIO',1),(16,'RX RC','Radios Rachis Cervical','RADIO',1),(17,'RX RD','Radios Rachis Dorsal','RADIO',1),(18,'RX RCD','Radios Rachis CervicoDorsal','RADIO',1),(19,'RX RDL','Radios DorsoLombaire','RADIO',1),(20,'RX SCO','Bilan Radio Scoliose','RADIO',1),(21,'RX RIC','Bilan Radio Rhumatisme Inflammatoire','RADIO',1),(22,'TDM LOMB','Scanner Lombaire','RADIO',1),(23,'TDM DORS','Scanner Dorsal','RADIO',1),(24,'TDM CERV','Scanner Cervical','RADIO',1),(25,'TDM HANC','Scanner Hanche','RADIO',1),(26,'TDM GEN','Scanner Genou','RADIO',1),(27,'RX RDL','Radios Rachis DorsoLombaire','RADIO',1),(28,'ARTTDMG','ArthroScanner Genou','RADIO',1),(29,'ARTTDME','ArthroScanner Epaule','RADIO',1),(30,'ARTTDMH','ArthroScanner Hanche','RADIO',1),(31,'IRM GEN','IRM Genou','RADIO',1),(32,'IRM HANC','IRM Hanche','RADIO',1),(33,'IRM EP','IRM Epaule','RADIO',1),(34,'IRM SIL','IRM SacroIliaques','RADIO',1),(35,'IRM RL','IRM Rachis Lombaire','RADIO',1),(36,'IRM RD','IRM Rachis Dorsal','RADIO',1),(37,'IRM RC','IRM Rachis Cervical','RADIO',1),(38,'ELECMI','Electromiogramme','RADIO',1),(39,'NFS','NFS','BIO',1),(40,'BILPHO','Bilan Phosphocalcique','BIO',1),(41,'VSCRP','VS/CRP','BIO',1),(42,'EPP','Electrophorèse Protéine Plasmatique','BIO',1);
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_examenprescrit` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `llx_cabinetmed_motifcons`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `llx_cabinetmed_motifcons`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `llx_cabinetmed_motifcons` (
|
||||
`rowid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(8) NOT NULL,
|
||||
`label` varchar(64) NOT NULL,
|
||||
`active` tinyint(4) NOT NULL DEFAULT '1',
|
||||
PRIMARY KEY (`rowid`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `llx_cabinetmed_motifcons`
|
||||
--
|
||||
|
||||
LOCK TABLES `llx_cabinetmed_motifcons` WRITE;
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_motifcons` DISABLE KEYS */;
|
||||
INSERT INTO `llx_cabinetmed_motifcons` (`rowid`, `code`, `label`, `active`) VALUES (5,'AUTRE','Autre',1),(6,'DORS','Dorsalgie',1),(7,'DOLMSD','Douleur Membre supérieur Droit',1),(8,'DOLMSG','Douleur Membre supérieur Gauche',1),(9,'DOLMID','Douleur Membre inférieur Droit',1),(10,'DOLMIG','Douleur Membre inférieur Gauche',1),(11,'PARESM','Paresthésie des mains',1),(12,'DOLEPG','Douleur épaule gauche',1),(13,'DOLEPD','Douleur épaule droite',1),(14,'GONAD','Gonaglie droite',1),(15,'GONAG','Gonalgie gauche',1),(16,'DOLPD','Douleur Pied Droit',1),(17,'DOUL MIN','Douleur Membre Inférieur',1),(18,'POLYAR','Polyarthralgie',1),(19,'SUIVIPR','Suivi PR',1),(20,'SUIVISPA','Suivi SPA',1),(21,'SUIVIRIC','Suivi RI',1),(22,'SUIVIPPR','Suivi PPR',1),(23,'DOLINGD','Douleur inguinale Droit',1),(24,'DOLINGG','Douleur inguinale Gauche',1),(25,'DOLCOUDD','Douleur coude Droit',1),(26,'DOLCOUDG','Douleur coude Gauche',1),(27,'TALAL','Talalgie',1),(28,'DOLTENDC','Douleur tandous Calcanien',1),(29,'DEROB','Dérobement Membres Inférieurs',1),(30,'LOMB MEC','Lombalgies Mécaniques',1),(31,'LOMB INF','Lombalgies Inflammatoires',1),(32,'DORS MEC','Dorsalgies Mécaniques',1),(33,'DORS INF','Dorsalgies Inflammatoires',1),(34,'CERV MEC','Cervicalgies Mécaniques',1),(35,'SCIAT','LomboSciatique ',1),(36,'CRUR','LomboCruralgie',1),(37,'DOUL SUP','Douleur Membre Supérieur',1),(38,'INGUINAL','Inguinalgie',1),(39,'CERV INF','Cervicalgies Inflammatoires',1),(40,'DOUL EP','Douleur Epaule',1),(41,'DOUL POI','Douleur Poignet',1),(42,'DOUL GEN','Douleur Genou',1),(43,'DOUL COU','Douleur Coude',1),(44,'DOUL HAN','Douleur Hanche',1),(45,'PAR MBRS','Paresthésies Membres Inférieurs',1),(46,'PAR MBRI','Paresthésies Membres Supérieurs',1),(47,'TR RACHI','Traumatisme Rachis',1),(48,'TR MBRS','Traumatisme Membres Supérieurs',1),(49,'TR MBRI','Traumatisme Membres Inférieurs',1),(50,'FAT MBRI','Fatiguabilité Membres Inférieurs',1),(51,'DOUL CHE','Douleur Cheville',1),(52,'DOUL PD','Douleur Pied',1),(53,'DOUL MA','Douleur Main',1);
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_motifcons` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `llx_cabinetmed_patient`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `llx_cabinetmed_patient`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `llx_cabinetmed_patient` (
|
||||
`rowid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`note_antemed` text,
|
||||
`note_antechirgen` text,
|
||||
`note_antechirortho` text,
|
||||
`note_anterhum` text,
|
||||
`note_other` text,
|
||||
`note_traitclass` text,
|
||||
`note_traitallergie` text,
|
||||
`note_traitintol` text,
|
||||
`note_traitspec` text,
|
||||
PRIMARY KEY (`rowid`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `llx_cabinetmed_patient`
|
||||
--
|
||||
|
||||
LOCK TABLES `llx_cabinetmed_patient` WRITE;
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_patient` DISABLE KEYS */;
|
||||
INSERT INTO `llx_cabinetmed_patient` (`rowid`, `note_antemed`, `note_antechirgen`, `note_antechirortho`, `note_anterhum`, `note_other`, `note_traitclass`, `note_traitallergie`, `note_traitintol`, `note_traitspec`) VALUES (2,'fffgfgfgf','','','','jjj','aaaagggggggg','','',''),(5,'a','b','c','d','','','','i','u'),(8,NULL,NULL,NULL,NULL,NULL,'','','','tr<span style=\"color: rgb(178, 34, 34);\"><strong>e tre tert</strong></span>er<br />\r\nt<br />\r\nter tert'),(26,NULL,NULL,NULL,NULL,NULL,'','','intol','spec pharma'),(46,'hfhf','dddd','','hfghfg','',NULL,'',NULL,NULL);
|
||||
/*!40000 ALTER TABLE `llx_cabinetmed_patient` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `llx_categorie`
|
||||
--
|
||||
|
||||
@@ -400,12 +400,16 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
|
||||
if (! $error)
|
||||
{
|
||||
$bank_line_id=$paiement->addPaymentToBank($user,'payment','(SubscriptionPayment)',$accountid,$emetteur_nom,$emetteur_banque);
|
||||
if (! $bank_line_id > 0)
|
||||
if (! ($bank_line_id > 0))
|
||||
{
|
||||
$errmsg=$paiement->error;
|
||||
$errmsgs=$paiement->errors;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Update fk_bank for subscriptions
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'cotisation SET fk_bank='.$bank_line_id;
|
||||
$sql.= ' WHERE rowid='.$crowid;
|
||||
|
||||
@@ -213,7 +213,7 @@ $var=true;
|
||||
*/
|
||||
$max=5;
|
||||
|
||||
$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname,";
|
||||
$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname, a.societe as company, a.fk_soc,";
|
||||
$sql.= " a.tms as datem, datefin as date_end_subscription,";
|
||||
$sql.= " ta.rowid as typeid, ta.libelle, ta.cotisation";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta";
|
||||
@@ -242,11 +242,18 @@ if ($resql)
|
||||
$staticmember->id=$obj->rowid;
|
||||
$staticmember->lastname=$obj->lastname;
|
||||
$staticmember->firstname=$obj->firstname;
|
||||
if (! empty($obj->fk_soc)) {
|
||||
$staticmember->socid = $obj->fk_soc;
|
||||
$staticmember->fetch_thirdparty();
|
||||
$staticmember->name=$staticmember->thirdparty->name;
|
||||
} else {
|
||||
$staticmember->name=$obj->company;
|
||||
}
|
||||
$staticmember->ref=$staticmember->getFullName($langs);
|
||||
$statictype->id=$obj->typeid;
|
||||
$statictype->libelle=$obj->libelle;
|
||||
print '<td>'.$staticmember->getNomUrl(1,24).'</td>';
|
||||
print '<td>'.$statictype->getNomUrl(1,16).'</td>';
|
||||
print '<td>'.$staticmember->getNomUrl(1,32).'</td>';
|
||||
print '<td>'.$statictype->getNomUrl(1,32).'</td>';
|
||||
print '<td>'.dol_print_date($db->jdate($obj->datem),'dayhour').'</td>';
|
||||
print '<td align="right">'.$staticmember->LibStatut($obj->statut,($obj->cotisation=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>';
|
||||
print '</tr>';
|
||||
@@ -266,7 +273,7 @@ else
|
||||
*/
|
||||
$max=5;
|
||||
|
||||
$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname,";
|
||||
$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname, a.societe as company, a.fk_soc,";
|
||||
$sql.= " datefin as date_end_subscription,";
|
||||
$sql.= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.cotisation";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."cotisation as c";
|
||||
@@ -297,9 +304,16 @@ if ($resql)
|
||||
$staticmember->id=$obj->rowid;
|
||||
$staticmember->lastname=$obj->lastname;
|
||||
$staticmember->firstname=$obj->firstname;
|
||||
if (! empty($obj->fk_soc)) {
|
||||
$staticmember->socid = $obj->fk_soc;
|
||||
$staticmember->fetch_thirdparty();
|
||||
$staticmember->name=$staticmember->thirdparty->name;
|
||||
} else {
|
||||
$staticmember->name=$obj->company;
|
||||
}
|
||||
$staticmember->ref=$staticmember->getFullName($langs);
|
||||
print '<td>'.$subscriptionstatic->getNomUrl(1).'</td>';
|
||||
print '<td>'.$staticmember->getNomUrl(1,24,'subscription').'</td>';
|
||||
print '<td>'.$staticmember->getNomUrl(1,32,'subscription').'</td>';
|
||||
print '<td>'.get_date_range($db->jdate($obj->date_start),$db->jdate($obj->date_end)).'</td>';
|
||||
print '<td align="right">'.price($obj->cotisation).'</td>';
|
||||
//print '<td align="right">'.$staticmember->LibStatut($obj->statut,($obj->cotisation=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>';
|
||||
@@ -330,7 +344,7 @@ foreach ($AdherentType as $key => $adhtype)
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="type.php?rowid='.$adhtype->id.'">'.img_object($langs->trans("ShowType"),"group").' '.$adhtype->getNomUrl(0,dol_size(16)).'</a></td>';
|
||||
print '<td>'.$adhtype->getNomUrl(1, dol_size(32)).'</td>';
|
||||
print '<td align="right">'.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->cotisation,0,3).'</td>';
|
||||
print '<td align="right">'.(isset($MembersValidated[$key]) && ($MembersValidated[$key]-$MemberUpToDate[$key] > 0) ? $MembersValidated[$key]-$MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,0,3).'</td>';
|
||||
print '<td align="right">'.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,$now,3).'</td>';
|
||||
|
||||
@@ -82,7 +82,7 @@ llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adhé
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
$sql = "SELECT d.rowid, d.login, d.nom as lastname, d.prenom as firstname, d.societe, ";
|
||||
$sql = "SELECT d.rowid, d.login, d.nom as lastname, d.prenom as firstname, d.societe as company, d.fk_soc,";
|
||||
$sql.= " d.datefin,";
|
||||
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
|
||||
$sql.= " t.libelle as type, t.cotisation";
|
||||
@@ -130,7 +130,7 @@ if ($filter == 'uptodate')
|
||||
}
|
||||
if ($filter == 'outofdate')
|
||||
{
|
||||
$sql.=" AND datefin < '".$db->idate($now)."'";
|
||||
$sql.=" AND (datefin IS NULL OR datefin < '".$db->idate($now)."')";
|
||||
}
|
||||
// Insert categ filter
|
||||
if ($search_categ)
|
||||
@@ -237,7 +237,7 @@ if ($resql)
|
||||
|
||||
print '<td class="liste_titre">';
|
||||
$listetype=$membertypestatic->liste_array();
|
||||
print $form->selectarray("type", $listetype, $type, 1, 0, 0, '', 0, 12);
|
||||
print $form->selectarray("type", $listetype, $type, 1, 0, 0, '', 0, 32);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="liste_titre"> </td>';
|
||||
@@ -267,6 +267,14 @@ if ($resql)
|
||||
$memberstatic->lastname=$objp->lastname;
|
||||
$memberstatic->firstname=$objp->firstname;
|
||||
|
||||
if (! empty($objp->fk_soc)) {
|
||||
$memberstatic->socid = $objp->fk_soc;
|
||||
$memberstatic->fetch_thirdparty();
|
||||
$companyname=$memberstatic->thirdparty->name;
|
||||
} else {
|
||||
$companyname=$objp->company;
|
||||
}
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
@@ -276,14 +284,11 @@ if ($resql)
|
||||
print "</td>\n";
|
||||
|
||||
// Lastname
|
||||
if ($objp->societe != '')
|
||||
{
|
||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".dol_trunc($memberstatic->getFullName($langs))." / ".dol_trunc($objp->societe,12)."</a></td>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".dol_trunc($memberstatic->getFullName($langs))."</a></td>\n";
|
||||
}
|
||||
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">";
|
||||
print ((! empty($objp->lastname) || ! empty($objp->firstname)) ? dol_trunc($memberstatic->getFullName($langs)) : '');
|
||||
print (((! empty($objp->lastname) || ! empty($objp->firstname)) && ! empty($companyname)) ? ' / ' : '');
|
||||
print (! empty($companyname) ? dol_trunc($companyname, 32) : '');
|
||||
print "</a></td>\n";
|
||||
|
||||
// Login
|
||||
print "<td>".$objp->login."</td>\n";
|
||||
@@ -292,7 +297,7 @@ if ($resql)
|
||||
$membertypestatic->id=$objp->type_id;
|
||||
$membertypestatic->libelle=$objp->type;
|
||||
print '<td nowrap="nowrap">';
|
||||
print $membertypestatic->getNomUrl(1,12);
|
||||
print $membertypestatic->getNomUrl(1,32);
|
||||
print '</td>';
|
||||
|
||||
// Moral/Physique
|
||||
|
||||
@@ -31,9 +31,14 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
|
||||
$langs->load("errors");
|
||||
$langs->load("admin");
|
||||
|
||||
$mode=isset($_GET["mode"])?GETPOST("mode"):(isset($_SESSION['mode'])?$_SESSION['mode']:0);
|
||||
$mode=GETPOST('mode', 'alpha');
|
||||
if (!isset($mode)) {
|
||||
if (isset($_SESSION['mode'])) { $mode=$_SESSION['mode'];}
|
||||
else {$mode=0;}
|
||||
}
|
||||
$mesg=GETPOST("mesg");
|
||||
$action=GETPOST('action');
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$value=GETPOST('value', 'alpha');
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
@@ -44,7 +49,7 @@ if (!$user->admin) accessforbidden();
|
||||
|
||||
if ($action == 'set' && $user->admin)
|
||||
{
|
||||
$result=activateModule($_GET["value"]);
|
||||
$result=activateModule($value);
|
||||
$mesg='';
|
||||
if ($result) $mesg=$result;
|
||||
Header("Location: modules.php?mode=".$mode."&mesg=".urlencode($mesg));
|
||||
@@ -53,7 +58,7 @@ if ($action == 'set' && $user->admin)
|
||||
|
||||
if ($action == 'reset' && $user->admin)
|
||||
{
|
||||
$result=unActivateModule($_GET["value"]);
|
||||
$result=unActivateModule($value);
|
||||
$mesg='';
|
||||
if ($result) $mesg=$result;
|
||||
Header("Location: modules.php?mode=".$mode."&mesg=".urlencode($mesg));
|
||||
@@ -128,9 +133,9 @@ foreach ($modulesdir as $dir)
|
||||
{
|
||||
$mesg="Error: Module ".$modName." was found twice: Into ".$modNameLoaded[$modName]." and ".$dir.". You probably have an old file on your disk.<br>";
|
||||
dol_syslog($mesg, LOG_ERR);
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
$res=include_once($dir.$file);
|
||||
|
||||
@@ -61,6 +61,7 @@ if ($id || $ref)
|
||||
$elementtype = 'fournisseur';
|
||||
$objecttype = 'societe&categorie';
|
||||
$objectid = isset($id)?$id:(isset($socid)?$socid:'');
|
||||
$dbtablename = '&societe';
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if ($type == 2) {
|
||||
|
||||
@@ -85,13 +85,14 @@ if ($action == 'add_action')
|
||||
}
|
||||
|
||||
$fulldayevent=$_POST["fullday"];
|
||||
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):GETPOST("percentage"); // If status is -1 or 100, percentage is not defined and we must use status
|
||||
|
||||
// Clean parameters
|
||||
$datep=dol_mktime($fulldayevent?'00':$_POST["aphour"], $fulldayevent?'00':$_POST["apmin"], 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
|
||||
$datef=dol_mktime($fulldayevent?'23':$_POST["p2hour"], $fulldayevent?'59':$_POST["p2min"], $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
|
||||
|
||||
// Check parameters
|
||||
if (! $datef && $_POST["percentage"] == 100)
|
||||
if (! $datef && $percentage == 100)
|
||||
{
|
||||
$error++;
|
||||
$action = 'create';
|
||||
@@ -135,7 +136,7 @@ if ($action == 'add_action')
|
||||
$actioncomm->fk_project = isset($_POST["projectid"])?$_POST["projectid"]:0;
|
||||
$actioncomm->datep = $datep;
|
||||
$actioncomm->datef = $datef;
|
||||
$actioncomm->percentage = isset($_POST["percentage"])?$_POST["percentage"]:0;
|
||||
$actioncomm->percentage = $percentage;
|
||||
$actioncomm->duree=(($_POST["dureehour"] * 60) + $_POST["dureemin"]) * 60;
|
||||
|
||||
$usertodo=new User($db);
|
||||
@@ -257,21 +258,20 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes')
|
||||
}
|
||||
|
||||
/*
|
||||
* Action mise a jour de l'action
|
||||
* Action update event
|
||||
*/
|
||||
if ($action == 'update')
|
||||
{
|
||||
if (! $_POST["cancel"])
|
||||
{
|
||||
$fulldayevent=$_POST["fullday"];
|
||||
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):GETPOST("percentage"); // If status is -1 or 100, percentage is not defined and we must use status
|
||||
|
||||
// Clean parameters
|
||||
if ($_POST["aphour"] == -1) $_POST["aphour"]='0';
|
||||
if ($_POST["apmin"] == -1) $_POST["apmin"]='0';
|
||||
if ($_POST["p2hour"] == -1) $_POST["p2hour"]='0';
|
||||
if ($_POST["p2min"] == -1) $_POST["p2min"]='0';
|
||||
//if ($_POST["adhour"] == -1) $_POST["adhour"]='0';
|
||||
//if ($_POST["admin"] == -1) $_POST["admin"]='0';
|
||||
|
||||
$actioncomm = new Actioncomm($db);
|
||||
$actioncomm->fetch($id);
|
||||
@@ -282,9 +282,7 @@ if ($action == 'update')
|
||||
$actioncomm->label = $_POST["label"];
|
||||
$actioncomm->datep = $datep;
|
||||
$actioncomm->datef = $datef;
|
||||
//$actioncomm->date = $datea;
|
||||
//$actioncomm->dateend = $datea2;
|
||||
$actioncomm->percentage = $_POST["percentage"];
|
||||
$actioncomm->percentage = $percentage;
|
||||
$actioncomm->priority = $_POST["priority"];
|
||||
$actioncomm->fulldayevent= $_POST["fullday"]?1:0;
|
||||
$actioncomm->location = isset($_POST["location"])?$_POST["location"]:'';
|
||||
@@ -294,7 +292,7 @@ if ($action == 'update')
|
||||
$actioncomm->note = $_POST["note"];
|
||||
$actioncomm->pnote = $_POST["note"];
|
||||
|
||||
if (! $datef && $_POST["percentage"] == 100)
|
||||
if (! $datef && $percentage == 100)
|
||||
{
|
||||
$error=$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd"));
|
||||
$action = 'edit';
|
||||
|
||||
@@ -2163,7 +2163,7 @@ class Propal extends CommonObject
|
||||
$this->mode_reglement_id = 7;
|
||||
$this->mode_reglement_code = 'CHQ';
|
||||
$this->availability_id = 1;
|
||||
$this->availability_code = 'DSP';
|
||||
$this->availability_code = 'AV_NOW';
|
||||
$this->demand_reason_id = 1;
|
||||
$this->demand_reason_code = 'SRC_00';
|
||||
$this->note_public='This is a comment (public)';
|
||||
|
||||
@@ -193,7 +193,7 @@ if ($conf->propal->enabled)
|
||||
$companystatic->client=$obj->client;
|
||||
$companystatic->canvas=$obj->canvas;
|
||||
print '<td>'.$companystatic->getNomUrl(1,'customer',24).'</td>';
|
||||
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
@@ -260,7 +260,7 @@ if ($resql)
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
@@ -270,7 +270,7 @@ if ($resql)
|
||||
$companystatic->client=$obj->client;
|
||||
$companystatic->canvas=$obj->canvas;
|
||||
print '<td>'.$companystatic->getNomUrl(1,'customer').'</td>';
|
||||
|
||||
|
||||
print '<td>'.dol_print_date($db->jdate($obj->datec),'day').'</td>';
|
||||
print '<td align="right">'.$propalstatic->LibStatut($obj->fk_statut,5).'</td>';
|
||||
print '</tr>';
|
||||
@@ -339,7 +339,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
||||
print '</td></tr></table>';
|
||||
|
||||
print "</td>";
|
||||
|
||||
|
||||
$companystatic->id=$obj->socid;
|
||||
$companystatic->name=$obj->socname;
|
||||
$companystatic->client=$obj->client;
|
||||
@@ -419,7 +419,7 @@ if ($conf->propal->enabled)
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
@@ -491,7 +491,7 @@ if ($conf->propal->enabled)
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -272,7 +272,7 @@ if ($socid > 0)
|
||||
print '<td><input type="text" size="5" name="amount_ht" value="'.$_POST["amount_ht"].'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print '<tr><td width="38%">'.$langs->trans("VAT").'</td>';
|
||||
print '<td>';
|
||||
print $form->load_tva('tva_tx',GETPOST('tva_tx'),'',$mysoc,'');
|
||||
print $form->load_tva('tva_tx',GETPOST('tva_tx'),$mysoc,$objsoc);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("NoteReason").'</td>';
|
||||
print '<td><input type="text" size="60" name="desc" value="'.$_POST["desc"].'"></td></tr>';
|
||||
|
||||
@@ -2181,6 +2181,7 @@ class Commande extends CommonObject
|
||||
$this->line->remise_percent=$remise_percent;
|
||||
$this->line->subprice=$subprice;
|
||||
$this->line->info_bits=$info_bits;
|
||||
$this->line->special_code=0; // To remove special_code=3 coming from proposals copy
|
||||
$this->line->total_ht=$total_ht;
|
||||
$this->line->total_tva=$total_tva;
|
||||
$this->line->total_localtax1=$total_localtax1;
|
||||
@@ -3035,6 +3036,7 @@ class OrderLine
|
||||
if (empty($this->remise)) $this->remise=0;
|
||||
if (empty($this->remise_percent)) $this->remise_percent=0;
|
||||
if (empty($this->info_bits)) $this->info_bits=0;
|
||||
if (empty($this->special_code)) $this->special_code=0;
|
||||
if (empty($this->product_type)) $this->product_type=0;
|
||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||
|
||||
@@ -3060,6 +3062,7 @@ class OrderLine
|
||||
$sql.= " , total_localtax1=".price2num($this->total_localtax1);
|
||||
$sql.= " , total_localtax2=".price2num($this->total_localtax2);
|
||||
$sql.= " , info_bits=".$this->info_bits;
|
||||
$sql.= " , special_code=".$this->special_code;
|
||||
if ($this->date_start) { $sql.= " , date_start='".$this->db->idate($this->date_start)."'"; }
|
||||
else { $sql.=' , date_start=null'; }
|
||||
if ($this->date_end) { $sql.= " , date_end='".$this->db->idate($this->date_end)."'"; }
|
||||
|
||||
@@ -738,6 +738,11 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && $_POST['s
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")).'</div>';
|
||||
$result = -1 ;
|
||||
}
|
||||
|
||||
// Define special_code for special lines
|
||||
$special_code=0;
|
||||
if (empty($_POST['qty'])) $special_code=3;
|
||||
|
||||
// Check minimum price
|
||||
if(! empty($_POST['productid']))
|
||||
{
|
||||
|
||||
@@ -509,7 +509,6 @@ if ($id > 0 || ! empty($ref))
|
||||
// Payment type
|
||||
print "<td nowrap>";
|
||||
$label=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$objp->fk_type;
|
||||
// $label=$langs->getTradFromKey("PaymentTypeShort".$objp->fk_type);
|
||||
|
||||
if ($objp->fk_type == 'SOLD') $label=' ';
|
||||
print $label;
|
||||
|
||||
@@ -265,6 +265,15 @@ else if ($action == 'setinvoicedate' && $user->rights->facture->creer)
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
else if ($action == 'setpaymentterm' && $user->rights->facture->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$object->date_lim_reglement=dol_mktime(12,0,0,$_POST['paymenttermmonth'],$_POST['paymenttermday'],$_POST['paymenttermyear']);
|
||||
if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement=$object->date;
|
||||
$result=$object->update($user);
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
else if ($action == 'setconditions' && $user->rights->facture->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
@@ -971,7 +980,11 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
||||
|
||||
$price_base_type = 'HT';
|
||||
|
||||
// Ecrase $pu par celui du produit
|
||||
// Define special_code for special lines
|
||||
$special_code=0;
|
||||
//if (empty($_POST['qty'])) $special_code=3; // Options should not exists on invoices
|
||||
|
||||
// Ecrase $pu par celui du produit
|
||||
// Ecrase $desc par celui du produit
|
||||
// Ecrase $txtva par celui du produit
|
||||
// Ecrase $base_price_type par celui du produit
|
||||
@@ -1090,7 +1103,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
||||
$pu_ttc,
|
||||
$type,
|
||||
-1,
|
||||
0,
|
||||
$special_code,
|
||||
'',
|
||||
0,
|
||||
GETPOST('fk_parent_line')
|
||||
@@ -1162,6 +1175,11 @@ else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['sa
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")).'</div>';
|
||||
$result = -1 ;
|
||||
}
|
||||
|
||||
// Define special_code for special lines
|
||||
$special_code=0;
|
||||
//if (empty($_POST['qty'])) $special_code=3; // Option should not exists onto invoices
|
||||
|
||||
// Check minimum price
|
||||
if (GETPOST('productid'))
|
||||
{
|
||||
|
||||
@@ -1802,7 +1802,7 @@ class Facture extends CommonObject
|
||||
$mouvP = new MouvementStock($this->db);
|
||||
// We decrease stock for product
|
||||
if ($this->type == 2) $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref));
|
||||
else $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref));
|
||||
else $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref)); // we use 0 for price, to not change the weighted average value
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2017,9 +2017,10 @@ class Facture extends CommonObject
|
||||
* @param int $type Type of line (0=product, 1=service)
|
||||
* @param int $fk_parent_line ???
|
||||
* @param int $skip_update_total ???
|
||||
* @param int $special_code Special code
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
*/
|
||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $fk_parent_line=0, $skip_update_total=0)
|
||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $fk_parent_line=0, $skip_update_total=0, $special_code=0)
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php');
|
||||
|
||||
@@ -2100,6 +2101,7 @@ class Facture extends CommonObject
|
||||
$this->line->product_type = $type;
|
||||
$this->line->fk_parent_line = $fk_parent_line;
|
||||
$this->line->skip_update_total = $skip_update_total;
|
||||
$this->line->special_code = $special_code;
|
||||
|
||||
// A ne plus utiliser
|
||||
//$this->line->price=$price;
|
||||
@@ -3632,6 +3634,7 @@ class FactureLigne
|
||||
//if (empty($this->remise)) $this->remise=0;
|
||||
if (empty($this->remise_percent)) $this->remise_percent=0;
|
||||
if (empty($this->info_bits)) $this->info_bits=0;
|
||||
if (empty($this->special_code)) $this->special_code=0;
|
||||
if (empty($this->product_type)) $this->product_type=0;
|
||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||
|
||||
@@ -3659,6 +3662,7 @@ class FactureLigne
|
||||
else { $sql.=',date_end=null'; }
|
||||
$sql.= ",product_type=".$this->product_type;
|
||||
$sql.= ",info_bits='".$this->info_bits."'";
|
||||
$sql.= ",special_code='".$this->special_code."'";
|
||||
if (empty($this->skip_update_total))
|
||||
{
|
||||
$sql.= ",total_ht=".price2num($this->total_ht)."";
|
||||
|
||||
@@ -148,7 +148,7 @@ print "<tr class=\"liste_titre\">";
|
||||
print "<td>".$langs->trans("Date")."</td>";
|
||||
print "<td>".$langs->trans("Piece").' ('.$langs->trans("InvoiceRef").")</td>";
|
||||
print "<td>".$langs->trans("Account")."</td>";
|
||||
print "<t><td>".$langs->trans("Type")."</td><td align='right'>".$langs->trans("Debit")."</td><td align='right'>".$langs->trans("Credit")."</td>";
|
||||
print "<td>".$langs->trans("Type")."</td><td align='right'>".$langs->trans("Debit")."</td><td align='right'>".$langs->trans("Credit")."</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
$var=true;
|
||||
@@ -202,7 +202,7 @@ foreach ($tabfac as $key => $val)
|
||||
foreach ($tabttc[$key] as $k => $mt)
|
||||
{
|
||||
print "<td>".$k."</td><td>".$langs->trans("ThirdParty")."</td>";
|
||||
print '<td align="right">'.($mt<0?-price(-$mt):'')."</td>";
|
||||
print '<td align="right">'.($mt<0?price(-$mt):'')."</td>";
|
||||
print '<td align="right">'.($mt>=0?price($mt):'')."</td>";
|
||||
}
|
||||
print "</tr>";
|
||||
|
||||
@@ -156,7 +156,7 @@ print "<tr class=\"liste_titre\">";
|
||||
//print "<td>".$langs->trans("JournalNum")."</td>";
|
||||
print "<td>".$langs->trans("Date")."</td><td>".$langs->trans("Piece").' ('.$langs->trans("InvoiceRef").")</td>";
|
||||
print "<td>".$langs->trans("Account")."</td>";
|
||||
print "<t><td>".$langs->trans("Type")."</td><td align='right'>".$langs->trans("Debit")."</td><td align='right'>".$langs->trans("Credit")."</td>";
|
||||
print "<td>".$langs->trans("Type")."</td><td align='right'>".$langs->trans("Debit")."</td><td align='right'>".$langs->trans("Credit")."</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
$var=true;
|
||||
|
||||
@@ -442,12 +442,13 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
$sql = 'SELECT f.rowid as facid, f.facnumber, f.total_ttc, f.type, ';
|
||||
$sql.= ' f.datef as df';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f';
|
||||
$sql.= ' WHERE f.fk_soc = '.$facture->socid;
|
||||
$sql.= ' WHERE f.entity = '.$conf->entity;
|
||||
$sql.= ' AND f.fk_soc = '.$facture->socid;
|
||||
$sql.= ' AND f.paye = 0';
|
||||
$sql.= ' AND f.fk_statut = 1'; // Statut=0 => not validated, Statut=2 => canceled
|
||||
if ($facture->type != 2)
|
||||
{
|
||||
$sql .= ' AND type in (0,1,3)'; // Standard invoice, replacement, deposit
|
||||
$sql .= ' AND type IN (0,1,3)'; // Standard invoice, replacement, deposit
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.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
|
||||
@@ -36,8 +36,7 @@ $action=GETPOST("action");
|
||||
// Security check
|
||||
$socid = GETPOST('socid','int');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'tax', $langs->trans("SocialContribution"), '', 'charges');
|
||||
|
||||
$result = restrictedArea($user, 'tax', $id, 'chargesociales','charges');
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -262,8 +262,12 @@ class ChargeSociales extends CommonObject
|
||||
*/
|
||||
function solde($year = 0)
|
||||
{
|
||||
$sql = "SELECT sum(f.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as f WHERE paye = 0";
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT SUM(f.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."chargesociales as f";
|
||||
$sql.= " WHERE f.entity = ".$conf->entity;
|
||||
$sql.= " AND paye = 0";
|
||||
|
||||
if ($year) {
|
||||
$sql .= " AND f.datev >= '$y-01-01' AND f.datev <= '$y-12-31' ";
|
||||
@@ -300,8 +304,8 @@ class ChargeSociales extends CommonObject
|
||||
*/
|
||||
function set_paid($user)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales";
|
||||
$sql.= " set paye=1";
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET";
|
||||
$sql.= " paye = 1";
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
$return = $this->db->query($sql);
|
||||
if ($return) return 1;
|
||||
|
||||
@@ -35,7 +35,7 @@ $action=GETPOST("action");
|
||||
// Security check
|
||||
$socid = GETPOST('socid','int');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'tax', $langs->trans("SocialContribution"), '', 'charges');
|
||||
$result = restrictedArea($user, 'tax', $id, 'chargesociales','charges');
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -50,11 +50,11 @@ if ((isset($_POST['roworder']) && ! empty($_POST['roworder'])) && (isset($_POST[
|
||||
if (! empty($value)) $newroworder[] = $value;
|
||||
}
|
||||
|
||||
dol_syslog("AjaxRow roworder=".GETPOST('roworder','alpha',2)." fk_element=".GETPOST('fk_element','int',2), LOG_DEBUG);
|
||||
dol_syslog("AjaxRow roworder=".GETPOST('roworder','alpha',2)." fk_element=".GETPOST('fk_element','alpha',2), LOG_DEBUG);
|
||||
|
||||
$row=new GenericObject($db);
|
||||
$row->table_element_line = GETPOST('table_element_line','alpha',2);
|
||||
$row->fk_element = GETPOST('fk_element','int',2);
|
||||
$row->fk_element = GETPOST('fk_element','alpha',2);
|
||||
$row->id = GETPOST('element_id','int',2);
|
||||
$result=$row->line_ajaxorder($newroworder);
|
||||
$result=$row->line_order(true);
|
||||
|
||||
@@ -73,7 +73,8 @@ class box_members extends ModeleBoxes
|
||||
|
||||
if ($user->rights->societe->lire)
|
||||
{
|
||||
$sql = "SELECT a.rowid, a.nom as lastname, a.prenom as firstname, a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,";
|
||||
$sql = "SELECT a.rowid, a.nom as lastname, a.prenom as firstname, a.societe, a.fk_soc,";
|
||||
$sql.= " a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,";
|
||||
$sql.= " t.cotisation";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as t";
|
||||
$sql.= " WHERE a.entity = ".$conf->entity;
|
||||
@@ -97,6 +98,14 @@ class box_members extends ModeleBoxes
|
||||
$memberstatic->lastname=$objp->lastname;
|
||||
$memberstatic->firstname=$objp->firstname;
|
||||
|
||||
if (! empty($objp->fk_soc)) {
|
||||
$memberstatic->socid = $objp->fk_soc;
|
||||
$memberstatic->fetch_thirdparty();
|
||||
$memberstatic->name=$memberstatic->thirdparty->name;
|
||||
} else {
|
||||
$memberstatic->name=$objp->company;
|
||||
}
|
||||
|
||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
||||
'logo' => $this->boximg,
|
||||
'url' => DOL_URL_ROOT."/adherents/fiche.php?rowid=".$objp->rowid);
|
||||
|
||||
@@ -103,11 +103,15 @@ class CMailFile
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// We define end of line (RFC 822bis section 2.3)
|
||||
// We define end of line (RFC 821).
|
||||
$this->eol="\r\n";
|
||||
// eol2 is for header fields to manage bugged MTA with option MAIN_FIX_FOR_BUGGED_MTA
|
||||
$this->eol2=$this->eol;
|
||||
if (! empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) $this->eol2="\n";
|
||||
// We define end of line for header fields (RFC 822bis section 2.3 says header must contains \r\n).
|
||||
$this->eol2="\r\n";
|
||||
if (! empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA))
|
||||
{
|
||||
$this->eol="\n";
|
||||
$this->eol2="\n";
|
||||
}
|
||||
|
||||
// On defini mixed_boundary
|
||||
$this->mixed_boundary = "multipart_x." . time() . ".x_boundary";
|
||||
@@ -494,6 +498,7 @@ class CMailFile
|
||||
/**
|
||||
* Write content of a SMTP request into a dump file (mode = all)
|
||||
* Used for debugging.
|
||||
* Note that to see full SMTP protocol, you can use tcpdump -w /tmp/smtp -s 2000 port 25"
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@@ -593,7 +598,11 @@ class CMailFile
|
||||
|
||||
// Sender
|
||||
//$out.= "Sender: ".getValidAddress($this->addr_from,2)).$this->eol2;
|
||||
$out.= "From: ".$this->getValidAddress($this->addr_from,3,1).$this->eol2;
|
||||
$out.= "From: ".$this->getValidAddress($this->addr_from,3,1).$this->eol2;
|
||||
if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_BA))
|
||||
{
|
||||
$out.= "To: ".$this->getValidAddress($this->addr_to,0,1).$this->eol2;
|
||||
}
|
||||
$out.= "Return-Path: ".$this->getValidAddress($this->addr_from,0,1).$this->eol2;
|
||||
if (isset($this->reply_to) && $this->reply_to) $out.= "Reply-To: ".$this->getValidAddress($this->reply_to,2).$this->eol2;
|
||||
if (isset($this->errors_to) && $this->errors_to) $out.= "Errors-To: ".$this->getValidAddress($this->errors_to,2).$this->eol2;
|
||||
@@ -688,7 +697,11 @@ class CMailFile
|
||||
|
||||
// Make RFC821 Compliant, replace bare linefeeds
|
||||
$strContent = preg_replace("/(?<!\r)\n/si", "\r\n", $strContent);
|
||||
|
||||
if (! empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA))
|
||||
{
|
||||
$strContent = preg_replace("/\r\n/si", "\n", $strContent);
|
||||
}
|
||||
|
||||
//$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems bugged
|
||||
$strContent = rtrim(wordwrap($strContent));
|
||||
|
||||
@@ -1013,4 +1026,4 @@ class CMailFile
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -140,6 +140,26 @@ abstract class CommonDocGenerator
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rect pdf
|
||||
*
|
||||
* @param PDF $pdf Object PDF
|
||||
* @param float $x Abscissa of first point
|
||||
* @param float $y Ordinate of first point
|
||||
* @param float $l ??
|
||||
* @param float $h ??
|
||||
* @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
|
||||
* @param int $hidebottom Hide bottom
|
||||
* @return void
|
||||
*/
|
||||
function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
|
||||
{
|
||||
if (empty($hidetop) || $hidetop==-1) $pdf->line($x, $y, $x+$l, $y);
|
||||
$pdf->line($x+$l, $y, $x+$l, $y+$h);
|
||||
if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h);
|
||||
$pdf->line($x, $y+$h, $x, $y);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -963,8 +963,8 @@ class Form
|
||||
$out='';
|
||||
|
||||
// On recherche les utilisateurs
|
||||
$sql = "SELECT u.rowid, u.name as lastname, u.firstname, u.login, u.admin, u.entity";
|
||||
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
$sql = "SELECT DISTINCT u.rowid, u.name as lastname, u.firstname, u.login, u.admin, u.entity";
|
||||
if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
{
|
||||
$sql.= ", e.label";
|
||||
}
|
||||
@@ -977,7 +977,16 @@ class Form
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.= " WHERE u.entity IN (0,".$conf->entity.")";
|
||||
if (! empty($conf->multicompany->transverse_mode))
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
$sql.= " WHERE ug.fk_user = u.rowid";
|
||||
$sql.= " AND ug.entity = ".$conf->entity;
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.= " WHERE u.entity IN (0,".$conf->entity.")";
|
||||
}
|
||||
}
|
||||
if (! empty($user->societe_id)) $sql.= " AND u.fk_societe = ".$user->societe_id;
|
||||
if (is_array($exclude) && $excludeUsers) $sql.= " AND u.rowid NOT IN ('".$excludeUsers."')";
|
||||
|
||||
@@ -1,185 +1,215 @@
|
||||
<?php
|
||||
/* Copyright (c) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2010 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
* Copyright (C) 2010 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/class/html.formactions.class.php
|
||||
* \ingroup core
|
||||
* \brief Fichier de la classe des fonctions predefinie de composants html actions
|
||||
*/
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Class to manage building of HTML components
|
||||
*/
|
||||
*/
|
||||
class FormActions
|
||||
{
|
||||
var $db;
|
||||
var $error;
|
||||
var $db;
|
||||
var $error;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function FormActions($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
return 1;
|
||||
}
|
||||
*/
|
||||
function FormActions($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show list of action status
|
||||
*
|
||||
* @param string $formname Name of form where select in included
|
||||
* @param string $selected Preselected value
|
||||
* @param int $canedit 1=can edit, 0=read only
|
||||
* @param string $htmlname Name of html prefix for html fields (selectX and valX)
|
||||
* @return void
|
||||
*/
|
||||
function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete')
|
||||
{
|
||||
global $langs,$conf;
|
||||
/**
|
||||
* Show list of action status
|
||||
*
|
||||
* @param string $formname Name of form where select in included
|
||||
* @param string $selected Preselected value (-1..100)
|
||||
* @param int $canedit 1=can edit, 0=read only
|
||||
* @param string $htmlname Name of html prefix for html fields (selectX and valX)
|
||||
* @return void
|
||||
*/
|
||||
function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete')
|
||||
{
|
||||
global $langs,$conf;
|
||||
|
||||
$listofstatus=array('-1'=>$langs->trans("ActionNotApplicable"),
|
||||
'0'=>$langs->trans("ActionRunningNotStarted"),
|
||||
'50'=>$langs->trans("ActionRunningShort"),
|
||||
'100'=>$langs->trans("ActionDoneShort"));
|
||||
$listofstatus = array(
|
||||
'-1' => $langs->trans("ActionNotApplicable"),
|
||||
'0' => $langs->trans("ActionRunningNotStarted"),
|
||||
'50' => $langs->trans("ActionRunningShort"),
|
||||
'100' => $langs->trans("ActionDoneShort")
|
||||
);
|
||||
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print "\n";
|
||||
print '<script type="text/javascript">'."\n";
|
||||
print 'jQuery(document).ready(function () {'."\n";
|
||||
print 'jQuery("#select'.$htmlname.'").change(function() { select_status(document.'.$formname.'.status.value); });'."\n";
|
||||
print 'jQuery("#val'.$htmlname.'").change(function() { select_status(jQuery("#val'.$htmlname.'").val()); });'."\n";
|
||||
print 'select_status(document.'.$formname.'.status.value);'."\n";
|
||||
print '});'."\n";
|
||||
print 'function select_status(mypercentage) {'."\n";
|
||||
print 'document.'.$formname.'.percentageshown.value=(mypercentage>=0?mypercentage:\'\');'."\n";
|
||||
print 'document.'.$formname.'.percentage.value=mypercentage;'."\n";
|
||||
print 'if (mypercentage == -1) { document.'.$formname.'.percentageshown.disabled=true; jQuery(".hideifna").hide(); }'."\n";
|
||||
print 'else if (mypercentage == 0) { document.'.$formname.'.percentageshown.disabled=true; jQuery(".hideifna").show();}'."\n";
|
||||
print 'else if (mypercentage == 100) { document.'.$formname.'.percentageshown.disabled=true; jQuery(".hideifna").show();}'."\n";
|
||||
print 'else { document.'.$formname.'.percentageshown.disabled=false; jQuery(".hideifna").show();}'."\n";
|
||||
print '}'."\n";
|
||||
print '</script>'."\n";
|
||||
print '<select '.($canedit?'':'disabled="disabled" ').'name="status" id="select'.$htmlname.'" class="flat">';
|
||||
foreach($listofstatus as $key => $val)
|
||||
{
|
||||
print '<option value="'.$key.'"'.($selected == $key?' selected="selected"':'').'>'.$val.'</option>';
|
||||
}
|
||||
print '</select>';
|
||||
if ($selected == 0 || $selected == 100) $canedit=0;
|
||||
print ' <input type="text" id="val'.$htmlname.'" name="percentageshown" class="flat hideifna" value="'.($selected>=0?$selected:'').'" size="2"'.($canedit&&($selected>=0)?'':' disabled="disabled"').'>';
|
||||
print '<span class="hideifna">%</span>';
|
||||
print ' <input type="hidden" name="percentage" value="'.$selected.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' <input type="text" id="val'.$htmlname.'" name="percentage" class="flat" value="'.($selected>=0?$selected:'').'" size="2"'.($canedit?'':' disabled="disabled"').'>%';
|
||||
}
|
||||
}
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print "\n";
|
||||
print "<script type=\"text/javascript\">
|
||||
var htmlname = '".$htmlname."';
|
||||
|
||||
$(document).ready(function () {
|
||||
select_status();
|
||||
|
||||
$('#select' + htmlname).change(function() {
|
||||
select_status();
|
||||
});
|
||||
// FIXME use another method for update combobox
|
||||
//$('#val' + htmlname).change(function() {
|
||||
//select_status();
|
||||
//});
|
||||
});
|
||||
|
||||
function select_status() {
|
||||
var defaultvalue = $('#select' + htmlname).val();
|
||||
var percentage = $('input[name=percentage]');
|
||||
var selected = '".(isset($selected)?$selected:'')."';
|
||||
var value = (selected>0?selected:(defaultvalue>=0?defaultvalue:''));
|
||||
|
||||
percentage.val(value);
|
||||
|
||||
if (defaultvalue == -1) {
|
||||
percentage.attr('disabled', 'disabled');
|
||||
$('.hideifna').hide();
|
||||
}
|
||||
else if (defaultvalue == 0) {
|
||||
percentage.val(0);
|
||||
percentage.attr('disabled', 'disabled');
|
||||
$('.hideifna').show();
|
||||
}
|
||||
else if (defaultvalue == 100) {
|
||||
percentage.val(100);
|
||||
percentage.attr('disabled', 'disabled');
|
||||
$('.hideifna').show();
|
||||
}
|
||||
else {
|
||||
if (defaultvalue == 50 && (percentage.val() == 0 || percentage.val() == 100)) { percentage.val(50) };
|
||||
percentage.removeAttr('disabled');
|
||||
$('.hideifna').show();
|
||||
}
|
||||
}
|
||||
</script>\n";
|
||||
print '<select '.($canedit?'':'disabled="disabled" ').'name="status" id="select'.$htmlname.'" class="flat">';
|
||||
foreach($listofstatus as $key => $val)
|
||||
{
|
||||
print '<option value="'.$key.'"'.(($selected == $key) || (($selected > 0 && $selected < 100) && $key == '50') ? ' selected="selected"' : '').'>'.$val.'</option>';
|
||||
}
|
||||
print '</select>';
|
||||
if ($selected == 0 || $selected == 100) $canedit=0;
|
||||
print ' <input type="text" id="val'.$htmlname.'" name="percentage" class="flat hideifna" value="'.($selected>=0?$selected:'').'" size="2"'.($canedit&&($selected>=0)?'':' disabled="disabled"').'>';
|
||||
print '<span class="hideifna">%</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' <input type="text" id="val'.$htmlname.'" name="percentage" class="flat" value="'.($selected>=0?$selected:'').'" size="2"'.($canedit?'':' disabled="disabled"').'>%';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show list of actions for element
|
||||
*
|
||||
* @param Object $object Object
|
||||
* @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter'
|
||||
* @param int $socid socid of user
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
function showactions($object,$typeelement,$socid=0)
|
||||
{
|
||||
global $langs,$conf,$user;
|
||||
global $bc;
|
||||
/**
|
||||
* Show list of actions for element
|
||||
*
|
||||
* @param Object $object Object
|
||||
* @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter'
|
||||
* @param int $socid socid of user
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
function showactions($object,$typeelement,$socid=0)
|
||||
{
|
||||
global $langs,$conf,$user;
|
||||
global $bc;
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php");
|
||||
|
||||
$actioncomm = new ActionComm($this->db);
|
||||
$actioncomm->getActions($socid, $object->id, $typeelement);
|
||||
$actioncomm = new ActionComm($this->db);
|
||||
$actioncomm->getActions($socid, $object->id, $typeelement);
|
||||
|
||||
$num = count($actioncomm->actions);
|
||||
if ($num)
|
||||
{
|
||||
if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill');
|
||||
elseif ($typeelement == 'invoice_supplier' || $typeelement == 'supplier_invoice') $title=$langs->trans('ActionsOnBill');
|
||||
elseif ($typeelement == 'propal') $title=$langs->trans('ActionsOnPropal');
|
||||
elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder');
|
||||
elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_order') $title=$langs->trans('ActionsOnOrder');
|
||||
elseif ($typeelement == 'project') $title=$langs->trans('ActionsOnProject');
|
||||
elseif ($typeelement == 'shipping') $title=$langs->trans('ActionsOnShipping');
|
||||
elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter');
|
||||
else $title=$langs->trans("Actions");
|
||||
$num = count($actioncomm->actions);
|
||||
if ($num)
|
||||
{
|
||||
if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill');
|
||||
elseif ($typeelement == 'invoice_supplier' || $typeelement == 'supplier_invoice') $title=$langs->trans('ActionsOnBill');
|
||||
elseif ($typeelement == 'propal') $title=$langs->trans('ActionsOnPropal');
|
||||
elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder');
|
||||
elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_order') $title=$langs->trans('ActionsOnOrder');
|
||||
elseif ($typeelement == 'project') $title=$langs->trans('ActionsOnProject');
|
||||
elseif ($typeelement == 'shipping') $title=$langs->trans('ActionsOnShipping');
|
||||
elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter');
|
||||
else $title=$langs->trans("Actions");
|
||||
|
||||
print_titre($title);
|
||||
print_titre($title);
|
||||
|
||||
$total = 0; $var=true;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><th class="liste_titre">'.$langs->trans('Ref').'</th><th class="liste_titre">'.$langs->trans('Date').'</th><th class="liste_titre">'.$langs->trans('Action').'</th><th class="liste_titre">'.$langs->trans('By').'</th></tr>';
|
||||
print "\n";
|
||||
$total = 0; $var=true;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><th class="liste_titre">'.$langs->trans('Ref').'</th><th class="liste_titre">'.$langs->trans('Date').'</th><th class="liste_titre">'.$langs->trans('Action').'</th><th class="liste_titre">'.$langs->trans('By').'</th></tr>';
|
||||
print "\n";
|
||||
|
||||
foreach($actioncomm->actions as $action)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$action->getNomUrl(1).'</td>';
|
||||
print '<td>'.dol_print_date($action->datep,'day').'</td>';
|
||||
print '<td title="'.dol_escape_htmltag($action->label).'">'.dol_trunc($action->label,32).'</td>';
|
||||
$userstatic = new User($this->db);
|
||||
$userstatic->id = $action->author->id;
|
||||
$userstatic->firstname = $action->author->firstname;
|
||||
$userstatic->lastname = $action->author->lastname;
|
||||
print '<td>'.$userstatic->getNomUrl(1).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</table>';
|
||||
}
|
||||
foreach($actioncomm->actions as $action)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$action->getNomUrl(1).'</td>';
|
||||
print '<td>'.dol_print_date($action->datep,'day').'</td>';
|
||||
print '<td title="'.dol_escape_htmltag($action->label).'">'.dol_trunc($action->label,32).'</td>';
|
||||
$userstatic = new User($this->db);
|
||||
$userstatic->id = $action->author->id;
|
||||
$userstatic->firstname = $action->author->firstname;
|
||||
$userstatic->lastname = $action->author->lastname;
|
||||
print '<td>'.$userstatic->getNomUrl(1).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
return $num;
|
||||
}
|
||||
return $num;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Output list of type of event
|
||||
*
|
||||
* @param string $selected Type pre-selectionne
|
||||
* @param string $htmlname Nom champ formulaire
|
||||
* @return void
|
||||
*/
|
||||
function select_type_actions($selected='',$htmlname='actioncode')
|
||||
{
|
||||
global $langs,$user;
|
||||
/**
|
||||
* Output list of type of event
|
||||
*
|
||||
* @param string $selected Type pre-selectionne
|
||||
* @param string $htmlname Nom champ formulaire
|
||||
* @return void
|
||||
*/
|
||||
function select_type_actions($selected='',$htmlname='actioncode')
|
||||
{
|
||||
global $langs,$user;
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/cactioncomm.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.form.class.php");
|
||||
$caction=new CActionComm($this->db);
|
||||
$form=new Form($this->db);
|
||||
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/cactioncomm.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.form.class.php");
|
||||
$caction=new CActionComm($this->db);
|
||||
$form=new Form($this->db);
|
||||
|
||||
$arraylist=$caction->liste_array(1,'code');
|
||||
array_unshift($arraylist,' '); // Add empty line at start
|
||||
//asort($arraylist);
|
||||
$arraylist=$caction->liste_array(1,'code');
|
||||
array_unshift($arraylist,' '); // Add empty line at start
|
||||
//asort($arraylist);
|
||||
|
||||
print $form->selectarray($htmlname, $arraylist, $selected);
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||
}
|
||||
print $form->selectarray($htmlname, $arraylist, $selected);
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ class FormBarCode
|
||||
{
|
||||
print '<form method="post" action="'.$page.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="setbarcodetype">';
|
||||
print '<input type="hidden" name="action" value="set'.$htmlname.'">';
|
||||
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||
print '<tr><td>';
|
||||
$this->select_barcode_type($selected, $htmlname, 1);
|
||||
|
||||
@@ -59,13 +59,14 @@ class FormFile
|
||||
* @param int $size Length of input file area
|
||||
* @param Object $object Object to use (when attachment is done on an element)
|
||||
* @param string $options Options
|
||||
* @param boolean $useajax Use ajax if enabled
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='')
|
||||
function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=true)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
if ($conf->global->MAIN_USE_JQUERY_FILEUPLOAD)
|
||||
if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) && $useajax)
|
||||
{
|
||||
return $this->_formAjaxFileUpload($object);
|
||||
}
|
||||
@@ -596,7 +597,7 @@ class FormFile
|
||||
print '</a>';
|
||||
print "</td>\n";
|
||||
print '<td align="right">'.dol_print_size($file['size'],1,1).'</td>';
|
||||
print '<td align="center">'.dol_print_date($file['date'],"dayhour").'</td>';
|
||||
print '<td align="center">'.dol_print_date($file['date'],"dayhour","tzuser").'</td>';
|
||||
// Preview
|
||||
if (empty($useinecm))
|
||||
{
|
||||
@@ -804,7 +805,7 @@ class FormFile
|
||||
$upload_max_filesize = $mul_upload_max_filesize * (int) $upload_max_filesize;
|
||||
// Max file size
|
||||
$max_file_size = (($post_max_size < $upload_max_filesize) ? $post_max_size : $upload_max_filesize);
|
||||
|
||||
|
||||
// Include main
|
||||
include(DOL_DOCUMENT_ROOT.'/core/tpl/ajax/fileupload_main.tpl.php');
|
||||
|
||||
|
||||
@@ -954,7 +954,9 @@ class Ldap
|
||||
if (is_array($attributeArray))
|
||||
{
|
||||
// Return list with required fields
|
||||
$attributeArray=array_values($attributeArray); // This is to force to have index reordered from 0 (not make ldap_search fails)
|
||||
dol_syslog("Ldap::getRecords connection=".$this->connection." userDn=".$userDn." filter=".$filter. " attributeArray=(".join(',',$attributeArray).")");
|
||||
//var_dump($attributeArray);
|
||||
$this->result = @ldap_search($this->connection, $userDn, $filter, $attributeArray);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -114,9 +114,12 @@ class Menubase
|
||||
$obj=$this->db->fetch_object($resqlrowid);
|
||||
$maxrowid=$obj->maxrowid;
|
||||
|
||||
$sql = "SELECT setval('".MAIN_DB_PREFIX."menu_rowid_seq', ".($maxrowid).")";
|
||||
$resqlrowidset=$this->db->query($sql);
|
||||
if (! $resqlrowidset) dol_print_error($this->db);
|
||||
// Max rowid can be empty if there is no record yet
|
||||
if(empty($maxrowid)) $maxrowid=1;
|
||||
|
||||
$sql = "SELECT setval('".MAIN_DB_PREFIX."menu_rowid_seq', ".($maxrowid).")";
|
||||
$resqlrowidset=$this->db->query($sql);
|
||||
if (! $resqlrowidset) dol_print_error($this->db);
|
||||
}
|
||||
else dol_print_error($this->db);
|
||||
}
|
||||
|
||||
@@ -327,6 +327,7 @@ class Translate
|
||||
|
||||
/**
|
||||
* Return translated value of key. Search in lang file, then into database.
|
||||
* Key must be any complete entry into lang file: CurrencyEUR, ...
|
||||
* If not found, return key.
|
||||
* WARNING: To avoid infinite loop (getLabelFromKey->transnoentities->getTradFromKey), getLabelFromKey must
|
||||
* not be called with same value than input.
|
||||
@@ -334,9 +335,11 @@ class Translate
|
||||
* @param string $key Key to translate
|
||||
* @return string Translated string
|
||||
*/
|
||||
function getTradFromKey($key)
|
||||
private function getTradFromKey($key)
|
||||
{
|
||||
global $db;
|
||||
|
||||
//print 'xx'.$key;
|
||||
$newstr=$key;
|
||||
if (preg_match('/^Currency([A-Z][A-Z][A-Z])$/i',$key,$reg))
|
||||
{
|
||||
@@ -385,6 +388,18 @@ class Translate
|
||||
{
|
||||
$str=$this->tab_translate[$key];
|
||||
|
||||
// Overwrite translation
|
||||
$overwritekey='MAIN_OVERWRITE_TRANS_'.$this->defaultlang;
|
||||
if (! empty($conf->global->$overwritekey)) // Overwrite translation with key1:newstring1,key2:newstring2
|
||||
{
|
||||
$tmparray=explode(',', $conf->global->$overwritekey);
|
||||
foreach($tmparray as $tmp)
|
||||
{
|
||||
$tmparray2=explode(':',$tmp);
|
||||
if ($tmparray2[0]==$key) { $str=$tmparray2[1]; break; }
|
||||
}
|
||||
}
|
||||
|
||||
if (! preg_match('/^Format/',$key)) $str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings.
|
||||
|
||||
if ($maxsize) $str=dol_trunc($str,$maxsize);
|
||||
@@ -398,17 +413,6 @@ class Translate
|
||||
// Restore HTML tags
|
||||
$str=str_replace(array('__lt__','__gt__','__quot__'),array('<','>','"',),$str);
|
||||
|
||||
// Overwrite translation
|
||||
if (! empty($conf->global->MAIN_OVERWRITE_TRANS)) // Overwrite translation with string1:newstring1,string2:newstring2
|
||||
{
|
||||
$tmparray=explode(',', $conf->global->MAIN_OVERWRITE_TRANS);
|
||||
foreach($tmparray as $tmp)
|
||||
{
|
||||
$tmparray2=explode(':',$tmp);
|
||||
if ($tmparray2[0]==$str) { $str=$tmparray2[1]; break; }
|
||||
}
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
else // Translation is not available
|
||||
@@ -455,10 +459,24 @@ class Translate
|
||||
*/
|
||||
function transnoentitiesnoconv($key, $param1='', $param2='', $param3='', $param4='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (! empty($this->tab_translate[$key])) // Translation is available
|
||||
{
|
||||
$str=$this->tab_translate[$key];
|
||||
|
||||
// Overwrite translation
|
||||
$overwritekey='MAIN_OVERWRITE_TRANS_'.$this->defaultlang;
|
||||
if (! empty($conf->global->$overwritekey)) // Overwrite translation with key1:newstring1,key2:newstring2
|
||||
{
|
||||
$tmparray=explode(',', $conf->global->$overwritekey);
|
||||
foreach($tmparray as $tmp)
|
||||
{
|
||||
$tmparray2=explode(':',$tmp);
|
||||
if ($tmparray2[0]==$key) { $str=$tmparray2[1]; break; }
|
||||
}
|
||||
}
|
||||
|
||||
if (! preg_match('/^Format/',$key)) $str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings.
|
||||
}
|
||||
else
|
||||
@@ -614,25 +632,28 @@ class Translate
|
||||
|
||||
|
||||
/**
|
||||
* Return a label for a key. Store key-label into cache variable $this->cache_labels to save SQL requests to get labels.
|
||||
* This function can be used to get label in database but more often to get code from key id.
|
||||
* Return a label for a key.
|
||||
* Search into translation array, then into cache, then if still not found, search into database.
|
||||
* Store key-label found into cache variable $this->cache_labels to save SQL requests to get labels.
|
||||
*
|
||||
* @param DoliBD $db Database handler
|
||||
* @param string $key Key to get label (key in language file)
|
||||
* @param string $tablename Table name without prefix
|
||||
* @param string $fieldkey Field for key
|
||||
* @param string $fieldlabel Field for label
|
||||
* @return string Label in UTF8 (but without entities)
|
||||
* @param DoliBD $db Database handler
|
||||
* @param string $key Key to get label (key in language file)
|
||||
* @param string $tablename Table name without prefix
|
||||
* @param string $fieldkey Field for key
|
||||
* @param string $fieldlabel Field for label
|
||||
* @return string Label in UTF8 (but without entities)
|
||||
*/
|
||||
function getLabelFromKey($db,$key,$tablename,$fieldkey,$fieldlabel)
|
||||
{
|
||||
// If key empty
|
||||
if ($key == '') return '';
|
||||
|
||||
// Check in language array
|
||||
if ($this->transnoentities($key) != $key)
|
||||
//print 'param: '.$key.'-'.$keydatabase.'-'.$this->trans($key); exit;
|
||||
|
||||
// Check if in language array (this can call getTradFromKey)
|
||||
if ($this->transnoentitiesnoconv($key) != $key)
|
||||
{
|
||||
return $this->transnoentities($key); // Found in language array
|
||||
return $this->transnoentitiesnoconv($key); // Found in language array
|
||||
}
|
||||
|
||||
// Check in cache
|
||||
@@ -665,4 +686,4 @@ class Translate
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -1025,23 +1025,35 @@ class DoliDBPgsql
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @return array Tableau des informations des champs de la table
|
||||
* TODO modify for postgresql
|
||||
*
|
||||
*/
|
||||
function DDLInfoTable($table)
|
||||
{
|
||||
/*
|
||||
$infotables=array();
|
||||
|
||||
$sql="SHOW FULL COLUMNS FROM ".$table.";";
|
||||
$sql="SELECT ";
|
||||
$sql.=" infcol.column_name as \"Column\",";
|
||||
$sql.=" CASE WHEN infcol.character_maximum_length IS NOT NULL THEN infcol.udt_name || '('||infcol.character_maximum_length||')'";
|
||||
$sql.=" ELSE infcol.udt_name";
|
||||
$sql.=" END as \"Type\",";
|
||||
$sql.=" infcol.collation_name as \"Collation\",";
|
||||
$sql.=" infcol.is_nullable as \"Null\",";
|
||||
$sql.=" '' as \"Key\",";
|
||||
$sql.=" infcol.column_default as \"Default\",";
|
||||
$sql.=" '' as \"Extra\",";
|
||||
$sql.=" '' as \"Privileges\"";
|
||||
$sql.=" FROM information_schema.columns infcol";
|
||||
$sql.=" WHERE table_schema='public' ";
|
||||
$sql.=" AND table_name='".$table."'";
|
||||
$sql.=" ORDER BY ordinal_position;";
|
||||
|
||||
dol_syslog($sql,LOG_DEBUG);
|
||||
$result = $this->pg_query($this->db,$sql);
|
||||
$result = $this->query($sql);
|
||||
while($row = $this->fetch_row($result))
|
||||
{
|
||||
$infotables[] = $row;
|
||||
}
|
||||
return $infotables;
|
||||
*/
|
||||
}
|
||||
return $infotables;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ function societe_prepare_head($object)
|
||||
$head[$h][2] = 'prospect';
|
||||
$h++;
|
||||
}
|
||||
if ($object->client==1 || $object->client==3 || (is_object($object->object) && $object->object->client==1) || (is_object($object->object) && $object->object->client==3))
|
||||
if ($object->client==1 || $object->client==3 || (isset($object->object) && $object->object->client==1) || (isset($object->object) && $object->object->client==3))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Customer");
|
||||
|
||||
@@ -944,10 +944,10 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
|
||||
global $conf;
|
||||
//print "- ".$hour.",".$minute.",".$second.",".$month.",".$day.",".$year.",".$_SERVER["WINDIR"]." -";
|
||||
|
||||
// Clean parameters
|
||||
if ($hour == -1) $hour=0;
|
||||
if ($minute == -1) $minute=0;
|
||||
if ($second == -1) $second=0;
|
||||
// Clean parameters
|
||||
if ($hour == -1 || empty($hour)) $hour=0;
|
||||
if ($minute == -1 || empty($minute)) $minute=0;
|
||||
if ($second == -1 || empty($second)) $second=0;
|
||||
|
||||
// Check parameters
|
||||
if ($check)
|
||||
@@ -3332,6 +3332,28 @@ function dol_textishtml($msg,$option=0)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Concat 2 descriptions (second one after first one)
|
||||
* text1 html + text2 html => text1 + '<br>' + text2
|
||||
* text1 html + text2 txt => text1 + '<br>' + dol_nl2br(text2)
|
||||
* text1 txt + text2 html => dol_nl2br(text1) + '<br>' + text2
|
||||
* text1 txt + text2 txt => text1 + '\n' + text2
|
||||
*
|
||||
* @param string $text1 Text 1
|
||||
* @param string $text2 Text 2
|
||||
* @param string $forxml false=Use <br>, true=Use <br />
|
||||
* @return string Text 1 + new line + Text2
|
||||
* @see dol_textishtml
|
||||
*/
|
||||
function dol_concatdesc($text1,$text2,$forxml=false)
|
||||
{
|
||||
$ret='';
|
||||
$ret.= (! dol_textishtml($text1) && dol_textishtml($text2))?dol_nl2br($text1, 0, $forxml):$text1;
|
||||
$ret.= (! empty($text1) && ! empty($text2)) ? ((dol_textishtml($text1) || dol_textishtml($text2))?($forxml?"<br \>\n":"<br>\n") : "\n") : "";
|
||||
$ret.= (dol_textishtml($text1) && ! dol_textishtml($text2))?dol_nl2br($text2, 0, $forxml):$text2;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make substition into a string
|
||||
* There is two type of substitions:
|
||||
|
||||
@@ -137,7 +137,11 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
|
||||
*/
|
||||
function pdf_getPDFFont($outputlangs)
|
||||
{
|
||||
$font='Helvetica'; // By default, for FPDI or ISO language on TCPDF
|
||||
global $conf;
|
||||
|
||||
if (! empty($conf->global->MAIN_PDF_FORCE_FONT)) return $conf->global->MAIN_PDF_FORCE_FONT;
|
||||
|
||||
$font='Helvetica'; // By default, for FPDI, or ISO language on TCPDF
|
||||
if (class_exists('TCPDF')) // If TCPDF on, we can use an UTF8 one like DejaVuSans if required (slower)
|
||||
{
|
||||
if ($outputlangs->trans('FONTFORPDF')!='FONTFORPDF')
|
||||
@@ -218,7 +222,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
{
|
||||
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($sourcecompany))."\n";
|
||||
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOSOURCEDETAILS))
|
||||
if (empty($conf->global->MAIN_PDF_DISABLESOURCEDETAILS))
|
||||
{
|
||||
// Tel
|
||||
if ($sourcecompany->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($sourcecompany->tel);
|
||||
@@ -355,7 +359,7 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
|
||||
|
||||
$watermark_angle=atan($h/$w);
|
||||
$watermark_x=5;
|
||||
$watermark_y=$h-25; //Set to $this->page_hauteur-50 or less if problems
|
||||
$watermark_y=$h-50; // We must be sure to not print into margins
|
||||
$watermark_width=$h;
|
||||
$pdf->SetFont('','B',50);
|
||||
$pdf->SetTextColor(255,192,203);
|
||||
@@ -524,22 +528,25 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param string $paramfreetext Constant name of free text
|
||||
* @param Societe $fromcompany Object company
|
||||
* @param int $marge_basse Margin bottom
|
||||
* @param int $marge_gauche Margin left
|
||||
* @param int $page_hauteur Page height
|
||||
* @param int $marge_basse Margin bottom we use for the autobreak
|
||||
* @param int $marge_gauche Margin left (no more used)
|
||||
* @param int $page_hauteur Page height (no more used)
|
||||
* @param Object $object Object shown in PDF
|
||||
* @param int $showdetails Show company details
|
||||
* @return void
|
||||
* @param int $showdetails Show company details into footer. This param seems to not be used by standard version.
|
||||
* @param int $hidefreetext 1=Hide free text, 0=Show free text
|
||||
* @return int Return height of bottom margin including footer text
|
||||
*/
|
||||
function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_basse,$marge_gauche,$page_hauteur,$object,$showdetails=0)
|
||||
function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_basse,$marge_gauche,$page_hauteur,$object,$showdetails=0,$hidefreetext=0)
|
||||
{
|
||||
global $conf,$user;
|
||||
|
||||
$outputlangs->load("dict");
|
||||
$line='';
|
||||
|
||||
$dims=$pdf->getPageDimensions();
|
||||
|
||||
// Line of free text
|
||||
if (! empty($conf->global->$paramfreetext))
|
||||
if (empty($hidefreetext) && ! empty($conf->global->$paramfreetext))
|
||||
{
|
||||
// Make substitution
|
||||
$substitutionarray=array(
|
||||
@@ -656,64 +663,73 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
|
||||
$pdf->SetDrawColor(224,224,224);
|
||||
|
||||
// On positionne le debut du bas de page selon nbre de lignes de ce bas de page
|
||||
$nbofline=dol_nboflines_bis($line,0,$outputlangs->charset_output);
|
||||
//print 'nbofline='.$nbofline; exit;
|
||||
//print 'e'.$line.'t'.dol_nboflines($line);exit;
|
||||
$posy=$marge_basse + ($nbofline*3) + ($line1?3:0) + ($line2?3:0) + ($line3?3:0) + ($line4?3:0);
|
||||
|
||||
$freetextheight=0;
|
||||
if ($line) // Free text
|
||||
{
|
||||
$pdf->SetXY($marge_gauche,-$posy);
|
||||
$width=20000; $align='L'; // By default, ask a manual break: We use a large value 20000, to not have automatic wrap. This make user understand, he need to add CR on its text.
|
||||
if ($conf->global->MAIN_USE_AUTOWRAP_ON_FREETEXT) { $width=200; $align='C'; }
|
||||
$pdf->MultiCell($width, 3, $line, 0, $align, 0);
|
||||
$posy-=($nbofline*3); // 6 of ligne + 3 of MultiCell
|
||||
if (! empty($conf->global->MAIN_USE_AUTOWRAP_ON_FREETEXT)) {
|
||||
$width=200; $align='C';
|
||||
}
|
||||
$freetextheight=$pdf->getStringHeight($width,$line);
|
||||
}
|
||||
|
||||
$pdf->SetY(-$posy);
|
||||
$pdf->line($marge_gauche, $page_hauteur-$posy, 200, $page_hauteur-$posy);
|
||||
$posy--;
|
||||
$marginwithfooter=$marge_basse + $freetextheight + (! empty($line1)?3:0) + (! empty($line2)?3:0) + (! empty($line3)?3:0) + (! empty($line4)?3:0);
|
||||
$posy=$marginwithfooter+0;
|
||||
|
||||
if ($line1)
|
||||
{
|
||||
$pdf->SetFont('','B',7);
|
||||
$pdf->SetXY($marge_gauche,-$posy);
|
||||
$pdf->MultiCell(200, 2, $line1, 0, 'C', 0);
|
||||
$posy-=3;
|
||||
$pdf->SetFont('','',7);
|
||||
}
|
||||
|
||||
if ($line2)
|
||||
{
|
||||
$pdf->SetFont('','B',7);
|
||||
$pdf->SetXY($marge_gauche,-$posy);
|
||||
$pdf->MultiCell(200, 2, $line2, 0, 'C', 0);
|
||||
$posy-=3;
|
||||
$pdf->SetFont('','',7);
|
||||
}
|
||||
|
||||
if ($line3)
|
||||
{
|
||||
$pdf->SetXY($marge_gauche,-$posy);
|
||||
$pdf->MultiCell(200, 2, $line3, 0, 'C', 0);
|
||||
}
|
||||
|
||||
if ($line4)
|
||||
{
|
||||
$posy-=3;
|
||||
$pdf->SetXY($marge_gauche,-$posy);
|
||||
$pdf->MultiCell(200, 2, $line4, 0, 'C', 0);
|
||||
}
|
||||
|
||||
// Show page nb only on iso languages (so default Helvetica font)
|
||||
if (pdf_getPDFFont($outputlangs) == 'Helvetica')
|
||||
{
|
||||
$pdf->SetXY(-20,-$posy);
|
||||
$pdf->MultiCell(11, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0);
|
||||
//print 'xxx'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit;
|
||||
}
|
||||
if ($line) // Free text
|
||||
{
|
||||
$pdf->SetXY($dims['lm'],-$posy);
|
||||
$pdf->MultiCell($width, 3, $line, 0, $align, 0);
|
||||
$posy-=$freetextheight;
|
||||
}
|
||||
|
||||
$pdf->SetY(-$posy);
|
||||
$pdf->line($dims['lm'], $dims['hk']-$posy, $dims['wk']-$dims['rm'], $dims['hk']-$posy);
|
||||
$posy--;
|
||||
|
||||
if (! empty($line1))
|
||||
{
|
||||
$pdf->SetFont('','B',7);
|
||||
$pdf->SetXY($dims['lm'],-$posy);
|
||||
$pdf->MultiCell(200, 2, $line1, 0, 'C', 0);
|
||||
$posy-=3;
|
||||
$pdf->SetFont('','',7);
|
||||
}
|
||||
|
||||
if (! empty($line2))
|
||||
{
|
||||
$pdf->SetFont('','B',7);
|
||||
$pdf->SetXY($dims['lm'],-$posy);
|
||||
$pdf->MultiCell(200, 2, $line2, 0, 'C', 0);
|
||||
$posy-=3;
|
||||
$pdf->SetFont('','',7);
|
||||
}
|
||||
|
||||
if (! empty($line3))
|
||||
{
|
||||
$pdf->SetXY($dims['lm'],-$posy);
|
||||
$pdf->MultiCell(200, 2, $line3, 0, 'C', 0);
|
||||
}
|
||||
|
||||
if (! empty($line4))
|
||||
{
|
||||
$posy-=3;
|
||||
$pdf->SetXY($dims['lm'],-$posy);
|
||||
$pdf->MultiCell(200, 2, $line4, 0, 'C', 0);
|
||||
}
|
||||
|
||||
// Show page nb only on iso languages (so default Helvetica font)
|
||||
if (pdf_getPDFFont($outputlangs) == 'Helvetica')
|
||||
{
|
||||
$pdf->SetXY(-20,-$posy);
|
||||
$pdf->MultiCell(11, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0);
|
||||
//print 'xxx'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit;
|
||||
}
|
||||
|
||||
return $marginwithfooter;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show linked objects for PDF generation
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2012 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
|
||||
@@ -95,8 +95,8 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $txlocalta
|
||||
$result[9] = price2num(($result[0] * ( 1 + ( $txlocaltax1 / 100))) - $result[0], 'MT');
|
||||
$result[2] = price2num($result[2] + $result[9], 'MT');
|
||||
|
||||
$result[11] = price2num(($result[3] * ( 1 + ( $txlocaltax1 / 100))) - $pu, 'MT');
|
||||
$result[5] = price2num($result[5] + $result[11], 'MT');
|
||||
$result[11] = price2num(($result[3] * ( 1 + ( $txlocaltax1 / 100))) - $pu, 'MU');
|
||||
$result[5] = price2num($result[5] + $result[11], 'MU');
|
||||
|
||||
}
|
||||
else
|
||||
@@ -110,7 +110,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $txlocalta
|
||||
{
|
||||
$result[15] = price2num(($result[6] * ( 1 + ( $txlocaltax2 / 100))) - $result[6], 'MT');
|
||||
$result[10] = price2num(($result[0] * ( 1 + ( $txlocaltax2 / 100))) - $result[0], 'MT');
|
||||
$result[12] = price2num(($result[3] * ( 1 + ( $txlocaltax2 / 100))) - $pu, 'MT');
|
||||
$result[12] = price2num(($result[3] * ( 1 + ( $txlocaltax2 / 100))) - $pu, 'MU');
|
||||
|
||||
//If Country is Spain, localtax2 (IRPF) will be subtracted
|
||||
if ($mysoc->country_code=='ES')
|
||||
|
||||
@@ -132,6 +132,8 @@ function product_prepare_head($object, $user)
|
||||
}
|
||||
}
|
||||
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'product', 'remove');
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
||||
$hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
// Login
|
||||
$login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha",2) ? GETPOST("username","alpha",2) : $demologin));
|
||||
$login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha") ? GETPOST("username","alpha") : $demologin));
|
||||
$password = $demopassword;
|
||||
|
||||
// Show logo (search in order: small company logo, large company logo, theme logo, common logo)
|
||||
|
||||
@@ -1373,8 +1373,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
$num=count($menu_array);
|
||||
for ($i = 0; $i < $num; $i++)
|
||||
{
|
||||
$showmenu=true;
|
||||
if (! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($menu_array[$i]['enabled'])) {
|
||||
$showmenu=false;
|
||||
}
|
||||
|
||||
$alt++;
|
||||
if (empty($menu_array[$i]['level']))
|
||||
if (empty($menu_array[$i]['level']) && $showmenu)
|
||||
{
|
||||
if (($alt%2==0))
|
||||
{
|
||||
@@ -1409,11 +1414,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
{
|
||||
print '<div class="menu_titre">'.$tabstring.'<a class="vmenu" href="'.$url.'"'.($menu_array[$i]['target']?' target="'.$menu_array[$i]['target'].'"':'').'>'.$menu_array[$i]['titre'].'</a></div>'."\n";
|
||||
}
|
||||
else if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED))
|
||||
else if ($showmenu)
|
||||
{
|
||||
print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$menu_array[$i]['titre'].'</font></div>'."\n";
|
||||
}
|
||||
print '<div class="menu_top"></div>'."\n";
|
||||
if ($showmenu)
|
||||
print '<div class="menu_top"></div>'."\n";
|
||||
}
|
||||
// Menu niveau > 0
|
||||
if ($menu_array[$i]['level'] > 0)
|
||||
@@ -1428,7 +1434,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
if (! strstr($menu_array[$i]['titre'],'<table')) print '<br>';
|
||||
print '</div>'."\n";
|
||||
}
|
||||
else if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED))
|
||||
else if ($showmenu)
|
||||
{
|
||||
print '<div class="menu_contenu">'.$tabstring.'<font class="vsmenudisabled">'.$menu_array[$i]['titre'].'</font><br></div>'."\n";
|
||||
}
|
||||
@@ -1437,7 +1443,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
// If next is a new block or end
|
||||
if (empty($menu_array[$i+1]['level']))
|
||||
{
|
||||
print '<div class="menu_end"></div>'."\n";
|
||||
if ($showmenu)
|
||||
print '<div class="menu_end"></div>'."\n";
|
||||
print "</div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,6 +114,11 @@ class CommActionRapport
|
||||
{
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
|
||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
$pdf->setPrintHeader(false);
|
||||
|
||||
@@ -119,6 +119,11 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
// Create PDF instance
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
|
||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
$pdf->setPrintHeader(false);
|
||||
@@ -344,9 +349,10 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param int $hidefreetext 1=Hide free text
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
|
||||
{
|
||||
global $conf;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -24,17 +24,16 @@
|
||||
* \brief Fichier de la classe permettant de generer les bordereaux envoi au modele Merou
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT."/core/modules/expedition/modules_expedition.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/contact/class/contact.class.php";
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
* \class pdf_expedition_merou
|
||||
* \brief Classe permettant de generer les borderaux envoi au modele Merou
|
||||
* Classe permettant de generer les borderaux envoi au modele Merou
|
||||
*/
|
||||
Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
class pdf_expedition_merou extends ModelePdfExpedition
|
||||
{
|
||||
var $emetteur; // Objet societe qui emet
|
||||
|
||||
@@ -50,7 +49,6 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
|
||||
$this->db = $db;
|
||||
$this->name = "merou";
|
||||
//$this->description = "Modele Merou A5";
|
||||
$this->description = $langs->trans("DocumentModelMerou");
|
||||
|
||||
$this->type = 'pdf';
|
||||
@@ -58,12 +56,12 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = round($formatarray['height']/2);
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
$this->marge_haute=10;
|
||||
$this->marge_basse=10;
|
||||
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||
|
||||
$this->option_logo = 1; // Affiche logo
|
||||
$this->option_logo = 1;
|
||||
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
@@ -72,16 +70,20 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
|
||||
|
||||
/**
|
||||
* Fonction generant le document sur le disque
|
||||
* Function to build pdf onto disk
|
||||
*
|
||||
* @param Object &$object Objet expedition a generer (ou id si ancienne methode)
|
||||
* @param Translate $outputlangs Lang output object
|
||||
* @return int 1=ok, 0=ko
|
||||
* @param Object &$object Object expedition to generate (or id if old method)
|
||||
* @param Translate $outputlangs Lang output object
|
||||
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||
* @param int $hidedetails Do not show line details
|
||||
* @param int $hidedesc Do not show desc
|
||||
* @param int $hideref Do not show ref
|
||||
* @param object $hookmanager Hookmanager object
|
||||
* @return int 1=OK, 0=KO
|
||||
*/
|
||||
function write_file(&$object, $outputlangs)
|
||||
function write_file(&$object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
|
||||
{
|
||||
global $user,$conf,$langs,$mysoc;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
@@ -95,13 +97,9 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
$outputlangs->load("bills");
|
||||
$outputlangs->load("products");
|
||||
$outputlangs->load("propal");
|
||||
$outputlangs->load("sendings");
|
||||
$outputlangs->load("deliveries");
|
||||
$outputlangs->load("sendings");
|
||||
|
||||
//Generation de la fiche
|
||||
$this->expe = $object;
|
||||
|
||||
//Verification de la configuration
|
||||
if ($conf->expedition->dir_output)
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
@@ -114,13 +112,12 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
//Creation du destinataire
|
||||
$idcontact = $object->$origin->getIdContact('external','SHIPPING');
|
||||
$this->destinataire = new Contact($this->db);
|
||||
if ($idcontact[0]) $this->destinataire->fetch($idcontact[0]);
|
||||
if (! empty($idcontact[0])) $this->destinataire->fetch($idcontact[0]);
|
||||
|
||||
//Creation du livreur
|
||||
$idcontact = $object->$origin->getIdContact('internal','LIVREUR');
|
||||
$this->livreur = new User($this->db);
|
||||
if ($idcontact[0]) $this->livreur->fetch($idcontact[0]);
|
||||
|
||||
if (! empty($idcontact[0])) $this->livreur->fetch($idcontact[0]);
|
||||
|
||||
// Definition de $dir et $file
|
||||
if ($object->specimen)
|
||||
@@ -139,15 +136,21 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
{
|
||||
if (dol_mkdir($dir) < 0)
|
||||
{
|
||||
$this->error=$outputlangs->transnoentities("ErrorCanNotCreateDir",$dir);
|
||||
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
//Si le dossier existe
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$pdf=pdf_getInstance($this->format,'mm','l');
|
||||
$nblignes = count($object->lines);
|
||||
|
||||
$pdf=pdf_getInstance($this->format,'mm','l');
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
$heightforinfotot = 0; // Height reserved to output the info and total part
|
||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
@@ -166,91 +169,130 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
$pagenb=0;
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
|
||||
//Generation de l entete du fichier
|
||||
$pdf->AliasNbPages();
|
||||
|
||||
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
|
||||
$pdf->SetSubject($outputlangs->transnoentities("Sending"));
|
||||
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
|
||||
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
|
||||
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Sending"));
|
||||
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
|
||||
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
|
||||
|
||||
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
$pagenb++;
|
||||
$this->_pagehead($pdf, $this->expe, 1, $outputlangs);
|
||||
$this->_pagehead($pdf, $object, 1, $outputlangs, $hookmanager);
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
//Initialisation des coordonnees
|
||||
$tab_top = 53;
|
||||
$tab_height = $this->page_hauteur - 78;
|
||||
$tab_top = 52;
|
||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||
$tab_height = $this->page_hauteur - $tab_top - $heightforfooter;
|
||||
$tab_height_newpage = $this->page_hauteur - $tab_top_newpage - $heightforfooter;
|
||||
|
||||
$pdf->SetFillColor(240,240,240);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
$pdf->SetXY(10, $tab_top + 5);
|
||||
$iniY = $pdf->GetY();
|
||||
$curY = $pdf->GetY();
|
||||
$nexY = $pdf->GetY();
|
||||
//Generation du tableau
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
|
||||
|
||||
$nblignes = count($object->lines);
|
||||
$iniY = $tab_top + 7;
|
||||
$curY = $tab_top + 7;
|
||||
$nexY = $tab_top + 7;
|
||||
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
$num=count($object->lines);
|
||||
// Loop on each lines
|
||||
for ($i = 0; $i < $num; $i++)
|
||||
{
|
||||
$curY = $nexY;
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$pdf->setTopMargin($tab_top_newpage);
|
||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||
$pageposbefore=$pdf->getPage();
|
||||
|
||||
// Description de la ligne produit
|
||||
$libelleproduitservice = pdf_writelinedesc($pdf,$object,$i,$outputlangs,90,3,50,$curY,0,1);
|
||||
|
||||
$nexY = $pdf->GetY();
|
||||
$pageposafter=$pdf->getPage();
|
||||
$pdf->setPage($pageposbefore);
|
||||
$pdf->setTopMargin($this->marge_haute);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
|
||||
// We suppose that a too long description is moved completely on next page
|
||||
if ($pageposafter > $pageposbefore) {
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
|
||||
//Creation des cases a cocher
|
||||
$pdf->Rect(10+3, $curY+1, 3, 3);
|
||||
$pdf->Rect(20+3, $curY+1, 3, 3);
|
||||
$pdf->Rect(10+3, $curY, 3, 3);
|
||||
$pdf->Rect(20+3, $curY, 3, 3);
|
||||
//Insertion de la reference du produit
|
||||
$pdf->SetXY(30, $curY+1);
|
||||
$pdf->SetXY(30, $curY);
|
||||
$pdf->SetFont('','B', $default_font_size - 3);
|
||||
$pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($object->lines[$i]->ref), 0, 'L', 0);
|
||||
//Insertion du libelle
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
$pdf->SetXY(50, $curY+1);
|
||||
//$libelleproduitservice=pdf_getlinedesc($object->$origin,$i,$outputlangs);
|
||||
$libelleproduitservice = pdf_writelinedesc($pdf,$object->$origin,$i,$outputlangs,90,3,50,$curY+1,1);
|
||||
//$pdf->writeHTMLCell(90, 3, 50, $curY+1, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 'L', 0);
|
||||
//Insertion de la quantite commandee
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
$pdf->SetXY(140, $curY+1);
|
||||
|
||||
$pdf->SetXY(140, $curY);
|
||||
$pdf->MultiCell(30, 3, $object->lines[$i]->qty_asked, 0, 'C', 0);
|
||||
//Insertion de la quantite a envoyer
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
$pdf->SetXY(170, $curY+1);
|
||||
|
||||
$pdf->SetXY(170, $curY);
|
||||
$pdf->MultiCell(30, 3, $object->lines[$i]->qty_shipped, 0, 'C', 0);
|
||||
|
||||
//Generation de la page 2
|
||||
$curY += (dol_nboflines_bis($libelleproduitservice,0,$outputlangs->charset_output)*3+1);
|
||||
$nexY = $curY;
|
||||
if ($nexY > ($tab_top+$tab_height-10) && $i < $nblignes - 1)
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
|
||||
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||
$pdf->AliasNbPages();
|
||||
|
||||
$curY = $iniY;
|
||||
|
||||
$pdf->setPage($pagenb);
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
}
|
||||
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
$pagenb++;
|
||||
$this->_pagehead($pdf, $this->expe, 0, $outputlangs);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
}
|
||||
}
|
||||
//Insertion du pied de page
|
||||
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||
|
||||
// Show square
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||
}
|
||||
|
||||
// Pied de page
|
||||
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||
$pdf->AliasNbPages();
|
||||
|
||||
$pdf->Close();
|
||||
@@ -285,9 +327,11 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @param int $hidetop Hide top bar of array
|
||||
* @param int $hidebottom Hide bottom bar of array
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
|
||||
{
|
||||
global $langs;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
@@ -295,21 +339,24 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
$langs->load("main");
|
||||
$langs->load("bills");
|
||||
|
||||
$pdf->SetFont('','B', $default_font_size - 2);
|
||||
$pdf->SetXY(10,$tab_top);
|
||||
$pdf->MultiCell(10,5,"LS",0,'C',1);
|
||||
$pdf->line(20, $tab_top, 20, $tab_top + $tab_height);
|
||||
$pdf->SetXY(20,$tab_top);
|
||||
$pdf->MultiCell(10,5,"LR",0,'C',1);
|
||||
$pdf->line(30, $tab_top, 30, $tab_top + $tab_height);
|
||||
$pdf->SetXY(30,$tab_top);
|
||||
$pdf->MultiCell(20,5,$outputlangs->transnoentities("Ref"),0,'C',1);
|
||||
$pdf->SetXY(50,$tab_top);
|
||||
$pdf->MultiCell(90,5,$outputlangs->transnoentities("Description"),0,'L',1);
|
||||
$pdf->SetXY(140,$tab_top);
|
||||
$pdf->MultiCell(30,5,$outputlangs->transnoentities("QtyOrdered"),0,'C',1);
|
||||
$pdf->SetXY(170,$tab_top);
|
||||
$pdf->MultiCell(30,5,$outputlangs->transnoentities("QtyToShip"),0,'C',1);
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetFont('','B', $default_font_size - 2);
|
||||
$pdf->SetXY(10,$tab_top);
|
||||
$pdf->MultiCell(10,5,"LS",0,'C',1);
|
||||
$pdf->line(20, $tab_top, 20, $tab_top + $tab_height);
|
||||
$pdf->SetXY(20,$tab_top);
|
||||
$pdf->MultiCell(10,5,"LR",0,'C',1);
|
||||
$pdf->line(30, $tab_top, 30, $tab_top + $tab_height);
|
||||
$pdf->SetXY(30,$tab_top);
|
||||
$pdf->MultiCell(20,5,$outputlangs->transnoentities("Ref"),0,'C',1);
|
||||
$pdf->SetXY(50,$tab_top);
|
||||
$pdf->MultiCell(90,5,$outputlangs->transnoentities("Description"),0,'L',1);
|
||||
$pdf->SetXY(140,$tab_top);
|
||||
$pdf->MultiCell(30,5,$outputlangs->transnoentities("QtyOrdered"),0,'C',1);
|
||||
$pdf->SetXY(170,$tab_top);
|
||||
$pdf->MultiCell(30,5,$outputlangs->transnoentities("QtyToShip"),0,'C',1);
|
||||
}
|
||||
$pdf->Rect(10, $tab_top, 190, $tab_height);
|
||||
}
|
||||
|
||||
@@ -319,9 +366,10 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param int $hidefreetext 1=Hide free text
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf, $object, $outputlangs)
|
||||
function _pagefoot(&$pdf, $object, $outputlangs,$hidefreetext=0)
|
||||
{
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
@@ -534,7 +582,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname;
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->nom;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -24,16 +24,15 @@
|
||||
* \brief Fichier de la classe permettant de generer les bordereaux envoi au modele Rouget
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT."/core/modules/expedition/modules_expedition.php";
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
* \class pdf_expedition_dorade
|
||||
* \brief Classe permettant de generer les borderaux envoi au modele Rouget
|
||||
* Classe permettant de generer les borderaux envoi au modele Rouget
|
||||
*/
|
||||
Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
{
|
||||
var $emetteur; // Objet societe qui emet
|
||||
|
||||
@@ -56,10 +55,10 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
$this->marge_haute=10;
|
||||
$this->marge_basse=10;
|
||||
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||
|
||||
$this->option_logo = 1;
|
||||
|
||||
@@ -69,21 +68,25 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
|
||||
// Defini position des colonnes
|
||||
$this->posxdesc=$this->marge_gauche+1;
|
||||
$this->posxqtyordered=120;
|
||||
$this->posxqtytoship=160;
|
||||
$this->posxqtyordered=$this->page_largeur - $this->marge_droite - 70;
|
||||
$this->posxqtytoship=$this->page_largeur - $this->marge_droite - 35;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fonction generant le document sur le disque
|
||||
* Function to build pdf onto disk
|
||||
*
|
||||
* @param Object &$object Objet expedition a generer (ou id si ancienne methode)
|
||||
* @param Translate $outputlangs Lang output object
|
||||
* @return int 1=ok, 0=ko
|
||||
* @param Object &$object Object expedition to generate (or id if old method)
|
||||
* @param Translate $outputlangs Lang output object
|
||||
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||
* @param int $hidedetails Do not show line details
|
||||
* @param int $hidedesc Do not show desc
|
||||
* @param int $hideref Do not show ref
|
||||
* @param object $hookmanager Hookmanager object
|
||||
* @return int 1=OK, 0=KO
|
||||
*/
|
||||
function write_file(&$object, $outputlangs)
|
||||
function write_file(&$object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
|
||||
{
|
||||
global $user,$conf,$langs;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
@@ -119,14 +122,21 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
{
|
||||
if (dol_mkdir($dir) < 0)
|
||||
{
|
||||
$this->error=$outputlangs->transnoentities("ErrorCanNotCreateDir",$dir);
|
||||
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$nblignes = count($object->lines);
|
||||
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
$heightforinfotot = 0; // Height reserved to output the info and total part
|
||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
@@ -151,23 +161,24 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
$pdf->SetSubject($outputlangs->transnoentities("Sending"));
|
||||
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
|
||||
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
|
||||
$pdf->SetKeyWords($outputlangs->convToOutputCharset($fac->ref)." ".$outputlangs->transnoentities("Sending"));
|
||||
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
|
||||
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Sending"));
|
||||
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
|
||||
|
||||
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
$this->_pagehead($pdf, $object, 1, $outputlangs);
|
||||
$this->_pagehead($pdf, $object, 1, $outputlangs, $hookmanager);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$tab_top = 90;
|
||||
$tab_height = 170;
|
||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||
$tab_height = 130;
|
||||
$tab_height_newpage = 150;
|
||||
|
||||
if (! empty($object->note_public) || ! empty($object->tracking_number))
|
||||
{
|
||||
@@ -213,32 +224,92 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
$height_note=0;
|
||||
}
|
||||
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
|
||||
|
||||
$iniY = $tab_top + 7;
|
||||
$curY = $tab_top + 7;
|
||||
$nexY = $tab_top + 7;
|
||||
|
||||
$num=count($object->lines);
|
||||
// Loop on each lines
|
||||
for ($i = 0; $i < $num; $i++)
|
||||
{
|
||||
$curY = $nexY;
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
||||
$pdf->setTopMargin($tab_top_newpage);
|
||||
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||
$pageposbefore=$pdf->getPage();
|
||||
|
||||
// Description de la ligne produit
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,150,3,$this->posxdesc,$curY,0,1);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$nexY = $pdf->GetY();
|
||||
$pageposafter=$pdf->getPage();
|
||||
$pdf->setPage($pageposbefore);
|
||||
$pdf->setTopMargin($this->marge_haute);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
|
||||
$pdf->SetXY($this->posxqtyordered+5, $curY);
|
||||
$pdf->MultiCell(30, 3, $object->lines[$i]->qty_asked,'','C');
|
||||
// We suppose that a too long description is moved completely on next page
|
||||
if ($pageposafter > $pageposbefore) {
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
|
||||
$pdf->SetXY($this->posxqtytoship+5, $curY);
|
||||
$pdf->MultiCell(30, 3, $object->lines[$i]->qty_shipped,'','C');
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
$pdf->SetXY($this->posxqtyordered, $curY);
|
||||
$pdf->MultiCell(($this->posxqtytoship - $this->posxqtyordered), 3, $object->lines[$i]->qty_asked,'','C');
|
||||
|
||||
$pdf->SetXY($this->posxqtytoship, $curY);
|
||||
$pdf->MultiCell(($this->page_largeur - $this->marge_droite - $this->posxqtytoship), 3, $object->lines[$i]->qty_shipped,'','C');
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
$pdf->setPage($pagenb);
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
}
|
||||
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
}
|
||||
}
|
||||
|
||||
// Show square
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext - $heightforinfotot, 0, $outputlangs, 0, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfreetext - $heightforinfotot + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter - $heightforfreetext - $heightforinfotot, 0, $outputlangs, 1, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfreetext - $heightforinfotot + 1;
|
||||
}
|
||||
|
||||
// Pied de page
|
||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||
@@ -275,34 +346,51 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @param int $hidetop Hide top bar of array
|
||||
* @param int $hidebottom Hide bottom bar of array
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// Force to disable hidetop and hidebottom
|
||||
$hidebottom=0;
|
||||
if ($hidetop) $hidetop=-1;
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
// Amount in (at tab_top - 1)
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
|
||||
// Rect prend une longueur en 3eme param
|
||||
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height);
|
||||
// line prend une position y en 3eme param
|
||||
$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5);
|
||||
|
||||
$pdf->SetFont('','',$default_font_size - 1);
|
||||
|
||||
$pdf->SetXY($this->posxdesc-1, $tab_top+1);
|
||||
$pdf->MultiCell(108, 2, $outputlangs->transnoentities("Description"), '', 'L');
|
||||
// Output Rect
|
||||
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
|
||||
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
$pdf->SetFont('','',$default_font_size - 1);
|
||||
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5);
|
||||
|
||||
$pdf->SetXY($this->posxdesc-1, $tab_top+1);
|
||||
$pdf->MultiCell($this->posxqtyordered - $this->posxdesc, 2, $outputlangs->transnoentities("Description"), '', 'L');
|
||||
}
|
||||
|
||||
$pdf->line($this->posxqtyordered-1, $tab_top, $this->posxqtyordered-1, $tab_top + $tab_height);
|
||||
$pdf->SetXY($this->posxqtyordered-1, $tab_top+1);
|
||||
$pdf->MultiCell(40,2, $outputlangs->transnoentities("QtyOrdered"),'','C');
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->posxqtyordered, $tab_top+1);
|
||||
$pdf->MultiCell(($this->posxqtytoship - $this->posxqtyordered), 2, $outputlangs->transnoentities("QtyOrdered"),'','C');
|
||||
}
|
||||
|
||||
$pdf->line($this->posxqtytoship-1, $tab_top, $this->posxqtytoship-1, $tab_top + $tab_height);
|
||||
$pdf->SetXY($this->posxqtytoship-1, $tab_top+1);
|
||||
$pdf->MultiCell(40,2, $outputlangs->transnoentities("QtyToShip"),'','C');
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->posxqtytoship, $tab_top+1);
|
||||
$pdf->MultiCell(($this->page_largeur - $this->marge_droite - $this->posxqtytoship), 2, $outputlangs->transnoentities("QtyToShip"),'','C');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -361,7 +449,7 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
}
|
||||
|
||||
// Show barcode
|
||||
if ($conf->barcode->enabled)
|
||||
if (! empty($conf->barcode->enabled))
|
||||
{
|
||||
$posx=105;
|
||||
}
|
||||
@@ -370,7 +458,7 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
$posx=$this->marge_gauche+3;
|
||||
}
|
||||
//$pdf->Rect($this->marge_gauche, $this->marge_haute, $this->page_largeur-$this->marge_gauche-$this->marge_droite, 30);
|
||||
if ($conf->barcode->enabled)
|
||||
if (! empty($conf->barcode->enabled))
|
||||
{
|
||||
// TODO Build code bar with function writeBarCode of barcode module for sending ref $object->ref
|
||||
//$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3);
|
||||
@@ -378,7 +466,7 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
}
|
||||
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
if ($conf->barcode->enabled)
|
||||
if (! empty($conf->barcode->enabled))
|
||||
{
|
||||
// TODO Build code bar with function writeBarCode of barcode module for sending ref $object->ref
|
||||
//$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3);
|
||||
@@ -386,7 +474,7 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
}
|
||||
|
||||
|
||||
$posx=100;
|
||||
$posx=$this->page_largeur - 100 - $this->marge_droite;
|
||||
$posy=$this->marge_haute;
|
||||
|
||||
$pdf->SetFont('','B', $default_font_size + 2);
|
||||
@@ -442,8 +530,8 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
$text=$linkedobject->ref;
|
||||
if ($linkedobject->ref_client) $text.=' ('.$linkedobject->ref_client.')';
|
||||
$Yoff = $Yoff+8;
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - 60,$Yoff);
|
||||
$pdf->MultiCell(60, 2, $outputlangs->transnoentities("RefOrder") ." : ".$outputlangs->transnoentities($text), 0, 'R');
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - 100,$Yoff);
|
||||
$pdf->MultiCell(100, 2, $outputlangs->transnoentities("RefOrder") ." : ".$outputlangs->transnoentities($text), 0, 'R');
|
||||
$Yoff = $Yoff+4;
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - 60,$Yoff);
|
||||
$pdf->MultiCell(60, 2, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->commande->date,"daytext",false,$outputlangs,true), 0, 'R');
|
||||
@@ -454,8 +542,9 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
{
|
||||
// Sender properties
|
||||
$carac_emetteur='';
|
||||
// Add internal contact of proposal if defined
|
||||
$arrayidcontact=$object->getIdContact('internal','SALESREPFOLL');
|
||||
// Add internal contact of origin element if defined
|
||||
$arrayidcontact=array();
|
||||
if (! empty($origin) && is_object($object->$origin)) $arrayidcontact=$object->$origin->getIdContact('internal','SALESREPFOLL');
|
||||
if (count($arrayidcontact) > 0)
|
||||
{
|
||||
$object->fetch_user($arrayidcontact[0]);
|
||||
@@ -468,7 +557,7 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
$posx=$this->marge_gauche;
|
||||
$posy=42;
|
||||
$hautcadre=40;
|
||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=118;
|
||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur - 80 - $this->marge_droite;
|
||||
|
||||
// Show sender frame
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
@@ -491,9 +580,9 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
|
||||
|
||||
|
||||
// If CUSTOMER contact defined, we use it
|
||||
// If SHIPPING contact defined, we use it
|
||||
$usecontact=false;
|
||||
$arrayidcontact=$object->getIdContact('external','CUSTOMER');
|
||||
$arrayidcontact=$object->$origin->getIdContact('external','SHIPPING');
|
||||
if (count($arrayidcontact) > 0)
|
||||
{
|
||||
$usecontact=true;
|
||||
@@ -504,7 +593,7 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname;
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->nom;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
@@ -516,27 +605,29 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target');
|
||||
|
||||
// Show recipient
|
||||
$widthrecbox=100;
|
||||
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
|
||||
$posy=42;
|
||||
$posx=100;
|
||||
$posx=$this->page_largeur - $this->marge_droite - $widthrecbox;
|
||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||
|
||||
// Show recipient frame
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY($posx,$posy-5);
|
||||
$pdf->MultiCell(80, 4, $outputlangs->transnoentities("Recipient").":", 0, 'L');
|
||||
$pdf->Rect($posx, $posy, 100, $hautcadre);
|
||||
$pdf->MultiCell($widthrecbox, 4, $outputlangs->transnoentities("Recipient").":", 0, 'L');
|
||||
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
// Show recipient name
|
||||
$pdf->SetXY($posx+2,$posy+3);
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$pdf->MultiCell(96,4, $carac_client_name, 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||
|
||||
// Show recipient information
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
|
||||
$pdf->MultiCell(86,4, $carac_client, 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -547,11 +638,12 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param int $hidefreetext 1=Hide free text
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
|
||||
{
|
||||
return pdf_pagefoot($pdf,$outputlangs,'SHIPPING_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object);
|
||||
return pdf_pagefoot($pdf,$outputlangs,'SHIPPING_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2012 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
|
||||
@@ -25,11 +25,11 @@
|
||||
* \brief File of class to generate customers invoices from crabe model
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/modules/facture/modules_facture.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
@@ -78,10 +78,10 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
$this->marge_haute=10;
|
||||
$this->marge_basse=10;
|
||||
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||
|
||||
$this->option_logo = 1; // Affiche logo
|
||||
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||
@@ -98,15 +98,23 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
// Get source company
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined
|
||||
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined
|
||||
|
||||
// Defini position des colonnes
|
||||
// Define position of columns
|
||||
$this->posxdesc=$this->marge_gauche+1;
|
||||
$this->posxtva=111;
|
||||
$this->posxup=126;
|
||||
$this->posxqty=145;
|
||||
$this->posxdiscount=162;
|
||||
$this->postotalht=174;
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
$this->posxtva-=20;
|
||||
$this->posxup-=20;
|
||||
$this->posxqty-=20;
|
||||
$this->posxdiscount-=20;
|
||||
$this->postotalht-=20;
|
||||
}
|
||||
|
||||
$this->tva=array();
|
||||
$this->localtax1=array();
|
||||
@@ -119,14 +127,14 @@ class pdf_crabe extends ModelePDFFactures
|
||||
/**
|
||||
* Function to build pdf onto disk
|
||||
*
|
||||
* @param int $object Id of object to generate
|
||||
* @param object $outputlangs Lang output object
|
||||
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||
* @param int $hidedetails Do not show line details
|
||||
* @param int $hidedesc Do not show desc
|
||||
* @param int $hideref Do not show ref
|
||||
* @param object $hookmanager Hookmanager object
|
||||
* @return int 1=OK, 0=KO
|
||||
* @param Object $object Object to generate
|
||||
* @param Translate $outputlangs Lang output object
|
||||
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||
* @param int $hidedetails Do not show line details
|
||||
* @param int $hidedesc Do not show desc
|
||||
* @param int $hideref Do not show ref
|
||||
* @param object $hookmanager Hookmanager object
|
||||
* @return int 1=OK, 0=KO
|
||||
*/
|
||||
function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
|
||||
{
|
||||
@@ -142,8 +150,6 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$outputlangs->load("bills");
|
||||
$outputlangs->load("products");
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
if ($conf->facture->dir_output)
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
@@ -168,7 +174,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
{
|
||||
if (dol_mkdir($dir) < 0)
|
||||
{
|
||||
$this->error=$langs->trans("ErrorCanNotCreateDir",$dir);
|
||||
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -178,6 +184,11 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$nblignes = count($object->lines);
|
||||
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
@@ -185,6 +196,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->setPrintFooter(false);
|
||||
}
|
||||
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
||||
|
||||
// Set path to the background PDF File
|
||||
if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
|
||||
{
|
||||
@@ -201,10 +213,9 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
|
||||
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
|
||||
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Invoice"));
|
||||
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
|
||||
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
|
||||
|
||||
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
// Positionne $this->atleastonediscount si on a au moins une remise
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
@@ -219,13 +230,14 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
|
||||
$this->_pagehead($pdf, $object, 1, $outputlangs, $hookmanager);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$tab_top = 90;
|
||||
$tab_top_newpage = 50;
|
||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||
$tab_height = 130;
|
||||
$tab_height_newpage = 150;
|
||||
|
||||
@@ -241,8 +253,6 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
// Rect prend une longueur en 3eme param
|
||||
$pdf->SetDrawColor(192,192,192);
|
||||
//print $pdf->getStringHeight(200,'SPECIMEN',false,false);
|
||||
//print "$this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1";exit;
|
||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
||||
|
||||
$tab_height = $tab_height - $height_note;
|
||||
@@ -258,17 +268,67 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$nexY = $tab_top + 7;
|
||||
|
||||
// Loop on each lines
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
for ($i = 0; $i < $nblignes; $i++)
|
||||
{
|
||||
$curY = $nexY;
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$pdf->setTopMargin($tab_top_newpage);
|
||||
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||
$pageposbefore=$pdf->getPage();
|
||||
|
||||
// Description of product line
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||
$curX = $this->posxdesc-1;
|
||||
|
||||
$showpricebeforepagebreak=1;
|
||||
|
||||
$pdf->startTransaction();
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
||||
$pageposafter=$pdf->getPage();
|
||||
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
||||
{
|
||||
$pdf->rollbackTransaction(true);
|
||||
$pageposafter=$pageposbefore;
|
||||
//print $pageposafter.'-'.$pageposbefore;exit;
|
||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
||||
$pageposafter=$pdf->getPage();
|
||||
$posyafter=$pdf->GetY();
|
||||
//var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit;
|
||||
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
|
||||
{
|
||||
if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page
|
||||
{
|
||||
$pdf->AddPage('','',true);
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
|
||||
$pdf->setPage($pagenb+1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// We found a page break
|
||||
$showpricebeforepagebreak=0;
|
||||
}
|
||||
}
|
||||
else // No pagebreak
|
||||
{
|
||||
$pdf->commitTransaction();
|
||||
}
|
||||
|
||||
$nexY = $pdf->GetY();
|
||||
$pageposafter=$pdf->getPage();
|
||||
$pdf->setPage($pageposbefore);
|
||||
$pdf->setTopMargin($this->marge_haute);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
|
||||
// We suppose that a too long description is moved completely on next page
|
||||
if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
// VAT Rate
|
||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
||||
@@ -288,7 +348,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->SetXY($this->posxqty, $curY);
|
||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 3, $qty, 0, 'R'); // Enough for 6 chars
|
||||
|
||||
// Discount
|
||||
// Discount on line
|
||||
if ($object->lines[$i]->remise_percent)
|
||||
{
|
||||
$pdf->SetXY($this->posxdiscount-2, $curY);
|
||||
@@ -315,78 +375,71 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$localtax2rate=(string) $object->lines[$i]->localtax2_tx;
|
||||
|
||||
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
|
||||
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
|
||||
if (! isset($this->localtax1[$localtax1rate])) $this->localtax1[$localtax1rate]='';
|
||||
if (! isset($this->localtax2[$localtax2rate])) $this->localtax2[$localtax2rate]='';
|
||||
$this->tva[$vatrate] += $tvaligne;
|
||||
$this->localtax1[$localtax1rate]+=$localtax1ligne;
|
||||
$this->localtax2[$localtax2rate]+=$localtax2ligne;
|
||||
|
||||
// Add line
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
{
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
}
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Cherche nombre de lignes a venir pour savoir si place suffisante
|
||||
if ($i < ($nblignes - 1) && empty($hidedesc)) // If it's not last line
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
//on recupere la description du produit suivant
|
||||
$follow_descproduitservice = $object->lines[$i+1]->desc;
|
||||
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
|
||||
$nblineFollowDesc = dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4;
|
||||
// Et si on affiche dates de validite, on ajoute encore une ligne
|
||||
if ($object->lines[$i]->date_start && $object->lines[$i]->date_end)
|
||||
$pdf->setPage($pagenb);
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$nblineFollowDesc += 4;
|
||||
}
|
||||
}
|
||||
else // If it's last line
|
||||
{
|
||||
$nblineFollowDesc = 0;
|
||||
}
|
||||
|
||||
// Test if a new page is required
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$tab_top_in_current_page=$tab_top;
|
||||
$tab_height_in_current_page=$tab_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
$tab_top_in_current_page=$tab_top_newpage;
|
||||
$tab_height_in_current_page=$tab_height_newpage;
|
||||
}
|
||||
if ((($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblignes - 1)) || (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak))
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height + 40, $nexY, $outputlangs);
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
|
||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||
|
||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
|
||||
}
|
||||
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
$this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$nexY = $tab_top_newpage + 7;
|
||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Show square
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
|
||||
$bottomlasttab=$tab_top + $tab_height + 1;
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
|
||||
$bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1;
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||
}
|
||||
|
||||
// Affiche zone infos
|
||||
@@ -412,7 +465,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
// Add pdfgeneration hook
|
||||
if (! is_object($hookmanager))
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager=new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('pdfgeneration'));
|
||||
@@ -456,14 +509,18 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$tab3_top = $posy + 8;
|
||||
$tab3_width = 80;
|
||||
$tab3_height = 4;
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
$tab3_posx -= 20;
|
||||
}
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY($tab3_posx, $tab3_top - 5);
|
||||
$pdf->MultiCell(60, 5, $outputlangs->transnoentities("PaymentsAlreadyDone"), 0, 'L', 0);
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
$pdf->SetXY($tab3_posx, $tab3_top - 4);
|
||||
$pdf->MultiCell(60, 3, $outputlangs->transnoentities("PaymentsAlreadyDone"), 0, 'L', 0);
|
||||
|
||||
$pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height);
|
||||
$pdf->line($tab3_posx, $tab3_top, $tab3_posx+$tab3_width, $tab3_top);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 4);
|
||||
$pdf->SetXY($tab3_posx, $tab3_top);
|
||||
@@ -475,6 +532,8 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->SetXY($tab3_posx+58, $tab3_top);
|
||||
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0);
|
||||
|
||||
$pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height);
|
||||
|
||||
$y=0;
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 4);
|
||||
@@ -544,7 +603,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->SetXY($tab3_posx+21, $tab3_top+$y);
|
||||
$pdf->MultiCell(20, 3, price($row->amount), 0, 'L', 0);
|
||||
$pdf->SetXY($tab3_posx+40, $tab3_top+$y);
|
||||
$oper = $outputlangs->getTradFromKey("PaymentTypeShort" . $row->code);
|
||||
$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code);
|
||||
|
||||
$pdf->MultiCell(20, 3, $oper, 0, 'L', 0);
|
||||
$pdf->SetXY($tab3_posx+58, $tab3_top+$y);
|
||||
@@ -592,6 +651,8 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$posy=$pdf->GetY()+4;
|
||||
}
|
||||
|
||||
$posxval=52;
|
||||
|
||||
// Show payments conditions
|
||||
if ($object->type != 2 && ($object->cond_reglement_code || $object->cond_reglement))
|
||||
{
|
||||
@@ -601,7 +662,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->MultiCell(80, 4, $titre, 0, 'L');
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY(52, $posy);
|
||||
$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');
|
||||
@@ -619,7 +680,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetTextColor(200,0,0);
|
||||
$pdf->SetFont('','B', $default_font_size - 2);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"),0,'L',0);
|
||||
$pdf->MultiCell(80, 3, $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"),0,'L',0);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$posy=$pdf->GetY()+1;
|
||||
@@ -636,7 +697,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->MultiCell(80, 5, $titre, 0, 'L');
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY(50, $posy);
|
||||
$pdf->SetXY($posxval, $posy);
|
||||
$lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
|
||||
$pdf->MultiCell(80, 5, $lib_mode_reg,0,'L');
|
||||
|
||||
@@ -647,7 +708,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
||||
{
|
||||
// Si mode reglement non force ou si force a CHQ
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER)
|
||||
if (! empty($conf->global->FACTURE_CHQ_NUMBER))
|
||||
{
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER > 0)
|
||||
{
|
||||
@@ -656,25 +717,31 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('','B', $default_font_size - 3);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio).':',0,'L',0);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio),0,'L',0);
|
||||
$posy=$pdf->GetY()+1;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0);
|
||||
$posy=$pdf->GetY()+2;
|
||||
if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
|
||||
{
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0);
|
||||
$posy=$pdf->GetY()+2;
|
||||
}
|
||||
}
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER == -1)
|
||||
{
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('','B', $default_font_size - 3);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedToShort').' '.$outputlangs->convToOutputCharset($this->emetteur->name).' '.$outputlangs->transnoentities('SendTo').':',0,'L',0);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$this->emetteur->name),0,'L',0);
|
||||
$posy=$pdf->GetY()+1;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0);
|
||||
$posy=$pdf->GetY()+2;
|
||||
if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
|
||||
{
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0);
|
||||
$posy=$pdf->GetY()+2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -725,7 +792,12 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
// Tableau total
|
||||
$col1x = 120; $col2x = 170; $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
|
||||
$col1x = 120; $col2x = 170;
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
$col2x-=20;
|
||||
}
|
||||
$largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
|
||||
|
||||
$useborder=0;
|
||||
$index = 0;
|
||||
@@ -735,7 +807,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->SetXY($col1x, $tab2_top + 0);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + 0);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($object->total_ht + $object->remise)), 0, 'R', 1);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($object->total_ht + (! empty($object->remise)?$object->remise:0))), 0, 'R', 1);
|
||||
|
||||
// Show VAT by rates and total
|
||||
$pdf->SetFillColor(248,248,248);
|
||||
@@ -743,129 +815,135 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$this->atleastoneratenotnull=0;
|
||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
||||
{
|
||||
foreach( $this->tva as $tvakey => $tvaval )
|
||||
$tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false);
|
||||
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull)
|
||||
{
|
||||
if ($tvakey > 0) // On affiche pas taux 0
|
||||
{
|
||||
$this->atleastoneratenotnull++;
|
||||
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$tvacompl='';
|
||||
if (preg_match('/\*/',$tvakey))
|
||||
{
|
||||
$tvakey=str_replace('*','',$tvakey);
|
||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||
}
|
||||
$totalvat =$outputlangs->transnoentities("TotalVAT").' ';
|
||||
$totalvat.=vatrate($tvakey,1).$tvacompl;
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $tvaval), 0, 'R', 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (! $this->atleastoneratenotnull) // If no vat at all
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_tva), 0, 'R', 1);
|
||||
|
||||
// Total LocalTax1
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on' && $object->total_localtax1>0)
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code), $useborder, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_localtax1), $useborder, 'R', 1);
|
||||
}
|
||||
|
||||
// Total LocalTax2
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on' && $object->total_localtax2>0)
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code), $useborder, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_localtax2), $useborder, 'R', 1);
|
||||
}
|
||||
// Nothing to do
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
foreach($this->tva as $tvakey => $tvaval)
|
||||
{
|
||||
//Local tax 1
|
||||
foreach( $this->localtax1 as $tvakey => $tvaval )
|
||||
if ($tvakey > 0) // On affiche pas taux 0
|
||||
{
|
||||
if ($tvakey>0) // On affiche pas taux 0
|
||||
$this->atleastoneratenotnull++;
|
||||
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$tvacompl='';
|
||||
if (preg_match('/\*/',$tvakey))
|
||||
{
|
||||
//$this->atleastoneratenotnull++;
|
||||
$tvakey=str_replace('*','',$tvakey);
|
||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||
}
|
||||
$totalvat =$outputlangs->transnoentities("TotalVAT").' ';
|
||||
$totalvat.=vatrate($tvakey,1).$tvacompl;
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $tvaval), 0, 'R', 1);
|
||||
}
|
||||
}
|
||||
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
if (! $this->atleastoneratenotnull) // If no vat at all
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_tva), 0, 'R', 1);
|
||||
|
||||
$tvacompl='';
|
||||
if (preg_match('/\*/',$tvakey))
|
||||
// Total LocalTax1
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on' && $object->total_localtax1>0)
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->country_code), $useborder, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_localtax1), $useborder, 'R', 1);
|
||||
}
|
||||
|
||||
// Total LocalTax2
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on' && $object->total_localtax2>0)
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->country_code), $useborder, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_localtax2), $useborder, 'R', 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
{
|
||||
//Local tax 1
|
||||
foreach($this->localtax1 as $tvakey => $tvaval)
|
||||
{
|
||||
if ($tvakey!=0) // On affiche pas taux 0
|
||||
{
|
||||
$tvakey=str_replace('*','',$tvakey);
|
||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||
}
|
||||
$totalvat =$outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' ';
|
||||
$totalvat.=vatrate($tvakey,1).$tvacompl;
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
//$this->atleastoneratenotnull++;
|
||||
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $tvaval), 0, 'R', 1);
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
|
||||
$tvacompl='';
|
||||
if (preg_match('/\*/',$tvakey))
|
||||
{
|
||||
$tvakey=str_replace('*','',$tvakey);
|
||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||
}
|
||||
$totalvat =$outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' ';
|
||||
$totalvat.=vatrate($tvakey,1).$tvacompl;
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $tvaval), 0, 'R', 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
||||
{
|
||||
//Local tax 2
|
||||
foreach($this->localtax2 as $tvakey => $tvaval)
|
||||
{
|
||||
if ($tvakey!=0) // On affiche pas taux 0
|
||||
{
|
||||
//$this->atleastoneratenotnull++;
|
||||
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
|
||||
$tvacompl='';
|
||||
if (preg_match('/\*/',$tvakey))
|
||||
{
|
||||
$tvakey=str_replace('*','',$tvakey);
|
||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||
}
|
||||
$totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' ';
|
||||
$totalvat.=vatrate($tvakey,1).$tvacompl;
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $tvaval), 0, 'R', 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
||||
{
|
||||
//Local tax 2
|
||||
foreach( $this->localtax2 as $tvakey => $tvaval )
|
||||
{
|
||||
if ($tvakey>0) // On affiche pas taux 0
|
||||
{
|
||||
//$this->atleastoneratenotnull++;
|
||||
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
|
||||
$tvacompl='';
|
||||
if (preg_match('/\*/',$tvakey))
|
||||
{
|
||||
$tvakey=str_replace('*','',$tvakey);
|
||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||
}
|
||||
$totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' ';
|
||||
$totalvat.=vatrate($tvakey,1).$tvacompl;
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $tvaval), 0, 'R', 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Total TTC
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
$text=$outputlangs->transnoentities("TotalTTC");
|
||||
if ($object->type == 2) $text=$outputlangs->transnoentities("TotalTTCToYourCredit");
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $text, $useborder, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_ttc), $useborder, 'R', 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Total TTC
|
||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
$text=$outputlangs->transnoentities("TotalTTC");
|
||||
if ($object->type == 2) $text=$outputlangs->transnoentities("TotalTTCToYourCredit");
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $text, $useborder, 'L', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_ttc), $useborder, 'R', 1);
|
||||
}
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$creditnoteamount=$object->getSumCreditNotesUsed();
|
||||
@@ -930,64 +1008,89 @@ class pdf_crabe extends ModelePDFFactures
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param int $nexY Y (not used)
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
|
||||
* @param int $hidebottom Hide bottom bar of array
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// Force to disable hidetop and hidebottom
|
||||
$hidebottom=0;
|
||||
if ($hidetop) $hidetop=-1;
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
// Amount in (at tab_top - 1)
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||
}
|
||||
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
|
||||
// Rect prend une longueur en 3eme param et 4eme param
|
||||
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height);
|
||||
// line prend une position y en 2eme param et 4eme param
|
||||
$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
$pdf->SetXY($this->posxdesc-1, $tab_top+1);
|
||||
$pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L');
|
||||
// Output Rect
|
||||
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
|
||||
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param
|
||||
|
||||
$pdf->SetXY($this->posxdesc-1, $tab_top+1);
|
||||
$pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L');
|
||||
}
|
||||
|
||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
||||
{
|
||||
$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height);
|
||||
$pdf->SetXY($this->posxtva-3, $tab_top+1);
|
||||
$pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C');
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->posxtva-3, $tab_top+1);
|
||||
$pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C');
|
||||
}
|
||||
}
|
||||
|
||||
$pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height);
|
||||
$pdf->SetXY($this->posxup-1, $tab_top+1);
|
||||
$pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C');
|
||||
|
||||
$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
|
||||
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
|
||||
|
||||
$pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height);
|
||||
if ($this->atleastonediscount)
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->posxdiscount-1, $tab_top+1);
|
||||
$pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C');
|
||||
$pdf->SetXY($this->posxup-1, $tab_top+1);
|
||||
$pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C');
|
||||
}
|
||||
|
||||
$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
|
||||
}
|
||||
|
||||
$pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height);
|
||||
if (empty($hidetop))
|
||||
{
|
||||
if ($this->atleastonediscount)
|
||||
{
|
||||
$pdf->SetXY($this->posxdiscount-1, $tab_top+1);
|
||||
$pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C');
|
||||
}
|
||||
}
|
||||
if ($this->atleastonediscount)
|
||||
{
|
||||
$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
|
||||
}
|
||||
$pdf->SetXY($this->postotalht-1, $tab_top+1);
|
||||
$pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHT"),'','C');
|
||||
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->postotalht-1, $tab_top+1);
|
||||
$pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHT"),'','C');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1013,7 +1116,8 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
|
||||
|
||||
if($object->statut==0 && (! empty($conf->global->FACTURE_DRAFT_WATERMARK)) )
|
||||
// Show Draft Watermark
|
||||
if($object->statut==0 && (! empty($conf->global->FACTURE_DRAFT_WATERMARK)) )
|
||||
{
|
||||
pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->FACTURE_DRAFT_WATERMARK);
|
||||
}
|
||||
@@ -1067,7 +1171,15 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R');
|
||||
|
||||
$posy+=1;
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
|
||||
if ($object->ref_client)
|
||||
{
|
||||
$posy+=4;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R');
|
||||
}
|
||||
|
||||
$objectidnext=$object->getIdReplacingInvoice('validated');
|
||||
if ($object->type == 0 && $objectidnext)
|
||||
@@ -1075,7 +1187,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$objectreplacing=new Facture($this->db);
|
||||
$objectreplacing->fetch($objectidnext);
|
||||
|
||||
$posy+=4;
|
||||
$posy+=3;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ReplacementByInvoice").' : '.$outputlangs->convToOutputCharset($objectreplacing->ref), '', 'R');
|
||||
@@ -1095,7 +1207,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$objectreplaced=new Facture($this->db);
|
||||
$objectreplaced->fetch($object->fk_facture_source);
|
||||
|
||||
$posy+=4;
|
||||
$posy+=3;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CorrectionInvoice").' : '.$outputlangs->convToOutputCharset($objectreplaced->ref), '', 'R');
|
||||
@@ -1108,7 +1220,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
if ($object->type != 2)
|
||||
{
|
||||
$posy+=4;
|
||||
$posy+=3;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEcheance")." : " . dol_print_date($object->date_lim_reglement,"day",false,$outputlangs,true), '', 'R');
|
||||
@@ -1116,13 +1228,13 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
if ($object->client->code_client)
|
||||
{
|
||||
$posy+=4;
|
||||
$posy+=3;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R');
|
||||
}
|
||||
|
||||
$posy+=2;
|
||||
$posy+=1;
|
||||
|
||||
// Show list of linked objects
|
||||
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size, $hookmanager);
|
||||
@@ -1173,7 +1285,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname;
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->nom;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
@@ -1182,29 +1294,31 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
|
||||
}
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target');
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
|
||||
|
||||
// Show recipient
|
||||
$widthrecbox=100;
|
||||
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
|
||||
$posy=42;
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
$posx=$this->page_largeur-$this->marge_droite-$widthrecbox;
|
||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||
|
||||
// Show recipient frame
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY($posx+2,$posy-5);
|
||||
$pdf->MultiCell(80,5, $outputlangs->transnoentities("BillTo").":",0,'L');
|
||||
$pdf->Rect($posx, $posy, 100, $hautcadre);
|
||||
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L');
|
||||
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
|
||||
|
||||
// Show recipient name
|
||||
$pdf->SetXY($posx+2,$posy+3);
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$pdf->MultiCell(96,4, $carac_client_name, 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||
|
||||
// Show recipient information
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
|
||||
$pdf->MultiCell(86,4, $carac_client, 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1214,11 +1328,12 @@ class pdf_crabe extends ModelePDFFactures
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
* @param int $hidefreetext 1=Hide free text
|
||||
* @return int Return height of bottom margin including footer text
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
|
||||
{
|
||||
return pdf_pagefoot($pdf,$outputlangs,'FACTURE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object);
|
||||
return pdf_pagefoot($pdf,$outputlangs,'FACTURE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -434,7 +434,7 @@ class pdf_oursin extends ModelePDFFactures
|
||||
$pdf->SetXY($tab3_posx+21, $tab3_top+$y);
|
||||
$pdf->MultiCell(20, 3, price($row->amount), 0, 'L', 0);
|
||||
$pdf->SetXY($tab3_posx+40, $tab3_top+$y);
|
||||
$oper = $outputlangs->getTradFromKey("PaymentTypeShort" . $row->code);
|
||||
$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code);
|
||||
|
||||
$pdf->MultiCell(20, 3, $oper, 0, 'L', 0);
|
||||
$pdf->SetXY($tab3_posx+58, $tab3_top+$y);
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
* \ingroup ficheinter
|
||||
* \brief Fichier de la classe permettant de generer les fiches d'intervention au modele Soleil
|
||||
*/
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/modules/fichinter/modules_fichinter.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/fichinter/modules_fichinter.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
@@ -84,25 +84,29 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
$this->option_multilang = 0; // Dispo en plusieurs langues
|
||||
$this->option_draft_watermark = 1; //Support add of a watermark on drafts
|
||||
|
||||
// Recupere emmetteur
|
||||
// Get source company
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // By default, if not defined
|
||||
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if not defined
|
||||
|
||||
// Defini position des colonnes
|
||||
// Define position of columns
|
||||
$this->posxdesc=$this->marge_gauche+1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to build pdf onto disk
|
||||
*
|
||||
* @param object $object Object to generate
|
||||
* @param int $object Id of object to generate
|
||||
* @param object $outputlangs Lang output object
|
||||
* @return int 1=ok, 0=ko
|
||||
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||
* @param int $hidedetails Do not show line details
|
||||
* @param int $hidedesc Do not show desc
|
||||
* @param int $hideref Do not show ref
|
||||
* @param object $hookmanager Hookmanager object
|
||||
* @return int 1=OK, 0=KO
|
||||
*/
|
||||
function write_file($object,$outputlangs)
|
||||
function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
|
||||
{
|
||||
global $user,$langs,$conf,$mysoc;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
@@ -134,6 +138,11 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:25); // Height reserved to output the free text on last page
|
||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
@@ -157,34 +166,30 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
|
||||
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
|
||||
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("InterventionCard"));
|
||||
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
|
||||
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
|
||||
|
||||
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
$this->_pagehead($pdf, $object, 1, $outputlangs);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$this->_pagehead($pdf, $object, 1, $outputlangs, $hookmanager);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$tab_top = 100;
|
||||
$tab_top_middlepage = 50;
|
||||
$tab_top_newpage = 50;
|
||||
$tab_height = 120;
|
||||
$tab_top = 90;
|
||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||
$tab_height = 130;
|
||||
$tab_height_newpage = 150;
|
||||
$tab_height_middlepage = 200;
|
||||
$tab_height_endpage = 170;
|
||||
|
||||
// Affiche notes
|
||||
if (! empty($object->note_public))
|
||||
{
|
||||
$tab_top = 88;
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
|
||||
$nexY = $pdf->GetY();
|
||||
$height_note=$nexY-$tab_top;
|
||||
@@ -240,81 +245,64 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
if ($valide > 0 || $object->specimen)
|
||||
{
|
||||
$curY = $nexY;
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$pdf->SetFont('','B', $default_font_size - 1);
|
||||
$pdf->SetXY($this->marge_gauche, $curY);
|
||||
$txt=dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration),1,$outputlangs->charset_output);
|
||||
$pdf->setTopMargin($tab_top_newpage);
|
||||
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||
$pageposbefore=$pdf->getPage();
|
||||
|
||||
$curYold=$nexYold=$nexY;
|
||||
$pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY, $txt, 0, 1, 0);
|
||||
$curY = $pdf->GetY();
|
||||
$nexY+=3;
|
||||
// Description of product line
|
||||
$txt='<strong>'.dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration),1,$outputlangs->charset_output).'</strong>';
|
||||
$desc=dol_htmlentitiesbr($objectligne->desc,1);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txt,$desc), 0, 1, 0);
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $nexY);
|
||||
$desc = dol_htmlentitiesbr($objectligne->desc,1);
|
||||
$nexY = $pdf->GetY();
|
||||
$pageposafter=$pdf->getPage();
|
||||
$pdf->setPage($pageposbefore);
|
||||
$pdf->setTopMargin($this->marge_haute);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
|
||||
$curYold = $pdf->GetY();
|
||||
$nexYold = $curYold;
|
||||
|
||||
$pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY, $desc, 0, 1, 0);
|
||||
|
||||
$stringheight=$pdf->getStringHeight('A', $txt);
|
||||
$curY = $pdf->GetY();
|
||||
|
||||
$nexY+=(dol_nboflines_bis($objectligne->desc,0,$outputlangs->charset_output)*$stringheight);
|
||||
//print $curYold."-".$nexYold." +".dol_nboflines_bis($objectligne->desc,52,$outputlangs->charset_output)."*".$stringheight."= ".$curY."-".$nexY."<br>";
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Cherche nombre de lignes a venir pour savoir si place suffisante
|
||||
if ($i < ($nblines - 1) && empty($hidedesc)) // If it's not last line
|
||||
{
|
||||
//on recupere la description du produit suivant
|
||||
$follow_descproduitservice = $objectligne->desc;
|
||||
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
|
||||
$nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*3);
|
||||
}
|
||||
else // If it's last line
|
||||
{
|
||||
$nblineFollowDesc = 0;
|
||||
// We suppose that a too long description is moved completely on next page
|
||||
if ($pageposafter > $pageposbefore) {
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
|
||||
// Test if a new page is required
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$tab_top_in_current_page=$tab_top;
|
||||
$tab_height_in_current_page=$tab_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
$tab_top_in_current_page=$tab_top_newpage;
|
||||
$tab_height_in_current_page=$tab_height_middlepage;
|
||||
}
|
||||
if (($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblines - 1))
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
$pdf->setPage($pagenb);
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $tab_height_middlepage, $nexY, $outputlangs);
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
|
||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||
|
||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
}
|
||||
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
$this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$nexY = $tab_top_newpage + 7;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -322,17 +310,15 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
// Show square
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
|
||||
$bottomlasttab=$tab_top + $tab_height + 1;
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfooter + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
|
||||
$bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1;
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfooter + 1;
|
||||
}
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||
$pdf->AliasNbPages();
|
||||
|
||||
@@ -367,11 +353,18 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @param int $hidetop Hide top bar of array
|
||||
* @param int $hidebottom Hide bottom bar of array
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// Force to disable hidetop and hidebottom
|
||||
$hidebottom=0;
|
||||
if ($hidetop) $hidetop=-1;
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
/*
|
||||
$pdf->SetXY($this->marge_gauche, $tab_top);
|
||||
@@ -398,21 +391,24 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3. Then writeMultiCell must use 3 also.
|
||||
*/
|
||||
$pdf->Rect($this->marge_gauche, $tab_top, ($this->page_largeur-$this->marge_gauche-$this->marge_droite), $tab_height+3);
|
||||
$pdf->SetXY($this->marge_gauche, $pdf->GetY() + 20);
|
||||
$pdf->MultiCell(60, 5, '', 0, 'J', 0);
|
||||
|
||||
$pdf->SetXY(20,230);
|
||||
$pdf->MultiCell(66,5, $outputlangs->transnoentities("NameAndSignatureOfInternalContact"),0,'L',0);
|
||||
// Output Rect
|
||||
$this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height+3, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
|
||||
|
||||
$pdf->SetXY(20,235);
|
||||
$pdf->MultiCell(80,30, '', 1);
|
||||
if (empty($hidebottom))
|
||||
{
|
||||
$pdf->SetXY(20,230);
|
||||
$pdf->MultiCell(66,5, $outputlangs->transnoentities("NameAndSignatureOfInternalContact"),0,'L',0);
|
||||
|
||||
$pdf->SetXY(110,230);
|
||||
$pdf->MultiCell(80,5, $outputlangs->transnoentities("NameAndSignatureOfExternalContact"),0,'L',0);
|
||||
$pdf->SetXY(20,235);
|
||||
$pdf->MultiCell(80,25, '', 1);
|
||||
|
||||
$pdf->SetXY(110,235);
|
||||
$pdf->MultiCell(80,30, '', 1);
|
||||
$pdf->SetXY(110,230);
|
||||
$pdf->MultiCell(80,5, $outputlangs->transnoentities("NameAndSignatureOfExternalContact"),0,'L',0);
|
||||
|
||||
$pdf->SetXY(110,235);
|
||||
$pdf->MultiCell(80,25, '', 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -556,7 +552,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname;
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->nom;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
@@ -565,29 +561,31 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
|
||||
}
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target');
|
||||
$carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->client, (isset($object->contact)?$object->contact:''), $usecontact, 'target');
|
||||
|
||||
// Show recipient
|
||||
$widthrecbox=100;
|
||||
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
|
||||
$posy=42;
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
$posx=$this->page_largeur-$this->marge_droite-$widthrecbox;
|
||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||
|
||||
// Show recipient frame
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY($posx,$posy-5);
|
||||
$pdf->Rect($posx, $posy, 100, $hautcadre);
|
||||
$pdf->SetXY($posx+2,$posy-5);
|
||||
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
// Show recipient name
|
||||
$pdf->SetXY($posx+2,$posy+3);
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$pdf->MultiCell(100,4, $carac_client_name, 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||
|
||||
// Show recipient information
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
|
||||
$pdf->MultiCell(100,4, $carac_client, 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -597,11 +595,12 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param int $hidefreetext 1=Hide free text
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
|
||||
{
|
||||
return pdf_pagefoot($pdf,$outputlangs,'FICHINTER_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object);
|
||||
return pdf_pagefoot($pdf,$outputlangs,'FICHINTER_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -464,11 +464,12 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param int $hidefreetext 1=Hide free text
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
|
||||
{
|
||||
return pdf_pagefoot($pdf,$outputlangs,'DELIVERY_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object);
|
||||
return pdf_pagefoot($pdf,$outputlangs,'DELIVERY_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* Copyright (C) 2008 Chiptronik
|
||||
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -26,17 +27,15 @@
|
||||
* \author Laurent Destailleur
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/modules/livraison/modules_livraison.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/livraison/class/livraison.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
* \class pdf_typhon
|
||||
* \brief Classe permettant de generer les bons de livraison au modele Typho
|
||||
* Classe permettant de generer les bons de livraison au modele Typho
|
||||
*/
|
||||
|
||||
class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
{
|
||||
var $emetteur; // Objet societe qui emet
|
||||
@@ -65,10 +64,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
$this->marge_haute=10;
|
||||
$this->marge_basse=10;
|
||||
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||
|
||||
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
|
||||
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||
@@ -88,6 +87,15 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
$this->posxqty=168;
|
||||
$this->posxdiscount=162;
|
||||
$this->postotalht=177;
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
$this->posxcomm-=20;
|
||||
//$this->posxtva-=20;
|
||||
$this->posxup-=20;
|
||||
$this->posxqty-=20;
|
||||
$this->posxdiscount-=20;
|
||||
$this->postotalht-=20;
|
||||
}
|
||||
|
||||
$this->tva=array();
|
||||
$this->atleastoneratenotnull=0;
|
||||
@@ -105,7 +113,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
function write_file($object,$outputlangs)
|
||||
{
|
||||
global $user,$langs,$conf;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
@@ -142,6 +149,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
@@ -177,10 +189,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
|
||||
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
|
||||
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("DeliveryOrder"));
|
||||
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
|
||||
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
|
||||
|
||||
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
/*
|
||||
// Positionne $this->atleastonediscount si on a au moins une remise
|
||||
@@ -203,8 +214,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$tab_top = 90;
|
||||
$tab_top_newpage = 50;
|
||||
$tab_height = 110;
|
||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||
$tab_height = 130;
|
||||
$tab_height_newpage = 150;
|
||||
|
||||
// Affiche notes
|
||||
@@ -233,20 +244,35 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
$curY = $tab_top + 7;
|
||||
$nexY = $tab_top + 7;
|
||||
|
||||
// Boucle sur les lignes
|
||||
// Loop on each lines
|
||||
for ($i = 0 ; $i < $nblines ; $i++)
|
||||
{
|
||||
$curY = $nexY;
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
||||
$pdf->setTopMargin($tab_top_newpage);
|
||||
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||
$pageposbefore=$pdf->getPage();
|
||||
|
||||
// Description de la ligne produit
|
||||
//$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs);
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,108,3,$this->posxdesc-1,$curY);
|
||||
//$pdf->writeHTMLCell(108, 3, $this->posxdesc-1, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
// Description of product line
|
||||
$curX = $this->posxdesc-1;
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,108,3,$curX,$curY);
|
||||
|
||||
$nexY = $pdf->GetY();
|
||||
$pageposafter=$pdf->getPage();
|
||||
$pdf->setPage($pageposbefore);
|
||||
$pdf->setTopMargin($this->marge_haute);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
|
||||
// We suppose that a too long description is moved completely on next page
|
||||
if ($pageposafter > $pageposbefore) {
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
$nexY = $pdf->GetY()+4;
|
||||
|
||||
/*
|
||||
// TVA
|
||||
@@ -281,68 +307,53 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
*/
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Cherche nombre de lignes a venir pour savoir si place suffisante
|
||||
if ($i < ($nblines - 1) && empty($hidedesc)) // If it's not last line
|
||||
{
|
||||
//on recupere la description du produit suivant
|
||||
$follow_descproduitservice = $object->lines[$i+1]->desc;
|
||||
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
|
||||
$nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4);
|
||||
}
|
||||
else // If it's last line
|
||||
{
|
||||
$nblineFollowDesc = 0;
|
||||
}
|
||||
|
||||
// Test if a new page is required
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$tab_top_in_current_page=$tab_top;
|
||||
$tab_height_in_current_page=$tab_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
$tab_top_in_current_page=$tab_top_newpage;
|
||||
$tab_height_in_current_page=$tab_height_newpage;
|
||||
}
|
||||
if (($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblines - 1))
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
$pdf->setPage($pagenb);
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
|
||||
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||
|
||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
}
|
||||
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
$this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$nexY = $tab_top_newpage + 7;
|
||||
}
|
||||
}
|
||||
|
||||
// Show square
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
|
||||
$bottomlasttab=$tab_top + $tab_height + 1;
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
|
||||
$bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1;
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Pied de page
|
||||
*/
|
||||
@@ -384,7 +395,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
|
||||
if ($pdf->GetY() > 250)
|
||||
{
|
||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||
|
||||
$pdf->AddPage('P', 'A4');
|
||||
|
||||
@@ -415,7 +426,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
if (! empty($conf->global->MAIN_UMASK))
|
||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||
|
||||
return 1; // Pas d'erreur
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -437,9 +448,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @param int $hidetop Hide top bar of array
|
||||
* @param int $hidebottom Hide bottom bar of array
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
|
||||
{
|
||||
global $conf,$mysoc;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
@@ -624,9 +637,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
$pdf->SetXY(102,$posy-5);
|
||||
$pdf->MultiCell(80,5, $outputlangs->transnoentities("DeliveryAddress").":", 0, 'L');
|
||||
|
||||
// Cadre client destinataire
|
||||
$pdf->Rect(100, $posy, 100, $hautcadre);
|
||||
|
||||
// If SHIPPING contact defined on invoice, we use it
|
||||
$usecontact=false;
|
||||
$arrayidcontact=$object->commande->getIdContact('external','SHIPPING');
|
||||
@@ -640,7 +650,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname;
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->nom;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
@@ -651,14 +661,29 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target');
|
||||
|
||||
// Show customer/recipient
|
||||
$pdf->SetXY(102,$posy+3);
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$pdf->MultiCell(106,4, $carac_client_name, 0, 'L');
|
||||
// Show recipient
|
||||
$widthrecbox=100;
|
||||
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
|
||||
$posy=42;
|
||||
$posx=$this->page_largeur-$this->marge_droite-$widthrecbox;
|
||||
//if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||
|
||||
// Show recipient frame
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY($posx+2,$posy-5);
|
||||
//$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L');
|
||||
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
|
||||
|
||||
// Show recipient name
|
||||
$pdf->SetXY($posx+2,$posy+3);
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||
|
||||
// Show recipient information
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetXY(102,$posy+8);
|
||||
$pdf->MultiCell(86,4, $carac_client, 0, 'L');
|
||||
$pdf->SetXY($posx+2,$posy+8);
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -669,11 +694,12 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param int $hidefreetext 1=Hide free text
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
|
||||
{
|
||||
return pdf_pagefoot($pdf,$outputlangs,'DELIVERY_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object);
|
||||
return pdf_pagefoot($pdf,$outputlangs,'DELIVERY_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -61,9 +61,8 @@ class mailing_framboise extends MailingTargets
|
||||
|
||||
$cibles = array();
|
||||
|
||||
// CHANGE THIS
|
||||
// Select the members from category
|
||||
$sql = "SELECT a.rowid as id, a.email as email, a.nom as name, null as fk_contact, null as firstname,";
|
||||
$sql = "SELECT a.rowid as id, a.email as email, a.nom as name, null as fk_contact, a.prenom as firstname,";
|
||||
if ($_POST['filter']) $sql.= " c.label";
|
||||
else $sql.=" null as label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
* \author Regis Houssin
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/modules/project/modules_project.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/projet/class/task.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
@@ -62,10 +62,10 @@ class pdf_baleine extends ModelePDFProjects
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
$this->marge_haute=10;
|
||||
$this->marge_basse=10;
|
||||
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||
|
||||
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
|
||||
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||
@@ -108,8 +108,6 @@ class pdf_baleine extends ModelePDFProjects
|
||||
{
|
||||
$nblignes = count($object->lines);
|
||||
|
||||
$default_font_size = pdf_getPDFFontsize($outputlangs);
|
||||
|
||||
$objectref = dol_sanitizeFileName($object->ref);
|
||||
$dir = $conf->projet->dir_output;
|
||||
if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
|
||||
@@ -127,6 +125,11 @@ class pdf_baleine extends ModelePDFProjects
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
@@ -151,10 +154,9 @@ class pdf_baleine extends ModelePDFProjects
|
||||
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
|
||||
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
|
||||
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Project"));
|
||||
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
|
||||
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
|
||||
|
||||
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
@@ -225,43 +227,52 @@ class pdf_baleine extends ModelePDFProjects
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Cherche nombre de lignes a venir pour savoir si place suffisante
|
||||
if ($i < ($nblignes - 1) && empty($hidedesc)) // If it's not last line
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
//on recupere la description du produit suivant
|
||||
$follow_descproduitservice = $object->lines[$i+1]->desc;
|
||||
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
|
||||
$nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4);
|
||||
$pdf->setPage($pagenb);
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
}
|
||||
else // If it's last line
|
||||
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
|
||||
{
|
||||
$nblineFollowDesc = 0;
|
||||
}
|
||||
|
||||
if (($nexY+$nblineFollowDesc) > ($tab_top+$tab_height) && $i < ($nblignes - 1))
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
|
||||
|
||||
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
$this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$tab_top=$tab_top_newpage;
|
||||
$tab_height=$tab_height_newpage;
|
||||
|
||||
$nexY = $tab_top + 7;
|
||||
}
|
||||
}
|
||||
|
||||
// Show square
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
|
||||
$bottomlasttab=$tab_top + $tab_height + 1;
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Pied de page
|
||||
@@ -297,9 +308,11 @@ class pdf_baleine extends ModelePDFProjects
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @param int $hidetop Hide top bar of array
|
||||
* @param int $hidebottom Hide bottom bar of array
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
|
||||
{
|
||||
global $conf,$mysoc;
|
||||
|
||||
@@ -412,11 +425,12 @@ class pdf_baleine extends ModelePDFProjects
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param int $hidefreetext 1=Hide free text
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
|
||||
{
|
||||
return pdf_pagefoot($pdf,$outputlangs,'DELIVERY_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object);
|
||||
return pdf_pagefoot($pdf,$outputlangs,'PROJECT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,11 +23,11 @@
|
||||
* \brief Class file to generate the supplier invoices with the canelle model
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/modules/supplier_invoice/modules_facturefournisseur.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.facture.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
@@ -58,7 +58,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param Societe $object Third party providing invoice
|
||||
* @param Societe $object Supplier invoice
|
||||
*/
|
||||
function __construct($db,$object)
|
||||
{
|
||||
@@ -77,10 +77,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
$this->marge_haute=10;
|
||||
$this->marge_basse=10;
|
||||
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||
|
||||
$this->option_logo = 1; // Affiche logo
|
||||
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||
@@ -103,6 +103,14 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$this->posxqty=145;
|
||||
$this->posxdiscount=162;
|
||||
$this->postotalht=174;
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
$this->posxtva-=20;
|
||||
$this->posxup-=20;
|
||||
$this->posxqty-=20;
|
||||
$this->posxdiscount-=20;
|
||||
$this->postotalht-=20;
|
||||
}
|
||||
|
||||
$this->tva=array();
|
||||
$this->localtax1=array();
|
||||
@@ -113,13 +121,18 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
|
||||
|
||||
/**
|
||||
* Build document onto disk
|
||||
* Function to build pdf onto disk
|
||||
*
|
||||
* @param Object $object Object invoice to build (or id if old method)
|
||||
* @param Translate $outputlangs Lang object for output language
|
||||
* @return int 1=OK, 0=KO
|
||||
* @param int $object Id of object to generate
|
||||
* @param object $outputlangs Lang output object
|
||||
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||
* @param int $hidedetails Do not show line details
|
||||
* @param int $hidedesc Do not show desc
|
||||
* @param int $hideref Do not show ref
|
||||
* @param object $hookmanager Hookmanager object
|
||||
* @return int 1=OK, 0=KO
|
||||
*/
|
||||
function write_file($object,$outputlangs='')
|
||||
function write_file($object, $outputlangs='', $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0, $hookmanager=false)
|
||||
{
|
||||
global $user,$langs,$conf,$mysoc;
|
||||
|
||||
@@ -133,8 +146,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$outputlangs->load("bills");
|
||||
$outputlangs->load("products");
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
if ($conf->fournisseur->dir_output.'/facture')
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
@@ -143,7 +154,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
//$amount_credit_notes_included = $object->getSumCreditNotesUsed();
|
||||
//$amount_deposits_included = $object->getSumDepositsUsed();
|
||||
|
||||
// Definition de $dir et $file
|
||||
// Definition of $dir and $file
|
||||
if ($object->specimen)
|
||||
{
|
||||
$dir = $conf->fournisseur->facture->dir_output;
|
||||
@@ -160,7 +171,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
{
|
||||
if (dol_mkdir($dir) < 0)
|
||||
{
|
||||
$this->error=$langs->trans("ErrorCanNotCreateDir",$dir);
|
||||
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -171,6 +182,11 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$nblignes = count($object->lines);
|
||||
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
@@ -194,10 +210,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
|
||||
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
|
||||
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order"));
|
||||
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
|
||||
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
|
||||
|
||||
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
// Positionne $this->atleastonediscount si on a au moins une remise
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
@@ -212,14 +227,14 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
$this->_pagehead($pdf, $object, 1, $outputlangs);
|
||||
$this->_pagehead($pdf, $object, 1, $outputlangs, $hookmanager);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$tab_top = 90;
|
||||
$tab_top_newpage = 50;
|
||||
$tab_height = 110;
|
||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||
$tab_height = 130;
|
||||
$tab_height_newpage = 150;
|
||||
|
||||
// Affiche notes
|
||||
@@ -227,7 +242,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
{
|
||||
$tab_top = 88;
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
|
||||
$nexY = $pdf->GetY();
|
||||
$height_note=$nexY-$tab_top;
|
||||
@@ -248,25 +263,38 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$curY = $tab_top + 7;
|
||||
$nexY = $tab_top + 7;
|
||||
|
||||
// Boucle sur les lignes
|
||||
// Loop on each lines
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
{
|
||||
$curY = $nexY;
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
||||
$pdf->setTopMargin($tab_top_newpage);
|
||||
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||
$pageposbefore=$pdf->getPage();
|
||||
|
||||
// Description of product line
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||
$curX = $this->posxdesc-1;
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,0,0,1);
|
||||
// Description of product line
|
||||
$curX = $this->posxdesc-1;
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,1,$hookmanager);
|
||||
|
||||
$nexY = $pdf->GetY();
|
||||
$pageposafter=$pdf->getPage();
|
||||
$pdf->setPage($pageposbefore);
|
||||
$pdf->setTopMargin($this->marge_haute);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
|
||||
// We suppose that a too long description is moved completely on next page
|
||||
if ($pageposafter > $pageposbefore) {
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
// VAT rate
|
||||
// VAT Rate
|
||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
||||
{
|
||||
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs);
|
||||
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails, $hookmanager);
|
||||
$pdf->SetXY($this->posxtva, $curY);
|
||||
$pdf->MultiCell($this->posxup-$this->posxtva-1, 3, $vat_rate, 0, 'R');
|
||||
}
|
||||
@@ -308,74 +336,62 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$this->localtax1[$localtax1rate]+=$localtax1ligne;
|
||||
$this->localtax2[$localtax2rate]+=$localtax2ligne;
|
||||
|
||||
// Add line
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
{
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
}
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Cherche nombre de lignes a venir pour savoir si place suffisante
|
||||
if ($i < ($nblignes - 1) && empty($hidedesc)) // If it's not last line
|
||||
{
|
||||
//on recupere la description du produit suivant
|
||||
$follow_descproduitservice = $object->lines[$i+1]->desc;
|
||||
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
|
||||
$nblineFollowDesc = dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4;
|
||||
// Et si on affiche dates de validite, on ajoute encore une ligne
|
||||
if ($object->lines[$i]->date_start && $object->lines[$i]->date_end)
|
||||
{
|
||||
$nblineFollowDesc += 4;
|
||||
}
|
||||
}
|
||||
else // If it's last line
|
||||
{
|
||||
$nblineFollowDesc = 0;
|
||||
}
|
||||
|
||||
// Test if a new page is required
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$tab_top_in_current_page=$tab_top;
|
||||
$tab_height_in_current_page=$tab_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
$tab_top_in_current_page=$tab_top_newpage;
|
||||
$tab_height_in_current_page=$tab_height_newpage;
|
||||
}
|
||||
if (($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblignes - 1))
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
$pdf->setPage($pagenb);
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
|
||||
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||
|
||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
}
|
||||
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
$this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$nexY = $tab_top_newpage + 7;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Show square
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
|
||||
$bottomlasttab=$tab_top + $tab_height + 1;
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
|
||||
$bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1;
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||
}
|
||||
|
||||
// Affiche zone totaux
|
||||
@@ -397,10 +413,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
|
||||
$pdf->Output($file,'F');
|
||||
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
// Add pdfgeneration hook
|
||||
if (!is_object($hookmanager))
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager=new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('pdfgeneration'));
|
||||
@@ -441,6 +457,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
||||
{
|
||||
global $conf,$mysoc;
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
$tab2_top = $posy;
|
||||
@@ -455,7 +472,14 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
}
|
||||
|
||||
// Tableau total
|
||||
$col1x = 120; $col2x = 170; $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
|
||||
$col1x = 120; $col2x = 170;
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
$col2x-=20;
|
||||
}
|
||||
$largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
|
||||
|
||||
$index=0;
|
||||
|
||||
// Total HT
|
||||
$pdf->SetFillColor(255,255,255);
|
||||
@@ -464,10 +488,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$pdf->SetXY($col2x, $tab2_top + 0);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ht + $object->remise), 0, 'R', 1);
|
||||
|
||||
// Affichage des totaux de TVA par taux (conformement a reglementation)
|
||||
// Show VAT by rates and total
|
||||
$pdf->SetFillColor(248,248,248);
|
||||
|
||||
$index=0;
|
||||
foreach( $this->tva as $tvakey => $tvaval )
|
||||
{
|
||||
if ($tvakey > 0) // On affiche pas taux 0
|
||||
@@ -493,7 +516,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
|
||||
}
|
||||
}
|
||||
if (! $this->atleastoneratenotnull) // If not vat at all
|
||||
if (! $this->atleastoneratenotnull) // If no vat at all
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
@@ -523,9 +546,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
}
|
||||
else
|
||||
{
|
||||
//Local tax 1
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
{
|
||||
//Local tax 1
|
||||
foreach( $this->localtax1 as $tvakey => $tvaval )
|
||||
{
|
||||
if ($tvakey>0) // On affiche pas taux 0
|
||||
@@ -551,9 +574,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
}
|
||||
}
|
||||
|
||||
//Local tax 2
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
||||
{
|
||||
//Local tax 2
|
||||
foreach( $this->localtax2 as $tvakey => $tvaval )
|
||||
{
|
||||
if ($tvakey>0) // On affiche pas taux 0
|
||||
@@ -590,8 +613,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc), $useborder, 'R', 1);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
if ($deja_regle > 0)
|
||||
{
|
||||
@@ -605,7 +626,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
|
||||
$index++;
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
//$pdf->SetFont('','B', $default_font_size - 1);
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1);
|
||||
|
||||
@@ -625,64 +645,90 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param int $nexY Y (not used)
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @param int $hidetop Hide top bar of array
|
||||
* @param int $hidebottom Hide bottom bar of array
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// Force to disable hidetop and hidebottom
|
||||
$hidebottom=0;
|
||||
if ($hidetop) $hidetop=-1;
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
// Amount in (at tab_top - 1)
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','',$default_font_size - 2);
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||
}
|
||||
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
|
||||
// Rect prend une longueur en 3eme param
|
||||
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height);
|
||||
// line prend une position y en 3eme param
|
||||
$pdf->line($this->marge_gauche, $tab_top+6, $this->page_largeur-$this->marge_droite, $tab_top+6);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
$pdf->SetXY($this->posxdesc-1, $tab_top+2);
|
||||
$pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L');
|
||||
// Output Rect
|
||||
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
|
||||
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param
|
||||
|
||||
$pdf->SetXY($this->posxdesc-1, $tab_top+1);
|
||||
$pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L');
|
||||
}
|
||||
|
||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
||||
{
|
||||
$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height);
|
||||
$pdf->SetXY($this->posxtva-3, $tab_top+2);
|
||||
$pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C');
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->posxtva-3, $tab_top+1);
|
||||
$pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C');
|
||||
}
|
||||
}
|
||||
|
||||
$pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height);
|
||||
$pdf->SetXY($this->posxup-1, $tab_top+2);
|
||||
$pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C');
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->posxup-1, $tab_top+1);
|
||||
$pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C');
|
||||
}
|
||||
|
||||
$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
|
||||
$pdf->SetXY($this->posxqty-1, $tab_top+2);
|
||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
|
||||
}
|
||||
|
||||
$pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height);
|
||||
|
||||
if ($this->atleastonediscount)
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->posxdiscount-1, $tab_top+2);
|
||||
$pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C');
|
||||
if ($this->atleastonediscount)
|
||||
{
|
||||
$pdf->SetXY($this->posxdiscount-1, $tab_top+1);
|
||||
$pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C');
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->atleastonediscount)
|
||||
{
|
||||
$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
|
||||
}
|
||||
$pdf->SetXY($this->postotalht-1, $tab_top+2);
|
||||
$pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHTShort"),'','C');
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->postotalht-1, $tab_top+1);
|
||||
$pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHTShort"),'','C');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -701,14 +747,18 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$tab3_top = $posy + 8;
|
||||
$tab3_width = 80;
|
||||
$tab3_height = 4;
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
$tab3_posx -= 20;
|
||||
}
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY($tab3_posx, $tab3_top - 5);
|
||||
$pdf->MultiCell(60, 5, $outputlangs->transnoentities("PaymentsAlreadyDone"), 0, 'L', 0);
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
$pdf->SetXY($tab3_posx, $tab3_top - 4);
|
||||
$pdf->MultiCell(60, 3, $outputlangs->transnoentities("PaymentsAlreadyDone"), 0, 'L', 0);
|
||||
|
||||
$pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height);
|
||||
$pdf->line($tab3_posx, $tab3_top, $tab3_posx+$tab3_width, $tab3_top);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 4);
|
||||
$pdf->SetXY($tab3_posx, $tab3_top);
|
||||
@@ -720,6 +770,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$pdf->SetXY($tab3_posx+58, $tab3_top);
|
||||
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0);
|
||||
|
||||
$pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height);
|
||||
|
||||
$y=0;
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 4);
|
||||
@@ -745,7 +797,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$pdf->SetXY($tab3_posx+21, $tab3_top+$y);
|
||||
$pdf->MultiCell(20, 3, price($row->amount), 0, 'L', 0);
|
||||
$pdf->SetXY($tab3_posx+40, $tab3_top+$y);
|
||||
$oper = $outputlangs->getTradFromKey("PaymentTypeShort" . $row->code);
|
||||
$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code);
|
||||
|
||||
$pdf->MultiCell(20, 3, $oper, 0, 'L', 0);
|
||||
$pdf->SetXY($tab3_posx+58, $tab3_top+$y);
|
||||
@@ -772,9 +824,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param object $hookmanager Hookmanager object
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $hookmanager)
|
||||
{
|
||||
global $langs,$conf,$mysoc;
|
||||
|
||||
@@ -782,7 +835,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$outputlangs->load("bills");
|
||||
$outputlangs->load("orders");
|
||||
$outputlangs->load("companies");
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
// Do not add the BACKGROUND as this is for suppliers
|
||||
@@ -791,8 +843,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
$posy=$this->marge_haute;
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche,$posy);
|
||||
|
||||
@@ -823,17 +875,22 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("SupplierInvoice")." ".$outputlangs->convToOutputCharset($object->ref), '', 'R');
|
||||
$pdf->SetFont('','', $default_font_size + 2);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierInvoice")." ".$outputlangs->convToOutputCharset($object->ref), '', 'R');
|
||||
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
|
||||
if ($object->ref_supplier)
|
||||
{
|
||||
$posy+=5;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("RefSupplier")." : " . $object->ref_supplier, '', 'R');
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("RefSupplier")." : " . $object->ref_supplier, '', 'R');
|
||||
}
|
||||
|
||||
$posy+=6;
|
||||
$posy+=1;
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
$posy+=5;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
if ($object->date)
|
||||
{
|
||||
@@ -846,6 +903,12 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$pdf->MultiCell(100, 4, strtolower($outputlangs->transnoentities("OrderToProcess")), '', 'R');
|
||||
}
|
||||
|
||||
$posy+=2;
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
|
||||
// Show list of linked objects
|
||||
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size, $hookmanager);
|
||||
|
||||
if ($showaddress)
|
||||
{
|
||||
// Sender properties
|
||||
@@ -892,7 +955,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname;
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $mysoc->nom;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
@@ -904,26 +967,28 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$mysoc,$object->contact,$usecontact,'target');
|
||||
|
||||
// Show recipient
|
||||
$widthrecbox=100;
|
||||
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
|
||||
$posy=42;
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
$posx=$this->page_largeur-$this->marge_droite-$widthrecbox;
|
||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||
|
||||
// Show recipient frame
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY($posx+2,$posy-5);
|
||||
$pdf->MultiCell(80,5, $outputlangs->transnoentities("BillTo").":",0,'L');
|
||||
$pdf->Rect($posx, $posy, 100, $hautcadre);
|
||||
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L');
|
||||
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
|
||||
|
||||
// Show recipient name
|
||||
$pdf->SetXY($posx+2,$posy+3);
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$pdf->MultiCell(96,4, $carac_client_name, 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||
|
||||
// Show recipient information
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
|
||||
$pdf->MultiCell(86,4, $carac_client, 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -933,11 +998,12 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
* @param int $hidefreetext 1=Hide free text
|
||||
* @return int Return height of bottom margin including footer text
|
||||
*/
|
||||
function _pagefoot(&$pdf, $object, $outputlangs)
|
||||
function _pagefoot(&$pdf, $object, $outputlangs,$hidefreetext=0)
|
||||
{
|
||||
return pdf_pagefoot($pdf,$outputlangs,'SUPPLIER_INVOICE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object);
|
||||
return pdf_pagefoot($pdf,$outputlangs,'SUPPLIER_INVOICE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
* \brief File of class to generate suppliers orders from muscadet model
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/modules/supplier_order/modules_commandefournisseur.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_order/modules_commandefournisseur.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
@@ -61,7 +61,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param Societe $object Third party providing order
|
||||
* @param Object $object Supplier order
|
||||
*/
|
||||
function __construct($db,$object)
|
||||
{
|
||||
@@ -80,10 +80,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
$this->marge_haute=10;
|
||||
$this->marge_basse=10;
|
||||
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||
|
||||
$this->option_logo = 1; // Affiche logo
|
||||
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||
@@ -99,7 +99,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$this->franchise=!$mysoc->tva_assuj;
|
||||
|
||||
// Get source company
|
||||
$this->emetteur=$mysoc;
|
||||
//if (! is_object($object->thirdparty)) $object->fetch_thirdparty();
|
||||
//$this->emetteur=$object->thirdparty;
|
||||
//if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined
|
||||
|
||||
// Defini position des colonnes
|
||||
@@ -109,6 +112,14 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$this->posxqty=145;
|
||||
$this->posxdiscount=162;
|
||||
$this->postotalht=174;
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
$this->posxtva-=20;
|
||||
$this->posxup-=20;
|
||||
$this->posxqty-=20;
|
||||
$this->posxdiscount-=20;
|
||||
$this->postotalht-=20;
|
||||
}
|
||||
|
||||
$this->tva=array();
|
||||
$this->localtax1=array();
|
||||
@@ -119,7 +130,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
|
||||
|
||||
/**
|
||||
* Build document onto disk
|
||||
* Function to build pdf onto disk
|
||||
*
|
||||
* @param int $object Id of object to generate
|
||||
* @param object $outputlangs Lang output object
|
||||
@@ -145,8 +156,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$outputlangs->load("products");
|
||||
$outputlangs->load("orders");
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
if ($conf->fournisseur->dir_output.'/commande')
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
@@ -157,7 +166,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
//$amount_credit_notes_included = $object->getSumCreditNotesUsed();
|
||||
//$amount_deposits_included = $object->getSumDepositsUsed();
|
||||
|
||||
// Definition de $dir et $file
|
||||
// Definition of $dir and $file
|
||||
if ($object->specimen)
|
||||
{
|
||||
$dir = $conf->fournisseur->commande->dir_output;
|
||||
@@ -185,6 +194,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$nblignes = count($object->lines);
|
||||
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
@@ -208,10 +222,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
|
||||
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
|
||||
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order"));
|
||||
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
|
||||
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
|
||||
|
||||
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
// Positionne $this->atleastonediscount si on a au moins une remise
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
@@ -232,8 +245,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$tab_top = 90;
|
||||
$tab_top_newpage = 50;
|
||||
$tab_height = 110;
|
||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||
$tab_height = 130;
|
||||
$tab_height_newpage = 150;
|
||||
|
||||
// Affiche notes
|
||||
@@ -241,7 +254,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
{
|
||||
$tab_top = 88;
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to manage multipages
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
|
||||
$nexY = $pdf->GetY();
|
||||
$height_note=$nexY-$tab_top;
|
||||
@@ -266,15 +279,29 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
{
|
||||
$curY = $nexY;
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||
$pdf->setTopMargin($tab_top_newpage);
|
||||
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||
$pageposbefore=$pdf->getPage();
|
||||
|
||||
// Description of product line
|
||||
$curX = $this->posxdesc-1;
|
||||
$curX = $this->posxdesc-1;
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,0,0,1,$hookmanager);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$nexY = $pdf->GetY();
|
||||
$pageposafter=$pdf->getPage();
|
||||
$pdf->setPage($pageposbefore);
|
||||
$pdf->setTopMargin($this->marge_haute);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
|
||||
// We suppose that a too long description is moved completely on next page
|
||||
if ($pageposafter > $pageposbefore) {
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
// VAT Rate
|
||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
||||
@@ -310,87 +337,78 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$localtax1ligne=$object->lines[$i]->total_localtax1;
|
||||
$localtax2ligne=$object->lines[$i]->total_localtax2;
|
||||
|
||||
if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100;
|
||||
if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100;
|
||||
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
|
||||
if (! empty($object->remise_percent)) $tvaligne-=($tvaligne*$object->remise_percent)/100;
|
||||
if (! empty($object->remise_percent)) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100;
|
||||
if (! empty($object->remise_percent)) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
|
||||
|
||||
$vatrate=(string) $object->lines[$i]->tva_tx;
|
||||
$localtax1rate=(string) $object->lines[$i]->localtax1_tx;
|
||||
$localtax2rate=(string) $object->lines[$i]->localtax2_tx;
|
||||
|
||||
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
|
||||
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
|
||||
if (! isset($this->localtax1[$localtax1rate])) $this->localtax1[$localtax1rate]='';
|
||||
if (! isset($this->localtax2[$localtax2rate])) $this->localtax2[$localtax2rate]='';
|
||||
$this->tva[$vatrate] += $tvaligne;
|
||||
$this->localtax1[$localtax1rate]+=$localtax1ligne;
|
||||
$this->localtax2[$localtax2rate]+=$localtax2ligne;
|
||||
|
||||
// Add line
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
{
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
}
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Cherche nombre de lignes a venir pour savoir si place suffisante
|
||||
if ($i < ($nblignes - 1) && empty($hidedesc)) // If it's not last line
|
||||
{
|
||||
//on recupere la description du produit suivant
|
||||
$follow_descproduitservice = $object->lines[$i+1]->desc;
|
||||
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
|
||||
$nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4);
|
||||
// Et si on affiche dates de validite, on ajoute encore une ligne
|
||||
if ($object->lines[$i]->date_start && $object->lines[$i]->date_end)
|
||||
{
|
||||
$nblineFollowDesc += 4;
|
||||
}
|
||||
}
|
||||
else // If it's last line
|
||||
{
|
||||
$nblineFollowDesc = 0;
|
||||
}
|
||||
|
||||
// Test if a new page is required
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$tab_top_in_current_page=$tab_top;
|
||||
$tab_height_in_current_page=$tab_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
$tab_top_in_current_page=$tab_top_newpage;
|
||||
$tab_height_in_current_page=$tab_height_newpage;
|
||||
}
|
||||
if (($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblignes - 1))
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
$pdf->setPage($pagenb);
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
|
||||
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||
|
||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||
$pagenb++;
|
||||
$pdf->setPage($pagenb);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
}
|
||||
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||
}
|
||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
$pagenb++;
|
||||
$this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$nexY = $tab_top_newpage + 7;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Show square
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
|
||||
$bottomlasttab=$tab_top + $tab_height + 1;
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
|
||||
$bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1;
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||
}
|
||||
|
||||
// Affiche zone infos
|
||||
@@ -417,7 +435,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
// Add pdfgeneration hook
|
||||
if (! is_object($hookmanager))
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager=new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('pdfgeneration'));
|
||||
@@ -447,7 +465,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
|
||||
|
||||
/**
|
||||
* Affiche tableau des versement
|
||||
* Show payments table
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object order
|
||||
@@ -545,7 +563,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
||||
{
|
||||
// Si mode reglement non force ou si force a CHQ
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER)
|
||||
if (! empty($conf->global->FACTURE_CHQ_NUMBER))
|
||||
{
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER > 0)
|
||||
{
|
||||
@@ -553,24 +571,24 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$account->fetch($conf->global->FACTURE_CHQ_NUMBER);
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('','B', $default_font_size - 2);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio).':',0,'L',0);
|
||||
$pdf->SetFont('','B', $default_font_size - 3);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio).':',0,'L',0);
|
||||
$posy=$pdf->GetY()+1;
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0);
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0);
|
||||
$posy=$pdf->GetY()+2;
|
||||
}
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER == -1)
|
||||
{
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('','B', $default_font_size - 2);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByChequeOrderedToShort').' '.$outputlangs->convToOutputCharset($this->emetteur->name).' '.$outputlangs->transnoentities('SendTo').':',0,'L',0);
|
||||
$pdf->SetFont('','B', $default_font_size - 3);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedToShort').' '.$outputlangs->convToOutputCharset($this->emetteur->name).' '.$outputlangs->transnoentities('SendTo').':',0,'L',0);
|
||||
$posy=$pdf->GetY()+1;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0);
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0);
|
||||
$posy=$pdf->GetY()+2;
|
||||
}
|
||||
}
|
||||
@@ -587,7 +605,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$curx=$this->marge_gauche;
|
||||
$cury=$posy;
|
||||
|
||||
$posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account);
|
||||
$posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account,0,$default_font_size);
|
||||
|
||||
$posy+=2;
|
||||
}
|
||||
@@ -618,7 +636,12 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
// Tableau total
|
||||
$col1x = 120; $col2x = 170; $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
|
||||
$col1x = 120; $col2x = 170;
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
$col2x-=20;
|
||||
}
|
||||
$largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
|
||||
|
||||
$useborder=0;
|
||||
$index = 0;
|
||||
@@ -629,7 +652,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
||||
|
||||
$pdf->SetXY($col2x, $tab2_top + 0);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ht + $object->remise), 0, 'R', 1);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ht + (! empty($object->remise)?$object->remise:0)), 0, 'R', 1);
|
||||
|
||||
// Show VAT by rates and total
|
||||
$pdf->SetFillColor(248,248,248);
|
||||
@@ -766,7 +789,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
//$depositsamount=$object->getSumDepositsUsed();
|
||||
//print "x".$creditnoteamount."-".$depositsamount;exit;
|
||||
$resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
|
||||
if ($object->paye) $resteapayer=0;
|
||||
if (! empty($object->paye)) $resteapayer=0;
|
||||
|
||||
if ($deja_regle > 0)
|
||||
{
|
||||
@@ -778,8 +801,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0);
|
||||
|
||||
$resteapayer = $object->total_ttc - $deja_regle;
|
||||
|
||||
$index++;
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
@@ -803,64 +824,90 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param int $nexY Y (not used)
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @param int $hidetop Hide top bar of array
|
||||
* @param int $hidebottom Hide bottom bar of array
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
// Force to disable hidetop and hidebottom
|
||||
$hidebottom=0;
|
||||
if ($hidetop) $hidetop=-1;
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
// Amount in (at tab_top - 1)
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||
}
|
||||
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
|
||||
// Rect prend une longueur en 3eme param et 4eme param
|
||||
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height);
|
||||
// line prend une position y en 2eme param et 4eme param
|
||||
$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
$pdf->SetXY($this->posxdesc-1, $tab_top+1);
|
||||
$pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L');
|
||||
// Output Rect
|
||||
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
|
||||
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param
|
||||
|
||||
$pdf->SetXY($this->posxdesc-1, $tab_top+1);
|
||||
$pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L');
|
||||
}
|
||||
|
||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
||||
{
|
||||
$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height);
|
||||
$pdf->SetXY($this->posxtva-3, $tab_top+1);
|
||||
$pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C');
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->posxtva-3, $tab_top+1);
|
||||
$pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C');
|
||||
}
|
||||
}
|
||||
|
||||
$pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height);
|
||||
$pdf->SetXY($this->posxup-1, $tab_top+1);
|
||||
$pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C');
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->posxup-1, $tab_top+1);
|
||||
$pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C');
|
||||
}
|
||||
|
||||
$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
|
||||
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
|
||||
}
|
||||
|
||||
$pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height);
|
||||
if ($this->atleastonediscount)
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->posxdiscount-1, $tab_top+1);
|
||||
$pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C');
|
||||
if ($this->atleastonediscount)
|
||||
{
|
||||
$pdf->SetXY($this->posxdiscount-1, $tab_top+1);
|
||||
$pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C');
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->atleastonediscount)
|
||||
{
|
||||
$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
|
||||
}
|
||||
$pdf->SetXY($this->postotalht-1, $tab_top+1);
|
||||
$pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHTShort"),'','C');
|
||||
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->SetXY($this->postotalht-1, $tab_top+1);
|
||||
$pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHTShort"),'','C');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -870,9 +917,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param object $hookmanager Hookmanager object
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $hookmanager)
|
||||
{
|
||||
global $langs,$conf,$mysoc;
|
||||
|
||||
@@ -930,7 +978,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$title=$outputlangs->transnoentities("SupplierOrder");
|
||||
$pdf->MultiCell(100, 3, $title, '', 'R');
|
||||
|
||||
$pdf->SetFont('', 'B', $default_font_size + 2);
|
||||
$pdf->SetFont('','B',$default_font_size);
|
||||
|
||||
$posy+=6;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
@@ -945,15 +993,19 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
if ($object->date_commande)
|
||||
{
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date_commande,"day",false,$outputlangs,true), '', 'R');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date_commande,"day",false,$outputlangs,true), '', 'R');
|
||||
}
|
||||
else
|
||||
{
|
||||
$pdf->SetTextColor(255,0,0);
|
||||
$pdf->MultiCell(100, 4, strtolower($outputlangs->transnoentities("OrderToProcess")), '', 'R');
|
||||
$pdf->MultiCell(100, 3, strtolower($outputlangs->transnoentities("OrderToProcess")), '', 'R');
|
||||
}
|
||||
|
||||
$posy+=2;
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
|
||||
// Show list of linked objects
|
||||
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size, $hookmanager);
|
||||
|
||||
if ($showaddress)
|
||||
{
|
||||
@@ -1001,7 +1053,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname;
|
||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->name;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
@@ -1010,29 +1062,31 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
|
||||
}
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target');
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
|
||||
|
||||
// Show recipient
|
||||
$widthrecbox=100;
|
||||
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
|
||||
$posy=42;
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
$posx=$this->page_largeur-$this->marge_droite-$widthrecbox;
|
||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||
|
||||
// Show recipient frame
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY($posx+2,$posy-5);
|
||||
$pdf->MultiCell(80,5, $outputlangs->transnoentities("BillTo").":",0,'L');
|
||||
$pdf->Rect($posx, $posy, 100, $hautcadre);
|
||||
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L');
|
||||
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
|
||||
|
||||
// Show recipient name
|
||||
$pdf->SetXY($posx+2,$posy+3);
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$pdf->MultiCell(96,4, $carac_client_name, 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||
|
||||
// Show recipient information
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
|
||||
$pdf->MultiCell(86,4, $carac_client, 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1042,11 +1096,12 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
* @param int $hidefreetext 1=Hide free text
|
||||
* @return int Return height of bottom margin including footer text
|
||||
*/
|
||||
function _pagefoot(&$pdf, $object, $outputlangs)
|
||||
function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
|
||||
{
|
||||
return pdf_pagefoot($pdf,$outputlangs,'SUPPLIER_INVOICE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object);
|
||||
return pdf_pagefoot($pdf,$outputlangs,'SUPPLIER_INVOICE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
<td align="right">
|
||||
<?php
|
||||
if ($buyer->tva_assuj == "0") echo '<input type="hidden" name="np_tva_tx" value="0">0';
|
||||
if ($seller->tva_assuj == "0") echo '<input type="hidden" name="np_tva_tx" value="0">0';
|
||||
else echo $form->load_tva('np_tva_tx', (isset($_POST["np_tva_tx"])?$_POST["np_tva_tx"]:-1), $seller, $buyer);
|
||||
?>
|
||||
</td>
|
||||
|
||||
@@ -82,7 +82,7 @@ $(document).ready(function () {
|
||||
<input type="hidden" name="screenwidth" id="screenwidth" value="" />
|
||||
<input type="hidden" name="screenheight" id="screenheight" value="" />
|
||||
|
||||
<table class="login_table" summary="<?php echo $title; ?>" cellpadding="0" cellspacing="0" border="0" align="center">
|
||||
<table class="login_table" summary="<?php echo dol_escape_htmltag($title); ?>" cellpadding="0" cellspacing="0" border="0" align="center">
|
||||
<tr class="vmenu"><td align="center"><?php echo $title; ?></td></tr>
|
||||
</table>
|
||||
<br>
|
||||
@@ -96,22 +96,24 @@ $(document).ready(function () {
|
||||
<tr>
|
||||
<td valign="bottom"> <strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong> </td>
|
||||
<td valign="bottom" nowrap="nowrap">
|
||||
<input type="text" id="username" name="username" class="flat" size="15" maxlength="40" value="<?php echo GETPOST('username')?GETPOST('username'):$login; ?>" tabindex="1" />
|
||||
<input type="text" id="username" name="username" class="flat" size="15" maxlength="40" value="<?php echo dol_escape_htmltag($login); ?>" tabindex="1" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Password -->
|
||||
<tr><td valign="top" nowrap="nowrap"> <strong><label for="password"><?php echo $langs->trans('Password'); ?></label></strong> </td>
|
||||
<td valign="top" nowrap="nowrap">
|
||||
<input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="<?php echo $password; ?>" tabindex="2" />
|
||||
<input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="<?php echo dol_escape_htmltag($password); ?>" tabindex="2" />
|
||||
</td></tr>
|
||||
|
||||
<?php
|
||||
if (! empty($hookmanager->resArray['options'])) {
|
||||
foreach ($hookmanager->resArray['options'] as $option)
|
||||
foreach ($hookmanager->resArray['options'] as $format => $option)
|
||||
{
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
if ($format == 'table') {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -35,10 +35,12 @@ print '<!-- Includes for JQuery (Ajax library) -->'."\n";
|
||||
if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery
|
||||
else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
|
||||
// JQuery. Must be before other includes
|
||||
$ext='.js';
|
||||
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz';
|
||||
print '<!-- Includes JS for JQuery -->'."\n";
|
||||
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n";
|
||||
else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n";
|
||||
print '<link rel="stylesheet" type="text/css" href="'.$conf_css.'" />
|
||||
print '<link rel="stylesheet" type="text/css" href="'.dol_escape_htmltag($conf_css).'" />
|
||||
<style type="text/css">
|
||||
<!--
|
||||
#login {
|
||||
@@ -81,12 +83,17 @@ print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
|
||||
<input type="text" <?php echo $disabled; ?> id="username" name="username" class="flat" size="15" maxlength="25" value="<?php echo $login; ?>" tabindex="1" /></td>
|
||||
</tr>
|
||||
|
||||
<?php if ($select_entity) { ?>
|
||||
<tr><td valign="top" nowrap="nowrap"> <b><?php echo $langs->trans('Entity'); ?></b> </td>
|
||||
<td valign="top" nowrap="nowrap">
|
||||
<?php echo $select_entity; ?>
|
||||
</td></tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (! empty($hookmanager->resArray['options'])) {
|
||||
foreach ($hookmanager->resArray['options'] as $format => $option)
|
||||
{
|
||||
if ($format == 'table') {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($captcha) { ?>
|
||||
<tr><td valign="middle" nowrap="nowrap"> <b><?php echo $langs->trans('SecurityCode'); ?></b></td>
|
||||
|
||||
@@ -102,47 +102,54 @@ class InterfacePaypalWorkflow
|
||||
if ($action == 'PAYPAL_PAYMENT_OK')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". source=".$object->source." ref=".$object->ref);
|
||||
|
||||
if ($object->source == 'membersubscription')
|
||||
|
||||
if (! empty($object->source))
|
||||
{
|
||||
//require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherents.class.php");
|
||||
|
||||
// TODO add subscription treatment
|
||||
if ($object->source == 'membersubscription')
|
||||
{
|
||||
//require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherents.class.php';
|
||||
|
||||
// TODO add subscription treatment
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
|
||||
$soc = new Societe($this->db);
|
||||
|
||||
// Parse element/subelement (ex: project_task)
|
||||
$element = $path = $filename = $object->source;
|
||||
if (preg_match('/^([^_]+)_([^_]+)/i',$object->source,$regs))
|
||||
{
|
||||
$element = $path = $regs[1];
|
||||
$filename = $regs[2];
|
||||
}
|
||||
// For compatibility
|
||||
if ($element == 'order') {
|
||||
$path = $filename = 'commande';
|
||||
}
|
||||
if ($element == 'invoice') {
|
||||
$path = 'compta/facture'; $filename = 'facture';
|
||||
}
|
||||
|
||||
dol_include_once('/'.$path.'/class/'.$filename.'.class.php');
|
||||
|
||||
$classname = ucfirst($filename);
|
||||
$obj = new $classname($this->db);
|
||||
|
||||
$ret = $obj->fetch('',$object->ref);
|
||||
if ($ret < 0) return -1;
|
||||
|
||||
// Add payer id
|
||||
$soc->setValueFrom('ref_int', $object->payerID, 'societe', $obj->socid);
|
||||
|
||||
// Add transaction id
|
||||
$obj->setValueFrom('ref_int',$object->resArray["TRANSACTIONID"]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
|
||||
|
||||
$soc = new Societe($this->db);
|
||||
|
||||
// Parse element/subelement (ex: project_task)
|
||||
$element = $path = $filename = $object->source;
|
||||
if (preg_match('/^([^_]+)_([^_]+)/i',$object->source,$regs))
|
||||
{
|
||||
$element = $path = $regs[1];
|
||||
$filename = $regs[2];
|
||||
}
|
||||
// For compatibility
|
||||
if ($element == 'order') {
|
||||
$path = $filename = 'commande';
|
||||
}
|
||||
if ($element == 'invoice') {
|
||||
$path = 'compta/facture'; $filename = 'facture';
|
||||
}
|
||||
|
||||
dol_include_once('/'.$path.'/class/'.$filename.'.class.php');
|
||||
|
||||
$classname = ucfirst($filename);
|
||||
$obj = new $classname($this->db);
|
||||
|
||||
$ret = $obj->fetch('',$object->ref);
|
||||
if ($ret < 0) return -1;
|
||||
|
||||
// Add payer id
|
||||
$soc->setValueFrom('ref_int', $object->payerID, 'societe', $obj->socid);
|
||||
|
||||
// Add transaction id
|
||||
$obj->setValueFrom('ref_int',$object->resArray["TRANSACTIONID"]);
|
||||
// TODO add free tag treatment
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -287,8 +287,9 @@ class InterfaceActionsAuto
|
||||
$langs->load("bills");
|
||||
$langs->load("agenda");
|
||||
|
||||
// Values for this action can't be defined by caller.
|
||||
$object->actiontypecode='AC_OTH';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
|
||||
$object->actionmsg2=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||
|
||||
|
||||
@@ -34,11 +34,11 @@ if (empty($conf->global->EXTERNALSITE_URL))
|
||||
llxFooter();
|
||||
}
|
||||
|
||||
$mainmenu=GETPOST('mainmenu');
|
||||
$leftmenu=GETPOST('leftmenu');
|
||||
$idmenu=GETPOST('idmenu');
|
||||
$theme=GETPOST('theme');
|
||||
$codelang=GETPOST('lang');
|
||||
$mainmenu=GETPOST('mainmenu', 'alpha');
|
||||
$leftmenu=GETPOST('leftmenu', 'alpha');
|
||||
$idmenu=GETPOST('idmenu', 'int');
|
||||
$theme=GETPOST('theme', 'alpha');
|
||||
$codelang=GETPOST('lang', 'alpha');
|
||||
|
||||
print "
|
||||
<html>
|
||||
|
||||
@@ -123,11 +123,11 @@ else if ($action == 'add' && $user->rights->ficheinter->creer)
|
||||
$object->duree = GETPOST('duree','int');
|
||||
$object->fk_project = GETPOST('projectid','int');
|
||||
$object->author = $user->id;
|
||||
$object->description = GETPOST('description','alpha');
|
||||
$object->description = GETPOST('description');
|
||||
$object->ref = $ref;
|
||||
$object->modelpdf = GETPOST('model','alpha');
|
||||
$object->note_private = GETPOST('note_private','alpha');
|
||||
$object->note_public = GETPOST('note_public','alpha');
|
||||
$object->note_private = GETPOST('note_private');
|
||||
$object->note_public = GETPOST('note_public');
|
||||
|
||||
if ($object->socid > 0)
|
||||
{
|
||||
@@ -233,7 +233,7 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fich
|
||||
else if ($action == 'setdescription' && $user->rights->ficheinter->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->set_description($user,GETPOST('description','alpha'));
|
||||
$result=$object->set_description($user,GETPOST('description'));
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
else if ($action == 'setnote_public' && $user->rights->ficheinter->creer)
|
||||
@@ -252,7 +252,7 @@ else if ($action == 'setnote_private' && $user->rights->ficheinter->creer)
|
||||
// Add line
|
||||
else if ($action == "addline" && $user->rights->ficheinter->creer)
|
||||
{
|
||||
if (!GETPOST('np_desc','alpha'))
|
||||
if (!GETPOST('np_desc'))
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Description")).'</div>';
|
||||
$error++;
|
||||
@@ -269,7 +269,7 @@ else if ($action == "addline" && $user->rights->ficheinter->creer)
|
||||
$ret=$object->fetch($id);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$desc=GETPOST('np_desc','alpha');
|
||||
$desc=GETPOST('np_desc');
|
||||
$date_intervention = dol_mktime(GETPOST('dihour','int'), GETPOST('dimin','int'), 0, GETPOST('dimonth','int'), GETPOST('diday','int'), GETPOST('diyear','int'));
|
||||
$duration = convertTime2Seconds(GETPOST('durationhour','int'), GETPOST('durationmin','int'));
|
||||
|
||||
@@ -342,7 +342,7 @@ else if ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST(
|
||||
}
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$desc = GETPOST('np_desc','alpha');
|
||||
$desc = GETPOST('np_desc');
|
||||
$date_inter = dol_mktime(GETPOST('dihour','int'), GETPOST('dimin','int'), 0, GETPOST('dimonth','int'), GETPOST('diday','int'), GETPOST('diyear','int'));
|
||||
$duration = convertTime2Seconds(GETPOST('durationhour','int'),GETPOST('durationmin','int'));
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ if ($result)
|
||||
$interventionstatic=new Fichinter($db);
|
||||
|
||||
$urlparam="&socid=$socid";
|
||||
print_barre_liste($langs->trans("ListOfInterventions"), $page, "index.php",$urlparam,$sortfield,$sortorder,'',$num);
|
||||
print_barre_liste($langs->trans("ListOfInterventions"), $page, $_SERVER["PHP_SELF"],$urlparam,$sortfield,$sortorder,'',$num);
|
||||
|
||||
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
* \brief File that include conf.php file and commons lib like functions.lib.php
|
||||
*/
|
||||
|
||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.2.1'); // Also defined in htdocs/install/inc.php (Ex: x.y.z-alpha, x.y.z)
|
||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.2.3'); // Also defined in htdocs/install/inc.php (Ex: x.y.z-alpha, x.y.z)
|
||||
if (! defined('EURO')) define('EURO',chr(128));
|
||||
|
||||
// Define syslog constants
|
||||
@@ -53,9 +53,8 @@ if (! defined('LOG_DEBUG'))
|
||||
}
|
||||
}
|
||||
|
||||
// Force PHP error_reporting setup (Dolibarr may report warning without this)
|
||||
error_reporting(E_ALL & ~(E_STRICT|E_NOTICE|E_DEPRECATED));
|
||||
//error_reporting(E_ALL | E_STRICT);
|
||||
// End of common declaration part
|
||||
if (defined('DOL_INC_FOR_VERSION_ERROR')) return;
|
||||
|
||||
|
||||
// Define vars
|
||||
@@ -76,11 +75,19 @@ if (! $result && ! empty($_SERVER["GATEWAY_INTERFACE"])) // If install not do
|
||||
exit;
|
||||
}
|
||||
|
||||
// Disable php display errors
|
||||
if (! empty($dolibarr_main_prod))
|
||||
// Force PHP error_reporting setup (Dolibarr may report warning without this)
|
||||
if (! empty($dolibarr_strict_mode))
|
||||
{
|
||||
ini_set('display_errors','Off');
|
||||
error_reporting(E_ALL | E_STRICT);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! defined('E_DEPRECATED')) define('E_DEPRECATED',0); // For PHP < 5.3.0 compatibility
|
||||
error_reporting(E_ALL & ~(E_STRICT|E_NOTICE|E_DEPRECATED));
|
||||
}
|
||||
|
||||
// Disable php display errors
|
||||
if (! empty($dolibarr_main_prod)) ini_set('display_errors','Off');
|
||||
|
||||
// Clean parameters
|
||||
$dolibarr_main_data_root=trim($dolibarr_main_data_root);
|
||||
@@ -100,6 +107,7 @@ if (empty($dolibarr_main_limit_users)) $dolibarr_main_limit_users=0;
|
||||
if (empty($dolibarr_mailing_limit_sendbyweb)) $dolibarr_mailing_limit_sendbyweb=0;
|
||||
if (empty($force_charset_do_notuse)) $force_charset_do_notuse='UTF-8';
|
||||
if (empty($multicompany_transverse_mode)) $multicompany_transverse_mode=0;
|
||||
if (empty($multicompany_force_entity)) $multicompany_force_entity=0; // To force entity in login page
|
||||
|
||||
// Security: CSRF protection
|
||||
// This test check if referrer ($_SERVER['HTTP_REFERER']) is same web site than Dolibarr ($_SERVER['HTTP_HOST'])
|
||||
|
||||
@@ -405,27 +405,29 @@ class FactureFournisseur extends Facture
|
||||
while ($i < $num_rows)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql_rows);
|
||||
$this->lines[$i]->rowid = $obj->rowid;
|
||||
$this->lines[$i]->description = $obj->description;
|
||||
$this->lines[$i]->ref = $obj->product_ref; // TODO deprecated
|
||||
$this->lines[$i]->product_ref = $obj->product_ref; // Internal reference
|
||||
//$this->lines[$i]->ref_fourn = $obj->ref_fourn; // Reference fournisseur du produit
|
||||
$this->lines[$i]->libelle = $obj->label; // Label du produit
|
||||
$this->lines[$i]->product_desc = $obj->product_desc; // Description du produit
|
||||
$this->lines[$i]->pu_ht = $obj->pu_ht;
|
||||
$this->lines[$i]->pu_ttc = $obj->pu_ttc;
|
||||
$this->lines[$i]->tva_tx = $obj->tva_tx;
|
||||
$this->lines[$i]->localtax1_tx = $obj->localtax1_tx;
|
||||
$this->lines[$i]->localtax2_tx = $obj->localtax2_tx;
|
||||
$this->lines[$i]->qty = $obj->qty;
|
||||
$this->lines[$i]->tva = $obj->tva;
|
||||
$this->lines[$i]->total_ht = $obj->total_ht;
|
||||
$this->lines[$i]->total_tva = $obj->total_tva;
|
||||
$this->lines[$i]->total_localtax1 = $obj->total_localtax1;
|
||||
$this->lines[$i]->total_localtax2 = $obj->total_localtax2;
|
||||
$this->lines[$i]->total_ttc = $obj->total_ttc;
|
||||
$this->lines[$i]->fk_product = $obj->fk_product;
|
||||
$this->lines[$i]->product_type = $obj->product_type;
|
||||
|
||||
$this->lines[$i] = (object) array();
|
||||
$this->lines[$i]->rowid = $obj->rowid;
|
||||
$this->lines[$i]->description = $obj->description;
|
||||
$this->lines[$i]->ref = $obj->product_ref; // TODO deprecated
|
||||
$this->lines[$i]->product_ref = $obj->product_ref; // Internal reference
|
||||
//$this->lines[$i]->ref_fourn = $obj->ref_fourn; // Reference fournisseur du produit
|
||||
$this->lines[$i]->libelle = $obj->label; // Label du produit
|
||||
$this->lines[$i]->product_desc = $obj->product_desc; // Description du produit
|
||||
$this->lines[$i]->pu_ht = $obj->pu_ht;
|
||||
$this->lines[$i]->pu_ttc = $obj->pu_ttc;
|
||||
$this->lines[$i]->tva_tx = $obj->tva_tx;
|
||||
$this->lines[$i]->localtax1_tx = $obj->localtax1_tx;
|
||||
$this->lines[$i]->localtax2_tx = $obj->localtax2_tx;
|
||||
$this->lines[$i]->qty = $obj->qty;
|
||||
$this->lines[$i]->tva = $obj->tva;
|
||||
$this->lines[$i]->total_ht = $obj->total_ht;
|
||||
$this->lines[$i]->total_tva = $obj->total_tva;
|
||||
$this->lines[$i]->total_localtax1 = $obj->total_localtax1;
|
||||
$this->lines[$i]->total_localtax2 = $obj->total_localtax2;
|
||||
$this->lines[$i]->total_ttc = $obj->total_ttc;
|
||||
$this->lines[$i]->fk_product = $obj->fk_product;
|
||||
$this->lines[$i]->product_type = $obj->product_type;
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ $action = GETPOST('action');
|
||||
// Security check
|
||||
$id = (GETPOST('socid','int') ? GETPOST('socid','int') : GETPOST('id','int'));
|
||||
if ($user->societe_id) $id=$user->societe_id;
|
||||
$result = restrictedArea($user, 'societe&fournisseur', $id, '');
|
||||
$result = restrictedArea($user, 'societe&fournisseur', $id, '&societe');
|
||||
|
||||
$object = new Fournisseur($db);
|
||||
|
||||
@@ -403,7 +403,7 @@ if ($object->fetch($id))
|
||||
// List of contacts
|
||||
show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
}
|
||||
|
||||
|
||||
// Addresses list
|
||||
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB))
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
|
||||
|
||||
|
||||
// If not defined, we select menu "home"
|
||||
if (! isset($_GET["mainmenu"])) $_GET["mainmenu"]="home";
|
||||
$_GET['mainmenu']=GETPOST('mainmenu', 'alpha')?GETPOST('mainmenu', 'alpha'):'home';
|
||||
$action=GETPOST('action');
|
||||
|
||||
|
||||
|
||||
@@ -607,5 +607,5 @@ dolibarr_install_syslog("--- install/etape2.php end", LOG_INFO);
|
||||
|
||||
pFooter(!$ok,$setuplang);
|
||||
|
||||
$db->close();
|
||||
if (isset($db) && is_object($db)) $db->close();
|
||||
?>
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Sebastien DiCintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Sebastien DiCintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.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
|
||||
@@ -31,23 +31,24 @@ require_once($dolibarr_main_document_root . "/core/lib/admin.lib.php");
|
||||
require_once($dolibarr_main_document_root . "/core/lib/security.lib.php"); // for dol_hash
|
||||
|
||||
|
||||
$setuplang=isset($_POST["selectlang"])?$_POST["selectlang"]:(isset($_GET["selectlang"])?$_GET["selectlang"]:'auto');
|
||||
$setuplang=GETPOST("selectlang",'',3)?GETPOST("selectlang",'',3):'auto';
|
||||
$langs->setDefaultLang($setuplang);
|
||||
$versionfrom=GETPOST("versionfrom",'',3)?GETPOST("versionfrom",'',3):(empty($argv[1])?'':$argv[1]);
|
||||
$versionto=GETPOST("versionto",'',3)?GETPOST("versionto",'',3):(empty($argv[2])?'':$argv[2]);
|
||||
$action=GETPOST('action', 'alpha');
|
||||
|
||||
// Define targetversion used to update MAIN_VERSION_LAST_INSTALL for first install
|
||||
// or MAIN_VERSION_LAST_UPGRADE for upgrade.
|
||||
$targetversion=DOL_VERSION; // It it's last upgrade
|
||||
if (isset($_POST["action"]) && preg_match('/upgrade/i',$_POST["action"])) // If it's an old upgrade
|
||||
if (! empty($action) && preg_match('/upgrade/i', $action)) // If it's an old upgrade
|
||||
{
|
||||
$tmp=explode('_',$_POST["action"],2);
|
||||
$tmp=explode('_', $action, 2);
|
||||
if ($tmp[0]=='upgrade' && ! empty($tmp[1])) $targetversion=$tmp[1];
|
||||
}
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("install");
|
||||
|
||||
$action=GETPOST('action');
|
||||
|
||||
$success=0;
|
||||
|
||||
// Init "forced values" to nothing. "forced values" are used after using an install wizard (using a file install.forced.php).
|
||||
@@ -105,14 +106,14 @@ pHeader($langs->trans("SetupEnd"),"etape5");
|
||||
print '<br>';
|
||||
|
||||
// Test if we can run a first install process
|
||||
if (! GETPOST("versionfrom") && ! GETPOST("versionto") && ! is_writable($conffile))
|
||||
if (empty($versionfrom) && empty($versionto) && ! is_writable($conffile))
|
||||
{
|
||||
print $langs->trans("ConfFileIsNotWritable",$conffiletoshow);
|
||||
pFooter(1,$setuplang,'jscheckparam');
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($action == "set" || preg_match('/upgrade/i',$action))
|
||||
if ($action == "set" || empty($action) || preg_match('/upgrade/i',$action))
|
||||
{
|
||||
print '<table cellspacing="0" cellpadding="2" width="100%">';
|
||||
$error=0;
|
||||
@@ -250,7 +251,7 @@ if ($action == "set" || preg_match('/upgrade/i',$action))
|
||||
}
|
||||
}
|
||||
// If upgrade
|
||||
elseif (preg_match('/upgrade/i',$action))
|
||||
elseif (empty($action) || preg_match('/upgrade/i',$action))
|
||||
{
|
||||
if ($db->connected == 1)
|
||||
{
|
||||
@@ -355,7 +356,7 @@ if ($action == "set")
|
||||
}
|
||||
}
|
||||
// If upgrade
|
||||
elseif (preg_match('/upgrade/i',$action))
|
||||
elseif (empty($action) || preg_match('/upgrade/i',$action))
|
||||
{
|
||||
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION))
|
||||
{
|
||||
@@ -416,4 +417,4 @@ clearstatcache();
|
||||
dolibarr_install_syslog("--- install/etape5.php Dolibarr setup finished", LOG_INFO);
|
||||
|
||||
pFooter(1,$setuplang);
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
* \brief File that define environment for support pages
|
||||
*/
|
||||
|
||||
define('DOL_VERSION','3.2.1'); // Also defined in htdocs/master.inc.php (Ex: x.y.z-alpha, x.y.z)
|
||||
define('DOL_VERSION','3.2.3'); // Also defined in htdocs/master.inc.php (Ex: x.y.z-alpha, x.y.z)
|
||||
|
||||
// Define DOL_DOCUMENT_ROOT an ADODB_PATH used for install/upgrade process
|
||||
if (! defined('DOL_DOCUMENT_ROOT')) define('DOL_DOCUMENT_ROOT', '..');
|
||||
|
||||
@@ -155,10 +155,10 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (18
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1844, 184, '0','0','VAT Rate 0', 1);
|
||||
|
||||
-- PORTUGAL (id country=25)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (251, 25, '20','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (252, 25, '12','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (251, 25, '23','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (252, 25, '13','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (253, 25, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (254, 25, '5','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (254, 25, '6','0','VAT reduced rate',1);
|
||||
|
||||
-- ROMANIA (id country=188)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1881,188, '24','0','VAT standard rate',1);
|
||||
@@ -181,8 +181,8 @@ INSERT INTO llx_c_tva(rowid, fk_pays, taux, recuperableonly, note, active) VALUE
|
||||
INSERT INTO llx_c_tva(rowid, fk_pays, taux, recuperableonly, note, active) VALUES (2023, 202, '0', '0', 'VAT Rate 0', 1);
|
||||
|
||||
-- SPAIN (id country=4)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,note,active) values ( 41, 4, '18','0','4','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,note,active) values ( 42, 4, '8','0','1','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,note,active) values ( 41, 4, '21','0','5.2','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,note,active) values ( 42, 4, '10','0','1.4','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,note,active) values ( 43, 4, '4','0','0.5','VAT super-reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 44, 4, '0','0','VAT Rate 0',1);
|
||||
|
||||
@@ -193,9 +193,9 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (20
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (204,20, '0','0','VAT Rate 0', 1);
|
||||
|
||||
-- SWITZERLAND (id country=6)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 61, 6, '7.6','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 62, 6, '3.6','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 63, 6, '2.4','0','VAT super-reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 61, 6, '8','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 62, 6, '3.8','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 63, 6, '2.5','0','VAT super-reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 64, 6, '0','0','VAT Rate 0', 1);
|
||||
|
||||
-- TUNISIA (id country=10)
|
||||
|
||||
@@ -30,10 +30,14 @@ update llx_facture_rec set fk_projet = null where fk_projet not in (select rowid
|
||||
update llx_fichinter set fk_projet = null where fk_projet not in (select rowid from llx_projet);
|
||||
update llx_projet_task set fk_projet = null where fk_projet not in (select rowid from llx_projet);
|
||||
|
||||
update llx_propal set fk_user_author = null where fk_user_author not in (select rowid from llx_user);
|
||||
update llx_propal set fk_user_valid = null where fk_user_valid not in (select rowid from llx_user);
|
||||
update llx_propal set fk_user_cloture = null where fk_user_cloture not in (select rowid from llx_user);
|
||||
update llx_commande set fk_user_author = null where fk_user_author not in (select rowid from llx_user);
|
||||
update llx_commande set fk_user_valid = null where fk_user_valid not in (select rowid from llx_user);
|
||||
|
||||
|
||||
ALTER TABLE llx_extrafields ADD COLUMN TYPE VARCHAR(8);
|
||||
ALTER TABLE llx_extrafields ADD COLUMN type VARCHAR(8);
|
||||
|
||||
UPDATE llx_c_paper_format SET active=1 WHERE active=0;
|
||||
|
||||
|
||||
@@ -34,7 +34,11 @@ update llx_facture_rec set fk_projet = null where fk_projet not in (select rowid
|
||||
update llx_fichinter set fk_projet = null where fk_projet not in (select rowid from llx_projet);
|
||||
update llx_projet_task set fk_projet = null where fk_projet not in (select rowid from llx_projet);
|
||||
|
||||
update llx_propal set fk_user_author = null where fk_user_author not in (select rowid from llx_user);
|
||||
update llx_propal set fk_user_valid = null where fk_user_valid not in (select rowid from llx_user);
|
||||
update llx_propal set fk_user_cloture = null where fk_user_cloture not in (select rowid from llx_user);
|
||||
update llx_commande set fk_user_author = null where fk_user_author not in (select rowid from llx_user);
|
||||
update llx_commande set fk_user_valid = null where fk_user_valid not in (select rowid from llx_user);
|
||||
|
||||
delete from llx_societe_extrafields where fk_object not in (select rowid from llx_societe);
|
||||
delete from llx_adherent_extrafields where fk_object not in (select rowid from llx_adherent);
|
||||
|
||||
@@ -292,11 +292,15 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
|
||||
{
|
||||
$dir = "mysql/migration/"; // We use mysql migration scripts whatever is database driver
|
||||
|
||||
// For minor version
|
||||
$newversionfrom=preg_replace('/(\.[0-9]+)$/i','.0',$versionfrom);
|
||||
$newversionto=preg_replace('/(\.[0-9]+)$/i','.0',$versionto);
|
||||
|
||||
$filelist=array();
|
||||
$i = 0;
|
||||
$ok = 0;
|
||||
$from='^'.$versionfrom;
|
||||
$to=$versionto.'\.sql$';
|
||||
$from='^'.$newversionfrom;
|
||||
$to=$newversionto.'\.sql$';
|
||||
|
||||
// Get files list
|
||||
$filesindir=array();
|
||||
|
||||
@@ -322,18 +322,9 @@ NetToBePaid=Φόρος που πρέπει να πληρωθεί
|
||||
PhoneNumber=Τηλ
|
||||
FullPhoneNumber=Τηλέφωνο
|
||||
TeleFax=Φαξ
|
||||
PrettyLittleSentence=Accept the amount of payments due by checks issued in my name as a Member of an accounting association approved by the Fiscal Administration.
|
||||
IntracommunityVATNumber=Intracommunity number of VAT
|
||||
PaymentByChequeOrderedTo=Check payment (including tax) are payable to %s send to
|
||||
PaymentByChequeOrderedToShort=Check payment (including tax) are payable to
|
||||
SendTo=Αποστολή σε
|
||||
PaymentByTransferOnThisBankAccount=Πληρωμή με έμβασμα στον ακόλουθο λογαριασμό
|
||||
VATIsNotUsedForInvoice=* Non applicable VAT art-293B of CGI
|
||||
LawApplicationPart1=By application of the law 80.335 of 12/05/80
|
||||
LawApplicationPart2=the goods remain the property of
|
||||
LawApplicationPart3=the seller until the complete cashing of
|
||||
LawApplicationPart4=their price.
|
||||
LimitedLiabilityCompanyCapital=SARL with Capital of
|
||||
UseDiscount=Χρήση έκπτωσης
|
||||
UseCredit=Χρήση πίστωσης
|
||||
UseCreditNoteInInvoicePayment=Μείωση ποσού πληρωμής με αυτή την πίστωση
|
||||
|
||||
17
htdocs/langs/en_SA/main.lang
Normal file
17
htdocs/langs/en_SA/main.lang
Normal file
@@ -0,0 +1,17 @@
|
||||
# Dolibarr language file - en_SA - main
|
||||
CHARSET=UTF-8
|
||||
DIRECTION=ltr
|
||||
FONTFORPDF=DejaVuSans
|
||||
FONTSIZEFORPDF=9
|
||||
SeparatorDecimal=.
|
||||
SeparatorThousand=,
|
||||
FormatDateShort=%d/%m/%Y
|
||||
FormatDateShortJava=dd/MM/yyyy
|
||||
FormatDateShortJQuery=dd/mm/yy
|
||||
FormatHourShort=%I:%M %p
|
||||
FormatHourShortDuration=%H:%M
|
||||
FormatDateTextShort=%d %b %Y
|
||||
FormatDateText=%d %B %Y
|
||||
FormatDateHourShort=%d/%m/%Y %I:%M %p
|
||||
FormatDateHourTextShort=%d %b %Y, %I:%M %p
|
||||
FormatDateHourText=%d %B %Y, %I:%M %p
|
||||
8
htdocs/langs/en_SA/propal.lang
Normal file
8
htdocs/langs/en_SA/propal.lang
Normal file
@@ -0,0 +1,8 @@
|
||||
# Dolibarr language file - en_SA - propal
|
||||
CHARSET=UTF-8
|
||||
Proposals=Commercial Proposals
|
||||
Proposal=Commercial Proposal
|
||||
Prop=Commercial Proposals
|
||||
CommercialProposal=Commercial Proposal
|
||||
CommercialProposals=Commercial Proposals
|
||||
DateEndPropal=Validity Ending Date
|
||||
@@ -13,6 +13,7 @@ Language_en_AU=English (Australia)
|
||||
Language_en_GB=English (United Kingdom)
|
||||
Language_en_IN=English (India)
|
||||
Language_en_NZ=English (New Zealand)
|
||||
Language_en_SA=English (Saudi Arabia)
|
||||
Language_en_US=English (United States)
|
||||
Language_es_ES=Spanish
|
||||
Language_es_AR=Spanish (Argentina)
|
||||
|
||||
@@ -50,7 +50,7 @@ PredefinedMailTest=This is a test mail.\nThe two lines are separated by a carria
|
||||
PredefinedMailTestHtml=This is a <b>test</b> mail (the word test must be in bold).<br>The two lines are separated by a carriage return.
|
||||
PredefinedMailContentSendInvoice=You will find here the invoice __FACREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
|
||||
PredefinedMailContentSendInvoiceReminder=We would like to warn you that the invoice __FACREF__ seems to not being payed. So this is the invoice in attachment again, as a reminder.\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
|
||||
PredefinedMailContentSendProposal=You will find here the commercial propoal __PROPREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
|
||||
PredefinedMailContentSendProposal=You will find here the commercial proposal __PROPREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
|
||||
PredefinedMailContentSendOrder=You will find here the order __ORDERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
|
||||
PredefinedMailContentSendSupplierOrder=You will find here our order __ORDERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
|
||||
PredefinedMailContentSendSupplierInvoice=You will find here the invoice __FACREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
|
||||
@@ -197,4 +197,4 @@ NoExportableData=No exportable data (no modules with exportable data loaded, or
|
||||
ToExport=Export
|
||||
NewExport=New export
|
||||
##### External sites #####
|
||||
ExternalSites=External sites
|
||||
ExternalSites=External sites
|
||||
|
||||
@@ -61,7 +61,7 @@ FileUploaded=The file was successfully uploaded
|
||||
AssociatedDocuments=Documents associated with the proposal:
|
||||
ErrorCantOpenDir=Can't open directory
|
||||
DatePropal=Date of proposal
|
||||
DateEndPropal=Date end validity
|
||||
DateEndPropal=Validity ending date
|
||||
DateEndPropalShort=Date end
|
||||
ValidityDuration=Validity duration
|
||||
CloseAs=Close with status
|
||||
|
||||
@@ -866,8 +866,8 @@ MAIN_PROXY_HOST=Nom/Adresse du serveur proxy mandataire
|
||||
MAIN_PROXY_PORT=Port du serveur proxy mandataire
|
||||
MAIN_PROXY_USER=Login pour passer le serveur proxy mandataire
|
||||
MAIN_PROXY_PASS=Mot de passe pour passer le serveur proxy mandataire
|
||||
DefineHereComplementaryAttributes=Definissez ici la liste des attributs supplémentaire, non disponible en standard, et que vous voulez voir gérez sur les %s.
|
||||
ExtraFields=Attributs suplémentaires
|
||||
DefineHereComplementaryAttributes=Définissez ici la liste des attributs supplémentaires, non disponibles en standard, et que vous voulez voir gérés sur les %s.
|
||||
ExtraFields=Attributs supplémentaires
|
||||
ExtraFieldHasWrongValue=L'attribut %s a une valeur incorrecte.
|
||||
AlphaNumOnlyCharsAndNoSpace=uniquement caractères alphanumériques sans espace
|
||||
SendingMailSetup=Configuration de l'envoi par mail
|
||||
|
||||
@@ -13,6 +13,7 @@ Language_en_AU=Anglais (Australie)
|
||||
Language_en_GB=Anglais (Royaume-Uni)
|
||||
Language_en_IN=Anglais (Inde)
|
||||
Language_en_NZ=Anglais (Nouvelle Zeland)
|
||||
Language_en_SA=Anglais (Arabie Saoudite)
|
||||
Language_en_US=Anglais (Etats-Unis)
|
||||
Language_es_ES=Espagnol
|
||||
Language_es_AR=Espagnol (Argentine)
|
||||
|
||||
@@ -784,7 +784,7 @@ class Livraison extends CommonObject
|
||||
|
||||
// Initialise parametres
|
||||
$this->id=0;
|
||||
$this->ref = 'SPECIMEN_RECEIPT';
|
||||
$this->ref = 'SPECIMEN';
|
||||
$this->specimen=1;
|
||||
$this->socid = 1;
|
||||
$this->date_delivery = $now;
|
||||
|
||||
@@ -876,7 +876,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
||||
print '<!-- Includes for Dolibarr, modules or specific pages-->'."\n";
|
||||
// Output style sheets (optioncss='print' or '')
|
||||
$themepath=dol_buildpath((empty($conf->global->MAIN_FORCETHEMEDIR)?'':$conf->global->MAIN_FORCETHEMEDIR).$conf->css,1);
|
||||
$themeparam='?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss')?'&optioncss='.GETPOST('optioncss','alpha',1):'');
|
||||
$themeparam='?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss')?'&optioncss='.GETPOST('optioncss','alpha',1):'').'&userid='.$user->id.'&entity='.$conf->entity;
|
||||
if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache='.$_SESSION['dol_resetcache'];
|
||||
//print 'themepath='.$themepath.' themeparam='.$themeparam;exit;
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.$themepath.$themeparam.'">'."\n";
|
||||
@@ -885,6 +885,10 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
||||
{
|
||||
foreach($conf->css_modules as $key => $cssfile)
|
||||
{
|
||||
// For compatibility and avoid error if external module use $conf->module_parts
|
||||
// TODO: Removed in 3.3
|
||||
if (is_array($cssfile)) $cssfile = $cssfile[0];
|
||||
|
||||
// cssfile is an absolute path
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
|
||||
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user