$date_max = CValue::get("_date_max");
if ($factures_id) {
    $factures_id = explode("|", $factures_id);
}
// Factures qui viennent d'ĂȘtre imprimĂ©es
$factures = array();
$facture = new $facture_class();
if (count($factures_id)) {
    $where = array();
    $where["facture_id"] = CSQLDataSource::prepareIn(array_values($factures_id));
    $factures = $facture->loadList($where);
    //Impression des factures et justificatifs pdf
    $facture_pdf = new CEditPdf();
    $facture_pdf->factures = $factures;
    $facture_pdf->printBill($tiers_soldant);
    $journal_pdf = new CEditJournal();
    $journal_pdf->type_pdf = "debiteur";
    $journal_pdf->factures = $factures;
    foreach ($journal_pdf->factures as $fact) {
        /** @var CFacture $fact */
        $fact->loadRefsObjects();
        $fact->loadRefPatient();
        $fact->loadRefPraticien();
        $fact->loadRefsReglements();
        $fact->isRelancable();
    }
    if (!$uniq_checklist) {
        $journal_pdf->editJournal(false);
    }
    $journal_pdf->type_pdf = "checklist";
    $journal_pdf->definitive = $definitive;
$facture_pdf->factures = $factures;
if ($type_pdf == "bvr") {
    $facture_pdf->editFactureBVR();
}
if ($type_pdf == "bvr_TS") {
    $facture_pdf->editFactureBVR("TS");
}
if ($type_pdf == "justificatif") {
    $facture_pdf->editJustificatif();
}
if ($type_pdf == "bvr_justif") {
    $facture_pdf->editFactureBVRJustif();
}
if ($type_pdf == "impression") {
    $facture_pdf->printBill($tiers_soldant);
    $journal_pdf = new CEditJournal();
    $journal_pdf->type_pdf = "debiteur";
    $journal_pdf->factures = $factures;
    foreach ($journal_pdf->factures as $fact) {
        /** @var CFacture $fact */
        $fact->loadRefsObjects();
        $fact->loadRefPatient();
        $fact->loadRefPraticien();
        $fact->loadRefsReglements();
        $fact->isRelancable();
    }
    $journal_pdf->editJournal(false);
    $journal_pdf->type_pdf = "checklist";
    $journal_pdf->definitive = $definitive;
    $journal_pdf->editJournal(false);
    if (!$facture_id) {
Example #3
0
/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage dPfacturation
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$type = CValue::get("type");
$prat_id = CValue::get("prat_id");
$date_min = CValue::get("_date_min");
$date_max = CValue::get("_date_max");
$journal_pdf = new CEditJournal();
$journal_pdf->type_pdf = $type == "all-paiement" ? "paiement" : $type;
$journal_pdf->date_min = $date_min;
$journal_pdf->date_max = $date_max;
$where = array();
if ($type == "paiement" || $type == "all-paiement") {
    if ($type == "all-paiement") {
        $where["lock"] = " = '0'";
    } else {
        $where["date"] = "BETWEEN '{$date_min} 00:00:00' AND '{$date_max} 23:59:00'";
    }
    $where["object_class"] = " = 'CFactureEtablissement'";
    $reglement = new CReglement();
    $journal_pdf->reglements = $reglement->loadList($where, "debiteur_id, debiteur_desc, date");
    foreach ($journal_pdf->reglements as $_reglement) {
        /** @var CReglement $_reglement */