Пример #1
0
 /* Betriebskostenabrechnung - Hinzuf�gen von Buchungen zum Profil */
 case "buchung_hinzu":
     if (file_exists("../classes/class_bk.php")) {
         include_once "../classes/class_bk.php";
     }
     if (file_exists("../classes/class_wirtschafts_e.php")) {
         include_once "../classes/class_wirtschafts_e.php";
     }
     $bk = new bk();
     $buchung_id = $_REQUEST["buchung_id"];
     $profil_id = $_REQUEST["profil_id"];
     $bk_konto_id = $_REQUEST["bk_konto_id"];
     $bk_genkey_id = $_SESSION[genkey];
     $bk_hndl = $_SESSION[hndl];
     if ($bk_hndl == '1') {
         $bk->bk_buchungen_details($buchung_id);
         $hndl_betrag = $bk->buchung_betrag;
     } else {
         $hndl_betrag = 0.0;
     }
     $kontierung_uebernehmen = $_SESSION[kontierung];
     if ($buchung_id && $profil_id && $bk_konto_id) {
         $bk->bk_profil_infos($profil_id);
         $gesamt_anteil = $bk->gesamt_anteil($buchung_id, $profil_id, $bk_konto_id);
         $max_anteil = 100 - $gesamt_anteil;
         if ($kontierung_uebernehmen == '1') {
             $bk->bk_buchungen_details($buchung_id);
             $bk->bk_kos_typ = $bk->b_kos_typ;
             $bk->bk_kos_id = $bk->b_kos_id;
         }
         $last_bk_be_id = last_id_ajax('BK_BERECHNUNG_BUCHUNGEN', 'BK_BE_ID') + 1;
Пример #2
0
 function buchungen_hinzu($buchung_id)
 {
     $bk = new bk();
     $profil_id = $_SESSION['profil_id'];
     $bk_konto_id = $_SESSION['bk_konto_id'];
     $bk_genkey_id = $_SESSION['genkey'];
     $bk_hndl = $_SESSION['hndl'];
     if ($bk_hndl == '1') {
         $bk->bk_buchungen_details($buchung_id);
         $hndl_betrag = $bk->buchung_betrag;
     } else {
         $hndl_betrag = 0.0;
     }
     $kontierung_uebernehmen = $_SESSION['kontierung'];
     // echo "($buchung_id && $profil_id && $bk_konto_id)";
     if ($buchung_id && $profil_id && $bk_konto_id) {
         $bk->bk_profil_infos($profil_id);
         $gesamt_anteil = $bk->gesamt_anteil($buchung_id, $profil_id, $bk_konto_id);
         $max_anteil = 100 - $gesamt_anteil;
         if ($kontierung_uebernehmen == '1') {
             $bk->bk_buchungen_details($buchung_id);
             $bk->bk_kos_typ = $bk->b_kos_typ;
             $bk->bk_kos_id = $bk->b_kos_id;
         }
         $last_bk_be_id = last_id2('BK_BERECHNUNG_BUCHUNGEN', 'BK_BE_ID') + 1;
         $abfrage = "INSERT INTO BK_BERECHNUNG_BUCHUNGEN VALUES(NULL, '{$last_bk_be_id}', '{$buchung_id}', '{$bk_konto_id}', '{$profil_id}','{$bk_genkey_id}', '{$max_anteil}','{$bk->bk_kos_typ}', '{$bk->bk_kos_id}','{$hndl_betrag}','1')";
         $resultat = mysql_query($abfrage) or die(mysql_error());
     } else {
         echo "Fehler 888888 bk_class";
         die;
     }
 }