Changeset 489

User picture

Author: linux.rlm

(2012/02/13 02:39) 3 months ago

[ALT] DanfeNFePHP.class.php ver.2.12 - Peuenas correções para eliminar alguns warnings. - Contribuição de Marcos Diez <marcos at unitron dot com dot br>

Affected files

Updated branches/2.0/libs/DanfeNFePHP.class.php Download diff

File was changed - ok, show the diff

Updated trunk/libs/DanfeNFePHP.class.php Download diff

488489
23
 *
23
 *
24
 * @package     NFePHP
24
 * @package     NFePHP
25
 * @name        DanfeNFePHP.class.php
25
 * @name        DanfeNFePHP.class.php
26
 * @version     2.11
26
 * @version     2.12
27
 * @license     http://www.gnu.org/licenses/gpl.html GNU/GPL v.3
27
 * @license     http://www.gnu.org/licenses/gpl.html GNU/GPL v.3
28
 * @license     http://www.gnu.org/licenses/lgpl.html GNU/LGPL v.3
28
 * @license     http://www.gnu.org/licenses/lgpl.html GNU/LGPL v.3
29
 * @copyright   2009-2011 &copy; NFePHP
29
 * @copyright   2009-2011 &copy; NFePHP
...
...
80
    protected $destino = 'I'; //destivo do arquivo pdf I-borwser, S-retorna o arquivo, D-força download, F-salva em arquivo local
80
    protected $destino = 'I'; //destivo do arquivo pdf I-borwser, S-retorna o arquivo, D-força download, F-salva em arquivo local
81
    protected $pdfDir=''; //diretorio para salvar o pdf com a opção de destino = F
81
    protected $pdfDir=''; //diretorio para salvar o pdf com a opção de destino = F
82
    protected $fontePadrao='Times'; //Nome da Fonte para gerar o DANFE
82
    protected $fontePadrao='Times'; //Nome da Fonte para gerar o DANFE
83
    protected $version = '2.11';
83
    protected $version = '2.12';
84
    protected $textoAdic = '';
84
    protected $textoAdic = '';
85
    protected $wAdic = 0;
85
    protected $wAdic = 0;
86
    protected $wPrint; //largura imprimivel
86
    protected $wPrint; //largura imprimivel
...
...
408
        $i = 0;
408
        $i = 0;
409
        $numlinhas = 0;
409
        $numlinhas = 0;
410
        $hUsado = $hCabecItens;
410
        $hUsado = $hCabecItens;
411
		// $w2 = round($this->wPrint*0.356,0)-1;
411
	// $w2 = round($this->wPrint*0.356,0)-1;
412
        $w2 = round($this->wPrint*0.31,0);
412
        $w2 = round($this->wPrint*0.31,0);
413
        while ($i < $this->det->length){
413
        while ($i < $this->det->length){
414
            $texto = $this->__descricaoProduto( $this->det->item($i) ) ;
414
            $texto = $this->__descricaoProduto( $this->det->item($i) ) ;
...
...
797
        $texto = 'INSCRIÇÃO ESTADUAL';
797
        $texto = 'INSCRIÇÃO ESTADUAL';
798
        $aFont = array('font'=>$this->fontePadrao,'size'=>6,'style'=>'');
798
        $aFont = array('font'=>$this->fontePadrao,'size'=>6,'style'=>'');
799
        $this->__textBox($x,$y,$w,$h,$texto,$aFont,'T','L',1,'');
799
        $this->__textBox($x,$y,$w,$h,$texto,$aFont,'T','L',1,'');
800
        $texto = $this->emit->getElementsByTagName("IE")->item(0)->nodeValue;
800
        $texto = $this->__simpleGetValue( $this->emit , "IE");
801
        $aFont = array('font'=>$this->fontePadrao,'size'=>10,'style'=>'B');
801
        $aFont = array('font'=>$this->fontePadrao,'size'=>10,'style'=>'B');
802
        $this->__textBox($x,$y,$w,$h,$texto,$aFont,'B','C',0,'');
802
        $this->__textBox($x,$y,$w,$h,$texto,$aFont,'B','C',0,'');
803
        //INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.
803
        //INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.
...
...
1777
                $x += $w3;
1777
                $x += $w3;
1778
                //CST
1778
                //CST
1779
                if ( isset($ICMS) ){
1779
                if ( isset($ICMS) ){
1780
                    $origem = $ICMS->getElementsByTagName("orig")->item(0)->nodeValue;
1780
                    $origem =  $this->__simpleGetValue( $ICMS , "orig" );
1781
                    $cst = !empty($ICMS->getElementsByTagName("CST")->item(0)->nodeValue) ? $ICMS->getElementsByTagName("CST")->item(0)->nodeValue : '';
1781
                    $cst =  $this->__simpleGetValue( $ICMS , "CST" );
1782
                    $csosn = !empty($ICMS->getElementsByTagName("CSOSN")->item(0)->nodeValue) ? $ICMS->getElementsByTagName("CSOSN")->item(0)->nodeValue : '';
1782
                    $csosn =  $this->__simpleGetValue( $ICMS , "CSOSN" );                    
1783
                    $texto = $origem.$cst.$csosn;
1783
                    $texto = $origem.$cst.$csosn;
1784
                    $this->__textBox($x,$y,$w4,$h,$texto,$aFont,'T','C',0,'');
1784
                    $this->__textBox($x,$y,$w4,$h,$texto,$aFont,'T','C',0,'');
1785
                }
1785
                }
...
...
1940
     * @param number $h altura do campo
1940
     * @param number $h altura do campo
1941
     * @return number Posição vertical final
1941
     * @return number Posição vertical final
1942
     */
1942
     */
1943
    protected function __dadosAdicionaisDANFE($x,$y,$pag,$h){
1943
    protected function __dadosAdicionaisDANFE($x,$y,$h){
1944
        $oldX = $x;
1945
        //##################################################################################
1944
        //##################################################################################
1946
        //DADOS ADICIONAIS
1945
        //DADOS ADICIONAIS
1947
        $texto = "DADOS ADICIONAIS";
1946
        $texto = "DADOS ADICIONAIS";