Пример #1
0
    } elseif ($nb_tarmed == 0 && $nb_caisse == 0 && $nb_ngap == 0 && $nb_ccam == 0 && !$etat_cotation && $search_easy != 4 && $search_easy != 0) {
        unset($factures[$key]);
    } elseif (($nb_tarmed != 0 || $nb_caisse != 0 || $nb_ngap != 0 || $nb_ccam != 0) && $search_easy == 4) {
        unset($factures[$key]);
    }
}
if ($facture_id && isset($factures[$facture_id])) {
    $facture->load($facture_id);
    $facture->loadRefPatient();
    $facture->_ref_patient->loadRefsCorrespondantsPatient();
    $facture->loadRefPraticien();
    $facture->loadRefAssurance();
    $facture->loadRefsObjects();
    $facture->loadRefsReglements();
    $facture->loadRefsRelances();
    $facture->loadRefsItems();
    $facture->loadRefsNotes();
}
$reglement = new CReglement();
$banque = new CBanque();
$banques = $banque->loadList(null, "nom");
$filter = new CConsultation();
$filter->_date_min = $date_min;
$filter->_date_max = $date_max;
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("tab", "vw_factures_etab");
$smarty->assign("factures", $factures);
$smarty->assign("reglement", $reglement);
$smarty->assign("listChirs", $listChir);
$smarty->assign("chirSel", $chirSel);
Пример #2
0
 /**
  * Edition de la facture
  *
  * @param bool $create création ou non du pdf
  *
  * @return void
  */
 function editFacture($create = true)
 {
     if ($create) {
         $this->createPdf();
     }
     foreach ($this->factures as $the_facture) {
         $this->facture = $the_facture;
         $this->facture->loadRefsItems();
         $this->_no_round = false;
         if ($this->facture->cloture && !count($this->facture->_ref_items)) {
             $this->facture->creationLignesFacture();
         }
         $this->patient = $this->facture->loadRefPatient();
         $this->facture->_ref_patient->loadRefsCorrespondantsPatient();
         $this->praticien = $this->facture->loadRefPraticien();
         $this->facture->loadRefAssurance();
         $this->facture->loadRefsObjects();
         $this->facture->loadRefsReglements();
         if ($this->type_pdf == "relance") {
             $this->facture->loadRefsRelances();
         }
         $this->function_prat = $this->praticien->loadRefFunction();
         $this->group = $this->function_prat->loadRefGroup();
         $adherent = $this->facture->loadNumAdherent($this->praticien->adherent);
         $this->adherent = $adherent["compte"];
         if ($this->type_pdf == "BVR") {
             $this->loadTotaux();
             $this->acompte = 0;
             $this->nb_factures = count($this->facture->_montant_factures_caisse);
             $this->num_fact = 0;
             foreach ($this->facture->_montant_factures_caisse as $cle_facture => $montant_facture) {
                 if ($this->acompte < $this->facture->_montant_avec_remise) {
                     $this->editHautFacture($cle_facture, $montant_facture);
                     $this->editBVR($montant_facture);
                 }
             }
         }
         if ($this->type_pdf == "BVR_TS") {
             $this->loadTotaux();
             $this->acompte = 0;
             $this->nb_factures = count($this->facture->_montant_factures_caisse);
             $this->num_fact = 0;
             $montant = 0;
             if ($this->acompte < $this->facture->_montant_avec_remise) {
                 $montant = $this->facture->_montant_avec_remise - $this->facture->_reglements_total_patient;
                 $montant = $montant - $this->facture->_reglements_total_tiers;
                 $this->editHautFacture(" ", $montant);
                 $this->editBVR($montant);
             }
             $this->type_pdf = "justif_TS";
             $this->function_prat->adresse = str_replace("\r\n", ' ', $this->function_prat->adresse);
             $this->patient->adresse = str_replace("\r\n", ' ', $this->patient->adresse);
             $this->editCenterJustificatif(0, $montant);
         } elseif ($this->type_pdf == "justif") {
             $this->function_prat->adresse = str_replace("\r\n", ' ', $this->function_prat->adresse);
             $this->patient->adresse = str_replace("\r\n", ' ', $this->patient->adresse);
             foreach ($this->facture->_montant_factures_caisse as $cle_facture => $montant_facture) {
                 $this->editCenterJustificatif($cle_facture, $montant_facture);
             }
         } elseif ($this->type_pdf == "relance") {
             $this->editRelanceEntete();
             //$this->editHautFacture(1, $this->relance->_montant, true);
             if (CAppUI::conf("ref_pays") == 2) {
                 $this->editBVR($this->relance->_montant);
             }
         }
     }
 }