522 |
$error++; |
$error++; |
523 |
} |
} |
524 |
|
|
525 |
|
/* Facture détaillée standard */ |
526 |
|
|
527 |
if (!$error) |
if (!$error) |
528 |
{ |
{ |
|
|
|
529 |
$facok = 0; |
$facok = 0; |
530 |
|
|
531 |
// Différents modèles de factures détaillées |
// Différents modèles de factures détaillées |
551 |
$error = 19; |
$error = 19; |
552 |
} |
} |
553 |
} |
} |
554 |
|
|
555 |
|
/* Factures détaillées autres */ |
556 |
|
|
557 |
|
if (!$error) |
558 |
|
{ |
559 |
|
// Recherche des factures détaillées |
560 |
|
// et copie dans le répertoire de la facture |
561 |
|
// ID facture telephonique $factel_id |
562 |
|
$fdefacid = substr('0000'.$factel_id, -4); |
563 |
|
$fdedir = DOL_DATA_ROOT.'/telephonie/facture/'; |
564 |
|
|
565 |
|
$fdedir .= substr($fdefacid,0,1)."/"; |
566 |
|
$fdedir .= substr($fdefacid,1,1)."/"; |
567 |
|
$fdedir .= substr($fdefacid,2,1)."/"; |
568 |
|
$fdedir .= substr($fdefacid,3,1)."/"; |
569 |
|
|
570 |
|
$fname = $fdedir . $fdefacid . "-detail.xls"; |
571 |
|
|
572 |
|
if (file_exists($fname)) |
573 |
|
{ |
574 |
|
$fdefac = new Facture($db,"",$factel->fk_facture); |
575 |
|
$fdefac->fetch($factel->fk_facture); |
576 |
|
|
577 |
|
$dest = FAC_OUTPUTDIR ."/".$fdefac->ref."/".$fdefac->ref."-".$fdefacid."-".$ligne->numero."-detail.xls"; |
578 |
|
|
579 |
|
copy($fname, $dest); |
580 |
|
} |
581 |
|
} |
582 |
} |
} |
583 |
} |
} |
584 |
|
|