本文整理汇总了PHP中CConsultation::loadRefsFraisDivers方法的典型用法代码示例。如果您正苦于以下问题:PHP CConsultation::loadRefsFraisDivers方法的具体用法?PHP CConsultation::loadRefsFraisDivers怎么用?PHP CConsultation::loadRefsFraisDivers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CConsultation
的用法示例。
在下文中一共展示了CConsultation::loadRefsFraisDivers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
//.........这里部分代码省略.........
$_consultation->patient_date_reglement = $this->patient_date_reglement;
$_consultation->tiers_date_reglement = $this->tiers_date_reglement;
if ($msg = $_consultation->store()) {
return $msg;
}
}
if ($this->isRelancable() && $this->_ref_last_relance->_id) {
$this->_ref_last_relance->etat = $this->patient_date_reglement ? "regle" : "emise";
$this->_ref_last_relance->store();
}
}
$_object_id = null;
$_object_class = null;
//Lors de la validation de la cotation d'une consultation
if ($this->_consult_id) {
$consult = new CConsultation();
$consult->load($this->_consult_id);
$consult->loadRefPlageConsult();
// Si la facture existe déjà on la met à jour
$where = array();
$ljoin = array();
$plage = $consult->_ref_plageconsult;
if (CAppUI::conf("ref_pays") == 2) {
$where["patient_id"] = "= '{$consult->patient_id}'";
$where["praticien_id"] = "= '" . ($plage->pour_compte_id ? $plage->pour_compte_id : $plage->chir_id) . "'";
$where["cloture"] = "IS NULL";
} else {
$table = $consult->sejour_id ? "facture_etablissement" : "facture_cabinet";
$ljoin["facture_liaison"] = "facture_liaison.facture_id = {$table}.facture_id";
$where["facture_liaison.object_id"] = " = '{$this->_consult_id}'";
$where["facture_liaison.object_class"] = " = 'CConsultation'";
$where["facture_liaison.facture_class"] = " = '{$this->_class}'";
$where["numero"] = " = '{$this->numero}'";
}
//Si la facture existe déjà
if ($this->loadObject($where, null, "facture_id", $ljoin)) {
//Dans le cas Suisse
if (CAppUI::conf("ref_pays") == 2 && CModule::getActive("dPfacturation")) {
$ligne = new CFactureLiaison();
$ligne->facture_id = $this->_id;
$ligne->facture_class = $this->_class;
$ligne->object_id = $this->_consult_id;
$ligne->object_class = 'CConsultation';
if (!$ligne->loadMatchingObject()) {
$ligne->store();
}
}
} else {
// Sinon on la crée
$this->ouverture = CMbDT::date();
$this->patient_id = $consult->patient_id;
$this->praticien_id = $plage->pour_compte_id ? $plage->pour_compte_id : $plage->chir_id;
$this->type_facture = $consult->pec_at == 'arret' ? "accident" : "maladie";
if (CAppUI::conf("dPfacturation {$this->_class} use_auto_cloture")) {
$this->cloture = CMbDT::date();
$create_lignes = true;
}
if ($this->numero > 1 && !count($consult->loadRefsFraisDivers(1)) && count($consult->loadRefsFraisDivers($this->numero)) && $consult->du_tva) {
$frais = 0;
foreach ($consult->loadRefsFraisDivers($this->numero) as $_frais) {
$frais += $_frais->montant_base;
}
$this->du_patient = $frais + $consult->du_tva;
$this->du_tva = $consult->du_tva;
$this->taux_tva = $consult->taux_tva;
}
}
$_object_id = $this->_consult_id;
$_object_class = "CConsultation";
}
//Lors de la création d'une facture de séjour
if ($this->_sejour_id) {
$_object_id = $this->_sejour_id;
$_object_class = "CSejour";
}
$this->completeField("assurance_maladie", "assurance_accident", "type_facture");
if ($this->type_facture != "accident" && $this->assurance_accident) {
$this->assurance_accident = "";
}
if ($this->type_facture != "maladie" && $this->assurance_maladie) {
$this->assurance_maladie = "";
}
// Standard store
if ($msg = parent::store()) {
return $msg;
}
if ($_object_id) {
$ligne = new CFactureLiaison();
$ligne->facture_id = $this->_id;
$ligne->facture_class = $this->_class;
$ligne->object_id = $_object_id;
$ligne->object_class = $_object_class;
if (!$ligne->loadMatchingObject()) {
$ligne->store();
}
}
if ($create_lignes) {
$this->creationLignesFacture();
}
}