Beispiel #1
0
    foreach ($tarifs as $_tarif) {
        /* @var CTarif $_tarif*/
        $_tarif->_update_montants = 1;
        $_tarif->updateMontants();
        if ($msg = $_tarif->store()) {
            CAppUI::setMsg($_tarif->_id . $msg, UI_MSG_ERROR);
        }
    }
    CAppUI::setMsg("Tarifs mis à jour", UI_MSG_OK);
    echo CAppUI::getMsg();
} elseif (CValue::post("modifTauxVingPct")) {
    $where = array();
    $where["taux_tva"] = "= '19.6'";
    $tarif = new CTarif();
    $nb_tarif = $tarif->countList($where);
    $tarifs = $tarif->loadList($where);
    foreach ($tarifs as $_tarif) {
        /* @var CTarif $_tarif*/
        $_tarif->taux_tva = '20';
        $_tarif->_update_montants = 1;
        $_tarif->updateMontants();
        if ($msg = $_tarif->store()) {
            CAppUI::setMsg($_tarif->_id . $msg, UI_MSG_ERROR);
        }
    }
    CAppUI::setMsg("{$nb_tarif} tarifs mis à jour", UI_MSG_OK);
    echo CAppUI::getMsg();
} else {
    $do = new CDoObjectAddEdit("CTarif", "tarif_id");
    // redirection vers la comptabilite dans le cas de la creation d'un nouveau tarif dans la consult
    if (isset($_POST["_tab"])) {
     $chir->load($chir_id);
 } else {
     $chir->load($sejour->praticien_id);
 }
 $sejour->loadRefPraticien();
 $sejour->loadRefsActes();
 $sejour->updateFormFields();
 $sejour->_datetime = CMbDT::dateTime();
 // Récupération des tarifs
 /** @var CTarif $tarif */
 $tarif = new CTarif();
 $tarifs = array();
 $order = "description";
 $where = array();
 $where["chir_id"] = "= '{$chir->_id}'";
 $tarifs["user"] = $tarif->loadList($where, $order);
 foreach ($tarifs["user"] as $_tarif) {
     /**@var CTarif $_tarif */
     $_tarif->getPrecodeReady();
 }
 $where = array();
 $where["function_id"] = "= '{$chir->function_id}'";
 $tarifs["func"] = $tarif->loadList($where, $order);
 foreach ($tarifs["func"] as $_tarif) {
     $_tarif->getPrecodeReady();
 }
 if (CAppui::conf("dPcabinet Tarifs show_tarifs_etab")) {
     $where = array();
     $where["group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
     $tarifs["group"] = $tarif->loadList($where, $order);
     foreach ($tarifs["group"] as $_tarif) {
Beispiel #3
0
CCanDo::checkEdit();
$tarif = new CTarif();
// L'utilisateur est-il praticien ?
$user = CAppUI::$user;
$user->loadRefFunction();
$prat = new CMediusers();
$prat->load($user->_id);
$prat->loadRefFunction();
// Liste des tarifs du praticien
$listeTarifsChir = null;
$order = "description";
if ($user->isPraticien()) {
    $where = array();
    $where["function_id"] = "IS NULL";
    $where["chir_id"] = "= '{$user->user_id}'";
    $listeTarifsChir = $tarif->loadList($where, $order);
}
if ($user->isSecretaire()) {
    $prat_id = CValue::getOrSession("prat_id");
    if ($prat_id) {
        $prat->load($prat_id);
        $prat->loadRefFunction();
        $where = array();
        $where["function_id"] = "IS NULL";
        $where["chir_id"] = "= '{$prat->_id}'";
        $listeTarifsChir = $tarif->loadList($where, $order);
    }
}
if ($listeTarifsChir) {
    foreach ($listeTarifsChir as $_tarif) {
        $_tarif->getPrecodeReady();