]> _ Git - cubeextranet.git/commitdiff
#extranet : new design for invoices & quotation
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 15 Feb 2016 18:44:12 +0000 (18:44 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 15 Feb 2016 18:44:12 +0000 (18:44 +0000)
Add support for 3 and more pages quotes
Set everithing as vector
Fix TVA number not being displayed

20 files changed:
images/extranet/docs/devis.pdf [deleted file]
images/extranet/docs/devis1.pdf [deleted file]
images/extranet/docs/devis2.pdf [deleted file]
images/extranet/docs/devis3.pdf [deleted file]
images/extranet/docs/facture.pdf [deleted file]
images/extranet/docs/klavika-bold.php [deleted file]
images/extranet/docs/klavika-bold.z [deleted file]
images/extranet/docs/klavika-light.php [deleted file]
images/extranet/docs/klavika-light.z [deleted file]
images/extranet/docs/klavika-medium.php [deleted file]
images/extranet/docs/klavika-medium.z [deleted file]
images/extranet/docs/klavika-regular.php [deleted file]
images/extranet/docs/klavika-regular.z [deleted file]
images/extranet/docs/template.pdf [new file with mode: 0644]
inc/commons/Metier/class.common.utilisateur.php
inc/extranet/DAO/class.extranet.dao.devis.php
inc/extranet/DAO/class.extranet.dao.facture.php
inc/extranet/Metier/class.extranet.devis.php
inc/extranet/Metier/class.extranet.document.php
inc/extranet/Metier/class.extranet.facture.php

diff --git a/images/extranet/docs/devis.pdf b/images/extranet/docs/devis.pdf
deleted file mode 100644 (file)
index 36ee4f4..0000000
Binary files a/images/extranet/docs/devis.pdf and /dev/null differ
diff --git a/images/extranet/docs/devis1.pdf b/images/extranet/docs/devis1.pdf
deleted file mode 100644 (file)
index ab19147..0000000
Binary files a/images/extranet/docs/devis1.pdf and /dev/null differ
diff --git a/images/extranet/docs/devis2.pdf b/images/extranet/docs/devis2.pdf
deleted file mode 100644 (file)
index 38e036f..0000000
Binary files a/images/extranet/docs/devis2.pdf and /dev/null differ
diff --git a/images/extranet/docs/devis3.pdf b/images/extranet/docs/devis3.pdf
deleted file mode 100644 (file)
index 38b0fff..0000000
Binary files a/images/extranet/docs/devis3.pdf and /dev/null differ
diff --git a/images/extranet/docs/facture.pdf b/images/extranet/docs/facture.pdf
deleted file mode 100644 (file)
index 9d4faff..0000000
Binary files a/images/extranet/docs/facture.pdf and /dev/null differ
diff --git a/images/extranet/docs/klavika-bold.php b/images/extranet/docs/klavika-bold.php
deleted file mode 100644 (file)
index 5bc9596..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-$type = 'TrueType';
-$name = 'Klavika-Bold';
-$desc = array('Ascent'=>750,'Descent'=>-250,'CapHeight'=>666,'Flags'=>32,'FontBBox'=>'[-26 -303 1245 1055]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>616);
-$up = -123;
-$ut = 20;
-$cw = array(
-       chr(0)=>616,chr(1)=>616,chr(2)=>616,chr(3)=>616,chr(4)=>616,chr(5)=>616,chr(6)=>616,chr(7)=>616,chr(8)=>616,chr(9)=>616,chr(10)=>616,chr(11)=>616,chr(12)=>616,chr(13)=>616,chr(14)=>616,chr(15)=>616,chr(16)=>616,chr(17)=>616,chr(18)=>616,chr(19)=>616,chr(20)=>616,chr(21)=>616,
-       chr(22)=>616,chr(23)=>616,chr(24)=>616,chr(25)=>616,chr(26)=>616,chr(27)=>616,chr(28)=>616,chr(29)=>616,chr(30)=>616,chr(31)=>616,' '=>210,'!'=>284,'"'=>379,'#'=>678,'$'=>502,'%'=>872,'&'=>646,'\''=>199,'('=>326,')'=>326,'*'=>467,'+'=>517,
-       ','=>273,'-'=>338,'.'=>274,'/'=>462,'0'=>552,'1'=>389,'2'=>503,'3'=>487,'4'=>562,'5'=>498,'6'=>518,'7'=>457,'8'=>534,'9'=>513,':'=>274,';'=>273,'<'=>566,'='=>525,'>'=>566,'?'=>485,'@'=>722,'A'=>627,
-       'B'=>572,'C'=>521,'D'=>598,'E'=>534,'F'=>518,'G'=>584,'H'=>645,'I'=>290,'J'=>275,'K'=>617,'L'=>499,'M'=>786,'N'=>676,'O'=>616,'P'=>584,'Q'=>616,'R'=>643,'S'=>544,'T'=>532,'U'=>622,'V'=>590,'W'=>944,
-       'X'=>612,'Y'=>564,'Z'=>566,'['=>319,'\\'=>462,']'=>319,'^'=>466,'_'=>444,'`'=>310,'a'=>499,'b'=>537,'c'=>406,'d'=>537,'e'=>486,'f'=>369,'g'=>484,'h'=>553,'i'=>274,'j'=>264,'k'=>527,'l'=>274,'m'=>837,
-       'n'=>553,'o'=>520,'p'=>537,'q'=>537,'r'=>345,'s'=>433,'t'=>360,'u'=>553,'v'=>500,'w'=>705,'x'=>492,'y'=>495,'z'=>460,'{'=>340,'|'=>260,'}'=>340,'~'=>461,chr(127)=>616,chr(128)=>529,chr(129)=>616,chr(130)=>273,chr(131)=>496,
-       chr(132)=>488,chr(133)=>822,chr(134)=>444,chr(135)=>444,chr(136)=>376,chr(137)=>1285,chr(138)=>544,chr(139)=>343,chr(140)=>892,chr(141)=>616,chr(142)=>566,chr(143)=>616,chr(144)=>616,chr(145)=>268,chr(146)=>258,chr(147)=>483,chr(148)=>483,chr(149)=>348,chr(150)=>478,chr(151)=>628,chr(152)=>417,chr(153)=>452,
-       chr(154)=>433,chr(155)=>343,chr(156)=>782,chr(157)=>616,chr(158)=>460,chr(159)=>564,chr(160)=>210,chr(161)=>284,chr(162)=>426,chr(163)=>543,chr(164)=>584,chr(165)=>548,chr(166)=>260,chr(167)=>535,chr(168)=>434,chr(169)=>766,chr(170)=>377,chr(171)=>560,chr(172)=>507,chr(173)=>616,chr(174)=>451,chr(175)=>344,
-       chr(176)=>373,chr(177)=>517,chr(178)=>394,chr(179)=>367,chr(180)=>310,chr(181)=>553,chr(182)=>538,chr(183)=>274,chr(184)=>286,chr(185)=>356,chr(186)=>401,chr(187)=>560,chr(188)=>868,chr(189)=>878,chr(190)=>885,chr(191)=>485,chr(192)=>627,chr(193)=>627,chr(194)=>627,chr(195)=>627,chr(196)=>627,chr(197)=>627,
-       chr(198)=>855,chr(199)=>521,chr(200)=>534,chr(201)=>534,chr(202)=>534,chr(203)=>534,chr(204)=>290,chr(205)=>290,chr(206)=>290,chr(207)=>290,chr(208)=>624,chr(209)=>676,chr(210)=>616,chr(211)=>616,chr(212)=>616,chr(213)=>616,chr(214)=>616,chr(215)=>480,chr(216)=>616,chr(217)=>622,chr(218)=>622,chr(219)=>622,
-       chr(220)=>622,chr(221)=>564,chr(222)=>584,chr(223)=>590,chr(224)=>499,chr(225)=>499,chr(226)=>499,chr(227)=>499,chr(228)=>499,chr(229)=>499,chr(230)=>746,chr(231)=>406,chr(232)=>486,chr(233)=>486,chr(234)=>486,chr(235)=>486,chr(236)=>274,chr(237)=>274,chr(238)=>274,chr(239)=>274,chr(240)=>490,chr(241)=>553,
-       chr(242)=>520,chr(243)=>520,chr(244)=>520,chr(245)=>520,chr(246)=>520,chr(247)=>524,chr(248)=>520,chr(249)=>553,chr(250)=>553,chr(251)=>553,chr(252)=>553,chr(253)=>495,chr(254)=>537,chr(255)=>495);
-$enc = 'cp1252';
-$uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
-$file = 'klavika-bold.z';
-$originalsize = 19996;
-$subsetted = true;
-?>
diff --git a/images/extranet/docs/klavika-bold.z b/images/extranet/docs/klavika-bold.z
deleted file mode 100644 (file)
index cdfaec2..0000000
Binary files a/images/extranet/docs/klavika-bold.z and /dev/null differ
diff --git a/images/extranet/docs/klavika-light.php b/images/extranet/docs/klavika-light.php
deleted file mode 100644 (file)
index 1e958ed..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-$type = 'TrueType';
-$name = 'Klavika-Light';
-$desc = array('Ascent'=>750,'Descent'=>-250,'CapHeight'=>666,'Flags'=>32,'FontBBox'=>'[-15 -251 1152 934]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>666);
-$up = -123;
-$ut = 20;
-$cw = array(
-       chr(0)=>666,chr(1)=>666,chr(2)=>666,chr(3)=>666,chr(4)=>666,chr(5)=>666,chr(6)=>666,chr(7)=>666,chr(8)=>666,chr(9)=>666,chr(10)=>666,chr(11)=>666,chr(12)=>666,chr(13)=>666,chr(14)=>666,chr(15)=>666,chr(16)=>666,chr(17)=>666,chr(18)=>666,chr(19)=>666,chr(20)=>666,chr(21)=>666,
-       chr(22)=>666,chr(23)=>666,chr(24)=>666,chr(25)=>666,chr(26)=>666,chr(27)=>666,chr(28)=>666,chr(29)=>666,chr(30)=>666,chr(31)=>666,' '=>220,'!'=>252,'"'=>354,'#'=>719,'$'=>511,'%'=>843,'&'=>617,'\''=>201,'('=>301,')'=>301,'*'=>477,'+'=>536,
-       ','=>241,'-'=>362,'.'=>242,'/'=>440,'0'=>560,'1'=>326,'2'=>484,'3'=>491,'4'=>540,'5'=>495,'6'=>518,'7'=>427,'8'=>554,'9'=>513,':'=>242,';'=>241,'<'=>550,'='=>509,'>'=>550,'?'=>458,'@'=>751,'A'=>621,
-       'B'=>559,'C'=>511,'D'=>590,'E'=>536,'F'=>511,'G'=>571,'H'=>620,'I'=>249,'J'=>234,'K'=>569,'L'=>494,'M'=>795,'N'=>638,'O'=>616,'P'=>544,'Q'=>616,'R'=>619,'S'=>544,'T'=>519,'U'=>630,'V'=>590,'W'=>890,
-       'X'=>580,'Y'=>543,'Z'=>576,'['=>311,'\\'=>440,']'=>311,'^'=>454,'_'=>434,'`'=>310,'a'=>485,'b'=>508,'c'=>400,'d'=>513,'e'=>479,'f'=>357,'g'=>513,'h'=>521,'i'=>228,'j'=>223,'k'=>471,'l'=>228,'m'=>819,
-       'n'=>521,'o'=>498,'p'=>511,'q'=>508,'r'=>312,'s'=>435,'t'=>371,'u'=>521,'v'=>449,'w'=>702,'x'=>441,'y'=>444,'z'=>437,'{'=>309,'|'=>249,'}'=>309,'~'=>495,chr(127)=>666,chr(128)=>553,chr(129)=>666,chr(130)=>241,chr(131)=>507,
-       chr(132)=>396,chr(133)=>706,chr(134)=>496,chr(135)=>496,chr(136)=>397,chr(137)=>1212,chr(138)=>544,chr(139)=>292,chr(140)=>895,chr(141)=>666,chr(142)=>576,chr(143)=>666,chr(144)=>666,chr(145)=>241,chr(146)=>221,chr(147)=>396,chr(148)=>396,chr(149)=>382,chr(150)=>496,chr(151)=>626,chr(152)=>410,chr(153)=>522,
-       chr(154)=>435,chr(155)=>292,chr(156)=>799,chr(157)=>666,chr(158)=>437,chr(159)=>543,chr(160)=>220,chr(161)=>252,chr(162)=>420,chr(163)=>545,chr(164)=>540,chr(165)=>543,chr(166)=>249,chr(167)=>560,chr(168)=>392,chr(169)=>826,chr(170)=>378,chr(171)=>478,chr(172)=>566,chr(173)=>666,chr(174)=>501,chr(175)=>376,
-       chr(176)=>358,chr(177)=>566,chr(178)=>386,chr(179)=>374,chr(180)=>310,chr(181)=>521,chr(182)=>502,chr(183)=>242,chr(184)=>313,chr(185)=>329,chr(186)=>392,chr(187)=>478,chr(188)=>819,chr(189)=>828,chr(190)=>849,chr(191)=>458,chr(192)=>621,chr(193)=>621,chr(194)=>621,chr(195)=>621,chr(196)=>621,chr(197)=>621,
-       chr(198)=>839,chr(199)=>511,chr(200)=>536,chr(201)=>536,chr(202)=>536,chr(203)=>536,chr(204)=>249,chr(205)=>249,chr(206)=>249,chr(207)=>249,chr(208)=>627,chr(209)=>638,chr(210)=>616,chr(211)=>616,chr(212)=>616,chr(213)=>616,chr(214)=>616,chr(215)=>548,chr(216)=>616,chr(217)=>630,chr(218)=>630,chr(219)=>630,
-       chr(220)=>630,chr(221)=>543,chr(222)=>544,chr(223)=>593,chr(224)=>485,chr(225)=>485,chr(226)=>485,chr(227)=>485,chr(228)=>485,chr(229)=>485,chr(230)=>771,chr(231)=>400,chr(232)=>479,chr(233)=>479,chr(234)=>479,chr(235)=>479,chr(236)=>228,chr(237)=>228,chr(238)=>228,chr(239)=>228,chr(240)=>513,chr(241)=>521,
-       chr(242)=>498,chr(243)=>498,chr(244)=>498,chr(245)=>498,chr(246)=>498,chr(247)=>566,chr(248)=>498,chr(249)=>521,chr(250)=>521,chr(251)=>521,chr(252)=>521,chr(253)=>444,chr(254)=>518,chr(255)=>444);
-$enc = 'cp1252';
-$uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
-$file = 'klavika-light.z';
-$originalsize = 20264;
-$subsetted = true;
-?>
diff --git a/images/extranet/docs/klavika-light.z b/images/extranet/docs/klavika-light.z
deleted file mode 100644 (file)
index a224fe7..0000000
Binary files a/images/extranet/docs/klavika-light.z and /dev/null differ
diff --git a/images/extranet/docs/klavika-medium.php b/images/extranet/docs/klavika-medium.php
deleted file mode 100644 (file)
index a9ca27d..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-$type = 'TrueType';
-$name = 'Klavika-Medium';
-$desc = array('Ascent'=>750,'Descent'=>-250,'CapHeight'=>666,'Flags'=>32,'FontBBox'=>'[-20 -295 1203 1008]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>636);
-$up = -123;
-$ut = 20;
-$cw = array(
-       chr(0)=>636,chr(1)=>636,chr(2)=>636,chr(3)=>636,chr(4)=>636,chr(5)=>636,chr(6)=>636,chr(7)=>636,chr(8)=>636,chr(9)=>636,chr(10)=>636,chr(11)=>636,chr(12)=>636,chr(13)=>636,chr(14)=>636,chr(15)=>636,chr(16)=>636,chr(17)=>636,chr(18)=>636,chr(19)=>636,chr(20)=>636,chr(21)=>636,
-       chr(22)=>636,chr(23)=>636,chr(24)=>636,chr(25)=>636,chr(26)=>636,chr(27)=>636,chr(28)=>636,chr(29)=>636,chr(30)=>636,chr(31)=>636,' '=>210,'!'=>284,'"'=>387,'#'=>698,'$'=>506,'%'=>877,'&'=>655,'\''=>207,'('=>335,')'=>335,'*'=>502,'+'=>528,
-       ','=>274,'-'=>372,'.'=>274,'/'=>459,'0'=>562,'1'=>384,'2'=>501,'3'=>492,'4'=>565,'5'=>502,'6'=>526,'7'=>460,'8'=>546,'9'=>521,':'=>274,';'=>274,'<'=>586,'='=>539,'>'=>586,'?'=>491,'@'=>738,'A'=>646,
-       'B'=>577,'C'=>523,'D'=>604,'E'=>538,'F'=>522,'G'=>584,'H'=>649,'I'=>286,'J'=>271,'K'=>612,'L'=>505,'M'=>816,'N'=>694,'O'=>624,'P'=>576,'Q'=>624,'R'=>650,'S'=>540,'T'=>548,'U'=>632,'V'=>600,'W'=>944,
-       'X'=>612,'Y'=>566,'Z'=>575,'['=>328,'\\'=>459,']'=>328,'^'=>475,'_'=>439,'`'=>314,'a'=>491,'b'=>528,'c'=>419,'d'=>533,'e'=>481,'f'=>363,'g'=>489,'h'=>545,'i'=>262,'j'=>255,'k'=>508,'l'=>262,'m'=>833,
-       'n'=>545,'o'=>520,'p'=>533,'q'=>528,'r'=>333,'s'=>447,'t'=>355,'u'=>545,'v'=>483,'w'=>704,'x'=>468,'y'=>478,'z'=>460,'{'=>340,'|'=>255,'}'=>340,'~'=>482,chr(127)=>636,chr(128)=>538,chr(129)=>636,chr(130)=>274,chr(131)=>488,
-       chr(132)=>474,chr(133)=>822,chr(134)=>485,chr(135)=>485,chr(136)=>389,chr(137)=>1258,chr(138)=>540,chr(139)=>298,chr(140)=>896,chr(141)=>636,chr(142)=>575,chr(143)=>636,chr(144)=>636,chr(145)=>274,chr(146)=>264,chr(147)=>474,chr(148)=>474,chr(149)=>369,chr(150)=>500,chr(151)=>645,chr(152)=>423,chr(153)=>501,
-       chr(154)=>447,chr(155)=>298,chr(156)=>783,chr(157)=>636,chr(158)=>460,chr(159)=>566,chr(160)=>210,chr(161)=>284,chr(162)=>439,chr(163)=>542,chr(164)=>563,chr(165)=>558,chr(166)=>255,chr(167)=>548,chr(168)=>410,chr(169)=>796,chr(170)=>385,chr(171)=>504,chr(172)=>543,chr(173)=>636,chr(174)=>471,chr(175)=>360,
-       chr(176)=>357,chr(177)=>558,chr(178)=>400,chr(179)=>396,chr(180)=>314,chr(181)=>545,chr(182)=>526,chr(183)=>274,chr(184)=>300,chr(185)=>347,chr(186)=>387,chr(187)=>504,chr(188)=>858,chr(189)=>884,chr(190)=>891,chr(191)=>491,chr(192)=>646,chr(193)=>646,chr(194)=>646,chr(195)=>646,chr(196)=>646,chr(197)=>646,
-       chr(198)=>862,chr(199)=>523,chr(200)=>538,chr(201)=>538,chr(202)=>538,chr(203)=>538,chr(204)=>286,chr(205)=>286,chr(206)=>286,chr(207)=>286,chr(208)=>638,chr(209)=>694,chr(210)=>624,chr(211)=>624,chr(212)=>624,chr(213)=>624,chr(214)=>624,chr(215)=>495,chr(216)=>624,chr(217)=>632,chr(218)=>632,chr(219)=>632,
-       chr(220)=>632,chr(221)=>566,chr(222)=>576,chr(223)=>612,chr(224)=>491,chr(225)=>491,chr(226)=>491,chr(227)=>491,chr(228)=>491,chr(229)=>491,chr(230)=>742,chr(231)=>419,chr(232)=>481,chr(233)=>481,chr(234)=>481,chr(235)=>481,chr(236)=>262,chr(237)=>262,chr(238)=>262,chr(239)=>262,chr(240)=>504,chr(241)=>545,
-       chr(242)=>520,chr(243)=>520,chr(244)=>520,chr(245)=>520,chr(246)=>520,chr(247)=>542,chr(248)=>520,chr(249)=>545,chr(250)=>545,chr(251)=>545,chr(252)=>545,chr(253)=>478,chr(254)=>533,chr(255)=>478);
-$enc = 'cp1252';
-$uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
-$file = 'klavika-medium.z';
-$originalsize = 20280;
-$subsetted = true;
-?>
diff --git a/images/extranet/docs/klavika-medium.z b/images/extranet/docs/klavika-medium.z
deleted file mode 100644 (file)
index c927a3f..0000000
Binary files a/images/extranet/docs/klavika-medium.z and /dev/null differ
diff --git a/images/extranet/docs/klavika-regular.php b/images/extranet/docs/klavika-regular.php
deleted file mode 100644 (file)
index 386ce6b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-$type = 'TrueType';
-$name = 'Klavika-Regular';
-$desc = array('Ascent'=>750,'Descent'=>-250,'CapHeight'=>666,'Flags'=>32,'FontBBox'=>'[-16 -259 1157 985]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>656);
-$up = -123;
-$ut = 20;
-$cw = array(
-       chr(0)=>656,chr(1)=>656,chr(2)=>656,chr(3)=>656,chr(4)=>656,chr(5)=>656,chr(6)=>656,chr(7)=>656,chr(8)=>656,chr(9)=>656,chr(10)=>656,chr(11)=>656,chr(12)=>656,chr(13)=>656,chr(14)=>656,chr(15)=>656,chr(16)=>656,chr(17)=>656,chr(18)=>656,chr(19)=>656,chr(20)=>656,chr(21)=>656,
-       chr(22)=>656,chr(23)=>656,chr(24)=>656,chr(25)=>656,chr(26)=>656,chr(27)=>656,chr(28)=>656,chr(29)=>656,chr(30)=>656,chr(31)=>656,' '=>215,'!'=>266,'"'=>375,'#'=>707,'$'=>518,'%'=>841,'&'=>616,'\''=>209,'('=>304,')'=>304,'*'=>473,'+'=>526,
-       ','=>254,'-'=>370,'.'=>256,'/'=>446,'0'=>552,'1'=>350,'2'=>486,'3'=>487,'4'=>537,'5'=>496,'6'=>512,'7'=>440,'8'=>544,'9'=>512,':'=>256,';'=>254,'<'=>558,'='=>509,'>'=>558,'?'=>476,'@'=>744,'A'=>622,
-       'B'=>571,'C'=>516,'D'=>597,'E'=>540,'F'=>521,'G'=>578,'H'=>637,'I'=>266,'J'=>256,'K'=>588,'L'=>500,'M'=>798,'N'=>660,'O'=>622,'P'=>557,'Q'=>622,'R'=>632,'S'=>540,'T'=>524,'U'=>632,'V'=>592,'W'=>908,
-       'X'=>589,'Y'=>548,'Z'=>580,'['=>309,'\\'=>441,']'=>309,'^'=>460,'_'=>430,'`'=>313,'a'=>493,'b'=>519,'c'=>409,'d'=>523,'e'=>481,'f'=>353,'g'=>490,'h'=>533,'i'=>244,'j'=>239,'k'=>484,'l'=>244,'m'=>827,
-       'n'=>533,'o'=>506,'p'=>523,'q'=>519,'r'=>308,'s'=>439,'t'=>369,'u'=>533,'v'=>450,'w'=>696,'x'=>448,'y'=>448,'z'=>459,'{'=>313,'|'=>257,'}'=>313,'~'=>500,chr(127)=>656,chr(128)=>543,chr(129)=>656,chr(130)=>254,chr(131)=>495,
-       chr(132)=>433,chr(133)=>768,chr(134)=>485,chr(135)=>485,chr(136)=>396,chr(137)=>1212,chr(138)=>540,chr(139)=>290,chr(140)=>910,chr(141)=>656,chr(142)=>580,chr(143)=>656,chr(144)=>656,chr(145)=>254,chr(146)=>239,chr(147)=>433,chr(148)=>433,chr(149)=>373,chr(150)=>486,chr(151)=>612,chr(152)=>417,chr(153)=>511,
-       chr(154)=>439,chr(155)=>290,chr(156)=>793,chr(157)=>656,chr(158)=>459,chr(159)=>548,chr(160)=>215,chr(161)=>266,chr(162)=>424,chr(163)=>533,chr(164)=>556,chr(165)=>550,chr(166)=>257,chr(167)=>551,chr(168)=>391,chr(169)=>805,chr(170)=>379,chr(171)=>484,chr(172)=>551,chr(173)=>656,chr(174)=>471,chr(175)=>371,
-       chr(176)=>348,chr(177)=>546,chr(178)=>388,chr(179)=>386,chr(180)=>313,chr(181)=>533,chr(182)=>514,chr(183)=>256,chr(184)=>310,chr(185)=>333,chr(186)=>394,chr(187)=>484,chr(188)=>835,chr(189)=>851,chr(190)=>870,chr(191)=>476,chr(192)=>622,chr(193)=>622,chr(194)=>622,chr(195)=>622,chr(196)=>622,chr(197)=>622,
-       chr(198)=>839,chr(199)=>516,chr(200)=>540,chr(201)=>540,chr(202)=>540,chr(203)=>540,chr(204)=>266,chr(205)=>266,chr(206)=>266,chr(207)=>266,chr(208)=>631,chr(209)=>660,chr(210)=>622,chr(211)=>622,chr(212)=>622,chr(213)=>622,chr(214)=>622,chr(215)=>523,chr(216)=>622,chr(217)=>632,chr(218)=>632,chr(219)=>632,
-       chr(220)=>632,chr(221)=>548,chr(222)=>554,chr(223)=>594,chr(224)=>493,chr(225)=>493,chr(226)=>493,chr(227)=>493,chr(228)=>493,chr(229)=>493,chr(230)=>767,chr(231)=>409,chr(232)=>481,chr(233)=>481,chr(234)=>481,chr(235)=>481,chr(236)=>244,chr(237)=>244,chr(238)=>244,chr(239)=>244,chr(240)=>518,chr(241)=>533,
-       chr(242)=>506,chr(243)=>506,chr(244)=>506,chr(245)=>506,chr(246)=>506,chr(247)=>538,chr(248)=>506,chr(249)=>533,chr(250)=>533,chr(251)=>533,chr(252)=>533,chr(253)=>448,chr(254)=>523,chr(255)=>448);
-$enc = 'cp1252';
-$uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
-$file = 'klavika-regular.z';
-$originalsize = 20044;
-$subsetted = true;
-?>
diff --git a/images/extranet/docs/klavika-regular.z b/images/extranet/docs/klavika-regular.z
deleted file mode 100644 (file)
index 6e781ef..0000000
Binary files a/images/extranet/docs/klavika-regular.z and /dev/null differ
diff --git a/images/extranet/docs/template.pdf b/images/extranet/docs/template.pdf
new file mode 100644 (file)
index 0000000..347dff2
Binary files /dev/null and b/images/extranet/docs/template.pdf differ
index 8435967a2363fa36d4c4078f519a47dc219d80cc..e7c462e6c1cea57ffd1791c5d5cfced78182dd33 100644 (file)
@@ -32,6 +32,7 @@ class commonUtilisateur extends cubeMetier {
        protected $ws_rights;\r
        protected $ws_signatures;\r
        protected $ws_domains;\r
+       protected $ca;\r
        protected $enabled;\r
 \r
        public function getEmail() {\r
index 6a4f12effba42963f8edfdc3ccf2420a741d763a..705241f0e8e3612f4cb6c24f1b2f88fe1d9cb8d8 100644 (file)
@@ -220,7 +220,7 @@ class extranetDAODevis extends commonDAO {
                if (file_exists(ROOT . '/docs/devis/' . $devis->devis_id . '.pdf')) {\r
                        rename(ROOT . '/docs/devis/' . $devis->devis_id . '.pdf', ROOT . '/docs/devis/' . $devis->devis_id . '_' . filemtime(ROOT . '/docs/devis/' . $devis->devis_id . '.pdf') . '.pdf');\r
                }\r
-               $pdf->Output(ROOT . '/docs/devis/' . $devis->devis_id . '.pdf');\r
+               $pdf->Output('F',ROOT . '/docs/devis/' . $devis->devis_id . '.pdf');\r
                // Restaure les paramètres de langue de l'utilisateur\r
                global $core;\r
                cubeLang::set($core->user->lang);\r
index 888f2965e5966f2b608f473f82e201d6edc8135f..98019000e10366974fcfc73e346ef2bbdb74d60c 100644 (file)
@@ -256,7 +256,7 @@ class extranetDAOFacture extends commonDAO {
        public function saveAsPDF($facture_id) {\r
                $facture = $this->selectById($facture_id);\r
                $daoUtilisateur = new commonDAOUtilisateur($this->con);\r
-               $facture->client = $daoUtilisateur->selectById($facture->client_id);\r
+               $facture->client = $daoUtilisateur->selectById($facture->client_id,'clients');\r
                $facture->createur = $daoUtilisateur->selectById($facture->createur_id);\r
                if ($facture->status == 4) {\r
                        $facture->avoir = $this->selectById($facture->avoir);\r
@@ -267,7 +267,7 @@ class extranetDAOFacture extends commonDAO {
                if (file_exists(ROOT . '/docs/factures/' . $facture->facture_id . '.pdf')) {\r
                        rename(ROOT . '/docs/factures/' . $facture->facture_id . '.pdf', ROOT . '/docs/factures/' . $facture->facture_id . '_' . filemtime(ROOT . '/docs/factures/' . $facture->facture_id . '.pdf') . '.pdf');\r
                }\r
-               $pdf->Output(ROOT . '/docs/factures/' . $facture->facture_id . '.pdf');\r
+               $pdf->Output('F', ROOT . '/docs/factures/' . $facture->facture_id . '.pdf');\r
        }\r
 \r
        public function savePaiement($data) {\r
index 3b3342d0dbb80f0442774ed199361695a544af18..ae624c2e1f927122e88715fd6239b86629810931 100644 (file)
@@ -1,32 +1,23 @@
 <?php\r
+\r
 class extranetDevis extends extranetDocument {\r
        protected $devis_id;\r
        protected $email;\r
 \r
-       public function getBackground()\r
-       {\r
-               $this->fond = SYSIMG . '/devis.png';\r
-               $this->fond1 = SYSIMG . '/devis2page1.png';\r
-               $this->fond2 = SYSIMG . '/devis2page2.png';\r
+       public function getBackground() {\r
+               $this->fond = 1;\r
+               $this->fond1 = 2;\r
+               $this->fond2 = 3;\r
+               $this->fond3 = 4;\r
        }\r
 \r
-       protected function documentTitre()\r
-       {\r
+       protected function documentTitre() {\r
                $lang = $this->client->lang;\r
-               $titre = __('DEVIS') . "\n";\r
-               if ($lang == 'fr') {\r
-                       $titre .= strftime('%d %B %Y', $this->date_creation);\r
-               } else {\r
-                       $titre .= date('F jS Y');\r
-               }\r
-               $titre .= "\n\n" . $this->nom;\r
+               $titre = __('DEVIS');\r
                return $titre;\r
        }\r
 \r
-       protected function isFacture()\r
-       {\r
+       protected function isFacture() {\r
                return false;\r
        }\r
 }\r
-\r
-?>
\ No newline at end of file
index 81510f7b29301c3e30065ce531f871f2245e69af..eb93d5d71beac404a783d179be9eaad55ffa3473 100644 (file)
@@ -12,31 +12,51 @@ abstract class extranetDocument extends cubeMetier {
        protected $fond;\r
        protected $fond1;\r
        protected $fond2;\r
+       protected $fond3;\r
        protected $adresse;\r
        // Attributs composés\r
        protected $createur;\r
        protected $client;\r
+       protected $pdf;\r
+       protected $euro;\r
 \r
        public function saveAsPDF() {\r
-               $cesure = $this->testPDF();\r
-               if ($this->isFacture() && $cesure) {\r
-                       $cesure = false;\r
+               $pdf = $this->testPDF();\r
+               $pages = $pdf['pages'];\r
+               $cesures = $pdf['cesures'];\r
+               if ($this->isFacture() && $pages > 1) {\r
+                       $pages = 1;\r
                        $displayDescription = false;\r
                } else {\r
                        $displayDescription = true;\r
                }\r
 \r
-               $pdf = new FPDF('P', 'mm', 'A4');\r
-               $pdf->SetAutoPageBreak(false);\r
+               $template = ROOT . '/images/extranet/docs/';\r
+\r
+\r
+               $this->euro = ' ' . chr(128);\r
+\r
+               $this->pdf = new FPDI();\r
+               $this->pdf->SetAutoPageBreak(false);\r
+               $this->pdf->setSourceFile($template . 'template.pdf');\r
+\r
+               $this->pdf->AddFont('KlavikaLight', '', 'klavika-light.php');\r
+               $this->pdf->AddFont('KlavikaLight', 'B', 'klavika-medium.php');\r
+               $this->pdf->AddFont('Klavika', '', 'klavika-regular.php');\r
+               $this->pdf->AddFont('Klavika', 'B', 'klavika-bold.php');\r
+\r
                $this->getBackground();\r
-               if (!$cesure) {\r
-                       $pdf->AddPage();\r
-                       $pdf->Image($this->fond, 10, 10, 194.1);\r
+\r
+               $page = 1;\r
+\r
+               if ($pages == 1) {\r
+                       $this->addPage($this->fond);\r
                } else {\r
-                       $pdf->AddPage();\r
-                       $pdf->Image($this->fond1, 10, 10, 194.1);\r
+                       $this->addPage($this->fond1);\r
                }\r
-               $pdf->SetTextColor(0, 0, 0);\r
+\r
+               $this->pdf->SetTextColor(0, 0, 0);\r
+\r
                // Bloc adresse\r
                if (trim($this->adresse) == '') {\r
                        $client = self::escape($this->client->rs);\r
@@ -48,12 +68,12 @@ abstract class extranetDocument extends cubeMetier {
                        $client = self::escape($l0);\r
                        $adresse = self::escape(implode("\n", $l));\r
                }\r
-               $pdf->SetXY(114, 45);\r
-               $pdf->SetFont('Helvetica', 'B', 11);\r
-               $pdf->MultiCell(80, 8, $client, 0, 2);\r
-               $pdf->SetX(114);\r
-               $pdf->SetFont('Helvetica', '', 11);\r
-               $pdf->MultiCell(80, 6, $adresse);\r
+               $this->pdf->SetXY(114, 45);\r
+               $this->pdf->SetFont('KlavikaLight', 'B', 12);\r
+               $this->pdf->MultiCell(80, 8, $client, 0, 2);\r
+               $this->pdf->SetX(114);\r
+               $this->pdf->SetFont('KlavikaLight', '', 12);\r
+               $this->pdf->MultiCell(80, 6, $adresse);\r
                // Bloc TVA Intra\r
                if ($this instanceof extranetFacture) {\r
                        $texte_tva = '';\r
@@ -64,45 +84,65 @@ abstract class extranetDocument extends cubeMetier {
                                $texte_tva .= $this->texte_complementaire;\r
                        }\r
                        if ($texte_tva != '') {\r
-                               $pdf->SetFont('Helvetica', '', 8);\r
-                               $pdf->setXY(114, 80);\r
-                               $pdf->MultiCell(80, 6, self::escape(trim($texte_tva)));\r
+                               $this->pdf->SetFont('KlavikaLight', '', 8);\r
+                               $this->pdf->setXY(114, 90);\r
+                               $this->pdf->MultiCell(80, 4, self::escape(trim($texte_tva)));\r
                        }\r
                }\r
                // Bloc titre\r
-               $pdf->SetXY(15, 70);\r
+               $this->pdf->SetXY(6, 60);\r
                $titre = $this->documentTitre($this->client->lang);\r
-               $pdf->SetFont('Helvetica', 'B', 10);\r
-               $pdf->MultiCell(73, 4, self::escape($titre), 0, 'L');\r
+               $this->pdf->SetFont('KlavikaLight', 'B', 15);\r
+               $this->pdf->MultiCell(73, 4, self::escape($titre), 0, 'L');\r
+\r
+               $this->pdf->SetXY(6, $this->pdf->GetY() + 3);\r
+               $this->pdf->SetFont('KlavikaLight', '', 11);\r
+               $titre = '';\r
+               if ($this->client->lang == 'fr') {\r
+                       $titre .= strftime('%d %B %Y', $this->date_creation);\r
+               } else {\r
+                       $titre .= date('F jS Y');\r
+               }\r
+               $titre .= "\n\n" . $this->nom;\r
+               $this->pdf->MultiCell(73, 4, self::escape($titre), 0, 'L');\r
+\r
                // blocs\r
-               $pdf->setY(105);\r
+               $this->pdf->setY(115);\r
                foreach ($this->lignes as $i => $ligne) {\r
-                       if ($cesure && $i == $cesure) {\r
-                               fb($pdf);\r
-                               $pdf->AddPage();\r
-                               $pdf->Image($this->fond2, 10, 10, 194.1);\r
-                               $pdf->setY(20);\r
+                       if ($pages > 1 && $i == $cesures[$page]) {\r
+                               $page++;\r
+                               fb($page . '=?' . $pages);\r
+\r
+                               if ($page == $pages) {\r
+                                       $tpl = $this->fond3;\r
+                               } else {\r
+                                       $tpl = $this->fond2;\r
+                               }\r
+\r
+                               $this->addPage($tpl);\r
+                               $this->pdf->setY(25);\r
                        }\r
 \r
-                       $y = $pdf->getY() + 5;\r
+                       $y = $this->pdf->getY() + 5;\r
 \r
-                       $pdf->SetFont('Helvetica', 'B', 10);\r
+                       $this->pdf->SetFont('Klavika', '', 10);\r
                        // Prix\r
-                       $pdf->SetXY(170, $y);\r
+                       $this->pdf->SetXY(170, $y);\r
                        $ligne['montant'] = trim($ligne['montant']);\r
                        if (is_numeric($ligne['montant'])) {\r
-                               $pdf->Cell(30, 4, cubePrices::formatAmount($ligne['montant'], $this->client->lang) . ' euros', 0, 0, 'R');\r
+                               $this->pdf->Cell(33, 4, cubePrices::formatAmount($ligne['montant'], $this->client->lang) . $this->euro, 0, 0, 'R');\r
                        } else {\r
-                               $pdf->Cell(30, 4, self::escape($ligne['montant']), 0, 0, 'R');\r
+                               $this->pdf->Cell(33, 4, self::escape($ligne['montant']), 0, 0, 'R');\r
                        }\r
                        // Titre\r
-                       $pdf->setXY(13, $y);\r
-                       $pdf->Cell(151, 4, self::escape(trim($ligne['titre'])), 0, 1);\r
+                       $this->pdf->SetFont('Klavika', 'B', 10);\r
+                       $this->pdf->setXY(6, $y);\r
+                       $this->pdf->Cell(171, 4, self::escape(trim($ligne['titre'])), 0, 1);\r
                        // Contenu\r
                        if ($displayDescription) {\r
-                               $pdf->SetX(13);\r
-                               $pdf->SetFont('Helvetica', '', 10);\r
-                               $pdf->MultiCell(151, 4, self::escape($ligne['description']));\r
+                               $this->pdf->SetXY(6, $this->pdf->getY() + 1);\r
+                               $this->pdf->SetFont('Klavika', '', 10);\r
+                               $this->pdf->MultiCell(171, 4, self::escape($ligne['description']));\r
                        }\r
                }\r
                // Prix\r
@@ -120,78 +160,131 @@ abstract class extranetDocument extends cubeMetier {
                $ttcf = cubePrices::formatAmount($ttc, $this->client->lang);\r
                $taxes = ($tva > 0) ? cubePrices::formatAmount($ttc - $this->total_ht, $this->client->lang, 2) : '';\r
                // Affichage du montant hors taxes\r
-               $pdf->setFont('Helvetica', 'B', 10);\r
-               if ($cesure) {\r
-                       $pdf->SetXY(170, 210);\r
+               $this->pdf->setFont('KlavikaLight', 'B', 10);\r
+               if ($pages == 1) {\r
+                       //$this->pdf->SetXY(170, 210);\r
+                       $this->pdf->SetXY(170, 218.5);\r
+                       $space = 9.5;\r
                } else {\r
-                       $pdf->SetXY(170, 223);\r
+                       $this->pdf->SetXY(170, 218);\r
+                       $space = 9.7;\r
                }\r
-               $space = 8.5;\r
-               $pdf->Cell(30, $space, cubePrices::formatAmount($this->total_ht, $this->client->lang) . ' euros', 0, 1, 'R');\r
-               $pdf->SetX(170);\r
-               $pdf->setFont('Helvetica', '', 10);\r
+               $this->pdf->Cell(32, $space, cubePrices::formatAmount($this->total_ht, $this->client->lang) . $this->euro, 0, 1, 'R');\r
+               $this->pdf->SetX(170);\r
+               $this->pdf->setFont('KlavikaLight', '', 10);\r
                // Affichage du taux de tva et du montant des taxes\r
-               $pdf->Cell(30, $space, $tva_text, 0, 1, 'R');\r
-               $pdf->SetX(170);\r
+               $this->pdf->Cell(32, $space, $tva_text, 0, 1, 'R');\r
+               $this->pdf->SetX(170);\r
                if ($tva) {\r
-                       $pdf->Cell(31, $space, $taxes . ' euros', 0, 1, 'R');\r
+                       $this->pdf->Cell(32, $space, $taxes . $this->euro, 0, 1, 'R');\r
                } else {\r
-                       $pdf->Cell(31, $space, '-', 0, 1, 'R');\r
+                       $this->pdf->Cell(32, $space, '-', 0, 1, 'R');\r
                }\r
-               $pdf->SetX(170);\r
+               $this->pdf->SetX(170);\r
 \r
-               $pdf->SetTextColor(255, 255, 255);\r
-               $pdf->setFont('Helvetica', 'B', 10);\r
-               $pdf->Cell(30, $space, $ttcf . ' euros', 0, 1, 'R');\r
+               $this->pdf->SetTextColor(255, 255, 255);\r
+               $this->pdf->setFont('KlavikaLight', 'B', 10);\r
+               $this->pdf->Cell(32, $space + 1, $ttcf . $this->euro, 0, 1, 'R');\r
 \r
                if (isset($notes)) {\r
-                       $pdf->setXY(8, 268);\r
-                       $pdf->setTextColor(0, 0, 0);\r
-                       $pdf->setFont('Helvetica', '', 8);\r
-                       $pdf->Cell(195, 0, self::escape($notes), 0, 1, 'R');\r
+                       $this->pdf->setXY(8, 268);\r
+                       $this->pdf->setTextColor(0, 0, 0);\r
+                       $this->pdf->setFont('Klavika', '', 8);\r
+                       $this->pdf->Cell(195, 0, self::escape($notes), 0, 1, 'R');\r
                }\r
-               return $pdf;\r
+               return $this->pdf;\r
+       }\r
+\r
+       public function addPage($page) {\r
+               $templateIndex = $this->pdf->importPage($page);\r
+               $this->pdf->AddPage();\r
+               $this->pdf->useTemplate($templateIndex);\r
        }\r
 \r
        protected function testPDF() {\r
-               $pdf = new FPDF('P', 'mm', 'A4');\r
+               $pdf = new FPDF('P', 'mm', array(210, 2000));\r
+               $pdf->AddFont('KlavikaLight', '', 'klavika-light.php');\r
+               $pdf->AddFont('KlavikaLight', 'B', 'klavika-medium.php');\r
+               $pdf->AddFont('Klavika', '', 'klavika-regular.php');\r
+               $pdf->AddFont('Klavika', 'B', 'klavika-bold.php');\r
                $pdf->AddPage();\r
                $pdf->SetAutoPageBreak(false);\r
-               $pdf->setY(105);\r
-               $pages = 1;\r
+\r
+               $lines = array();\r
+\r
+               $lastY = -5;\r
                foreach ($this->lignes as $i => $ligne) {\r
                        $y = $pdf->getY() + 5;\r
 \r
-                       $pdf->SetFont('Helvetica', 'B', 10);\r
+                       $pdf->SetFont('Klavika', 'B', 10);\r
                        // Prix\r
                        $pdf->SetXY(170, $y);\r
                        $ligne['montant'] = trim($ligne['montant']);\r
                        if (is_numeric($ligne['montant'])) {\r
-                               $pdf->Cell(30, 4, cubePrices::formatAmount($ligne['montant'], $this->client->lang) . ' euros', 0, 0, 'R');\r
+                               $pdf->Cell(33, 4, cubePrices::formatAmount($ligne['montant'], $this->client->lang) . $this->euro, 0, 0, 'R');\r
                        } else {\r
-                               $pdf->Cell(30, 4, self::escape($ligne['montant']), 0, 0, 'R');\r
+                               $pdf->Cell(33, 4, self::escape($ligne['montant']), 0, 0, 'R');\r
                        }\r
                        // Titre\r
                        $pdf->setXY(13, $y);\r
                        $pdf->Cell(151, 4, self::escape(trim($ligne['titre'])), 0, 1);\r
                        // Contenu\r
                        $pdf->SetX(13);\r
-                       $pdf->SetFont('Helvetica', '', 10);\r
-                       $pdf->MultiCell(151, 4, self::escape(trim($ligne['description'])));\r
-                       fb($pdf->getY());\r
-                       if ($pdf->getY() > 225) {\r
-                               $pages = 2;\r
-                       }\r
-                       if ($pdf->getY() > 280) {\r
-                               return $i;\r
-                       }\r
+                       $pdf->SetFont('Klavika', '', 10);\r
+                       $pdf->MultiCell(171, 4, self::escape(trim($ligne['description'])));\r
+\r
+                       $y = $pdf->getY();\r
+                       $lines[] = $y - $lastY;\r
+                       $lastY = $y;\r
                }\r
 \r
-               if ($pages == 1) {\r
-                       return false;\r
+               $cesures = array();\r
+               $h = $pdf->getY();\r
+               if ($h <= 105) {\r
+                       $pages = 1;\r
+               } elseif ($h <= 355) {\r
+                       $pages = 2;\r
                } else {\r
-                       return $i;\r
+                       $pages = 2 + ceil(($h - 355) / 245);\r
                }\r
+\r
+               $nb_lines = count($lines);\r
+               if ($pages > 1) {\r
+                       $i = 0;\r
+                       $y = 0;\r
+                       for ($page = 1; $page <= $pages; $page++) {\r
+                               if ($page == 1) {\r
+                                       $limit = 170;\r
+                               } else if ($page == $pages) {\r
+                                       $limit = 10000;\r
+                               } else {\r
+                                       $limit = 245;\r
+                               }\r
+                               for (; $i <= $nb_lines; $i++) {\r
+                                       $y += $lines[$i];\r
+                                       if ($y > $limit) {\r
+                                               $cesures[$page] = $i;\r
+                                               $y = $lines[$i];\r
+                                               continue 2;\r
+                                       }\r
+                               }\r
+\r
+                               if ($i >= $nb_lines) {\r
+                                       break;\r
+                               }\r
+                       }\r
+               }\r
+\r
+               $pages=max(count($cesures),$pages);\r
+\r
+               if (!isset($cesures[$pages - 1])) {\r
+                       $cesures[$pages - 1] = $nb_lines - 1;\r
+               }\r
+\r
+\r
+               $res = array('pages' => $pages, 'cesures' => $cesures);\r
+               fb($res);\r
+               return $res;\r
        }\r
 \r
        protected function escape($str) {\r
@@ -201,5 +294,3 @@ abstract class extranetDocument extends cubeMetier {
 \r
        abstract protected function documentTitre();\r
 }\r
-\r
-?>
\ No newline at end of file
index e9d00995a49d04c03e59caa6ea7d0bb2b7bd16fa..70a4073f350564bf928cd33af47aa9d6906d75b4 100644 (file)
@@ -1,4 +1,5 @@
 <?php\r
+\r
 class extranetFacture extends extranetDocument {\r
        protected $facture_id;\r
        protected $projet_id;\r
@@ -9,22 +10,19 @@ class extranetFacture extends extranetDocument {
        // Attributs composés\r
        protected $projet;\r
 \r
-       public function getBackground()\r
-       {\r
+       public function getBackground() {\r
                if ($this->status == 0) {\r
-                       $this->fond1 = $this->fond2 = $this->fond = SYSIMG . '/facture-brouillon.png';\r
+                       $this->fond3 = $this->fond1 = $this->fond2 = $this->fond = 5;\r
                } else {\r
-                       $this->fond1 = $this->fond2 = $this->fond = SYSIMG . '/facture.png';\r
+                       $this->fond3 = $this->fond1 = $this->fond2 = $this->fond = 5;\r
                }\r
        }\r
 \r
-       public function numeroFacture()\r
-       {\r
+       public function numeroFacture() {\r
                return date('ymd', $this->date_creation) . 'XT' . cubeMath::fill($this->facture_id, 5);\r
        }\r
 \r
-       protected function documentTitre()\r
-       {\r
+       protected function documentTitre() {\r
                $lang = $this->client->lang;\r
                if ($this->status == 4 || $this->total_ht < 0) {\r
                        $titre = __('AVOIR');\r
@@ -35,18 +33,10 @@ class extranetFacture extends extranetDocument {
                if ($this->status == 4) {\r
                        $titre .= __('Annule la facture') . ' # ' . $this->avoir->numeroFacture();\r
                }\r
-               $titre .= "\n";\r
-               if ($lang == 'fr') {\r
-                       $titre .= 'Le ' . strftime('%d %B %Y', $this->date_creation);\r
-               } else {\r
-                       $titre .= date('F jS Y', $this->date_creation);\r
-               }\r
-               $titre .= "\n\n" . $this->nom;\r
                return $titre;\r
        }\r
 \r
-       protected function isFacture()\r
-       {\r
+       protected function isFacture() {\r
                return true;\r
        }\r
 }\r