// TBS $dataHpp[] = array('kodeorg' => $unit, 'periode' => $nxtPeriod, 'kodebarang' => $barang['tbs'], 'qtyawal' => $tbsQtyAkhir, 'rpawal' => $tbsRpAkhir); // CPO $dataHpp[] = array('kodeorg' => $unit, 'periode' => $nxtPeriod, 'kodebarang' => $barang['cpo'], 'qtyawal' => $cpoQtyAkhir, 'rpawal' => $cpoRpAkhir); // PK $dataHpp[] = array('kodeorg' => $unit, 'periode' => $nxtPeriod, 'kodebarang' => $barang['pk'], 'qtyawal' => $pkQtyAkhir, 'rpawal' => $pkRpAkhir); // Delete Saldo Awal HPP $qDelHPP = deleteQuery($dbname, 'keu_4hpp', "kodeorg='" . $unit . "' and periode='" . $nxtPeriod . "'"); if (!mysql_query($qDelHPP)) { echo "Delete HPP Error: " . mysql_error() . "\n"; } // Insert Saldo Awal HPP $qInsHPP = insertQuery($dbname, 'keu_4hpp', $dataHpp); if (!mysql_query($qInsHPP)) { echo "Insert HPP Error: " . mysql_error() . "\n"; $zJ->rbJournal($nojurnal); } } /************************************************************** * [END] Buat HPP CPO,PK,TBS ********************************** **************************************************************/ } //end pengecekan pabrik sudah mengolah atau belum } //end pengecekan ada pabrik atau tidak // Default Segment $defSegment = colDefaultValue($dbname, 'keu_5segment', 'kodesegment'); switch ($proses) { case 'tutupBuku': #==================== Prep Periode ==================================== # Prep Tahun Bulan untuk periode selanjutnya