예제 #1
0
    }
    $_item = $_item_liaison->loadRefItem();
    $_item_liaison->loadRefItemRealise();
    if (!$_item->_id) {
        $_item = $_item_liaison->_ref_item_realise;
    }
    $_item_liaison->loadRefSousItem();
    switch ($_item->object_class) {
        case "CPrestationJournaliere":
            $liaisons_j[$_item_liaison->date][$_item->object_id] = $_item_liaison;
            break;
        case "CPrestationPonctuelle":
            $liaisons_p[$_item_liaison->date][$_item->object_id][] = $_item_liaison;
            if (!isset($prestations_p[$_item->object_id])) {
                $prestation = new CPrestationPonctuelle();
                $prestation->load($_item->object_id);
                $prestation->_ref_items = $prestation->loadBackRefs("items");
                $prestations_p[$_item->object_id] = $prestation;
            }
    }
}
$date_temp = CMbDT::date($sejour->entree);
while (!isset($liaisons_j[$date_temp]) && $date_temp < CMbDT::date($sejour->sortie)) {
    $date_temp = CMbDT::date("+1 day", $date_temp);
}
$liaisons_j_date =& $liaisons_j[$date_temp];
$save_state = array();
foreach ($prestations_j as $_prestation_id => $_prestation) {
    $item_liaison = new CItemLiaison();
    $item_liaison->_id = "temp";
    $item_liaison->loadRefItem();