You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

364 lines
9.0 KiB
PHP

<?php
use NN\Route;
use NN\Session;
use NN\Module\DB;
use NN\Module\DD;
use NN\Link;
use NN\Files;
use NN\load;
use NN\Module\View;
use NN\Module\Uuid as id;
use NN\Webs;
use NN\Bug;
use NN\Module\crontab;
use NN\Module\Help;
use NN\Module\Datatable;
use NN\Enc;
use NN\Post;
$route->add('/api/kartupiutang/anggota/{faktur}', 'module/http/lap/kartupinjaman@datakartu')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/dd.php')
->use('module/perusahaan.php');
$route->add('/api/daftar/kekayaan/anggota', 'module/http/kekayaan@anggota')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/dd.php')
->use('module/perusahaan.php');
$route->add('/api/laporan/keuangan', function(){
$query = "
SELECT * FROM (
SELECT b.nr, b.dk, a.rek, a.tgl, a.debit FROM (
SELECT tgl, rekdebit rek, debit FROM lap_bb
WHERE app = 'usp'
) a LEFT JOIN (
SELECT * FROM acc WHERE app = 'usp'
) b ON a.rek = b.kode
WHERE b.nr = 'L'
UNION ALL
SELECT b.nr, b.dk, a.rek, a.tgl, a.kredit FROM (
SELECT tgl, rekkredit rek, kredit FROM lap_bb
WHERE app = 'usp'
) a LEFT JOIN (
SELECT * FROM acc WHERE app = 'usp'
) b ON a.rek = b.kode
WHERE b.nr = 'L'
) a
";
})
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/dd.php')
->use('module/perusahaan.php');
$route->add('/termal', function(){
View::render('print.termal');
})
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/dd.php')
->use('module/perusahaan.php');
$route->add('/cancel/posting/{id}', function($id){
DB::query("DELETE FROM lap_bb WHERE posting = '$id' ");
DB::query("DELETE FROM mags WHERE posting = '$id' ");
DB::query("DELETE FROM msimpan WHERE posting = '$id' ");
DB::query("UPDATE mtagihan SET statusposting = 0 WHERE kodetagihan = '$id' ");
DB::query("UPDATE totsl aa, (
SELECT a.fkt faktur, (totsl.lunas - a.lunas) lunas, (totsl.sisa + a.lunas) sisa FROM
(
SELECT ptg.fkt, ifnull(sum(ptg.lunas),0) lunas FROM ptg
LEFT JOIN totptg ON totptg.faktur = ptg.faktur
WHERE totptg.posting = '$id'
GROUP BY fkt
) a LEFT JOIN totsl ON totsl.faktur = a.fkt
) bb SET aa.lunas = bb.lunas, aa.sisa = bb.sisa
WHERE aa.faktur = bb.faktur");
DB::query("DELETE lap_bb FROM lap_bb LEFT JOIN (
SELECT ptg.faktur FROM ptg
LEFT JOIN totptg ON totptg.faktur = ptg.faktur
WHERE totptg.posting = '$id'
GROUP BY faktur
) a ON lap_bb.kode = a.faktur WHERE a.faktur IS NOT NULL
");
DB::query(" DELETE cekin FROM cekin
LEFT JOIN (
SELECT ptg.faktur FROM ptg
LEFT JOIN totptg ON totptg.faktur = ptg.faktur
WHERE totptg.posting = '$id'
GROUP BY faktur
) a ON a.faktur = cekin.faktur
WHERE a.faktur IS NOT NULL");
DB::query(" DELETE ptg FROM ptg LEFT JOIN (
SELECT ptg.faktur FROM ptg
LEFT JOIN totptg ON totptg.faktur = ptg.faktur
WHERE totptg.posting = '$id'
GROUP BY faktur
) a ON a.faktur = ptg.faktur
WHERE a.faktur IS NOT NULL");
DB::query(" DELETE FROM totptg WHERE posting = '$id'");
echo json_encode([
"status" => "success updated"
]);
})
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/dd.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route->add('/cancel/posting/penarikan/{id}', function($id){
DB::query("DELETE FROM lap_bb WHERE posting = '$id' ");
DB::query("DELETE FROM msimpan WHERE posting = '$id' ");
DB::query("DELETE FROM mpenarikan WHERE kodetagihan = '$id' ");
echo json_encode([
"status" => "success updated"
]);
})
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/dd.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/api/export/excel'
, 'module/http/excel@all')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/api/mysql/view'
, 'module/http/mysql@do')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/api/export/excel/{app}/{rek}/{thn}'
, 'module/http/excel@all')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/api/export/excel/neraca/{tahun}/{bulan}/{type}/{nc}'
, 'module/http/excel@neraca')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/api/export/excel/neraca_tahunan/{tahun}/{bulan}/{type}/{nc}'
, 'module/http/excel@neraca_tahunan')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/api/export/excel/rekapitulasi/{tahun}/{bulan}/{type}/{gol}'
, 'module/http/excel/rekapitulasi@do')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/api/export/excel/rekapitulasi/dev/{tahun}/{bulan}/{type}/{gol}'
, 'module/http/excel/rekapitulasi@do2')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/api/export/excel/kekayaan'
, 'module/http/excel/kekayaan@do')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/api/export/excel/kekayaan/testing'
, 'module/http/excel/kekayaan2@do')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/api/export/excel/partisipasi'
, 'module/http/excel/partisipasi@do')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/api/export/excel/anggota/{tahun}'
, 'module/http/excel/anggota@do')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/api/export/excel/anggota/view'
, 'module/http/excel/anggota@view')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/api/export/excel/anggota'
, 'module/http/excel/anggota@do')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/api/export/excel/partisipasi/{tahun}'
, 'module/http/excel/partisipasi@do')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/api/export/excel/partisipasi/{tahun}/{type}'
, 'module/http/excel/partisipasi@do')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/excel/js'
, 'module/http/excel/partisipasi@excel')
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/laporan/neraca-lajur'
, function(){
View::render('admin.laporan.keuangan.neracalajur');
})
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/laporan/rekapitulasi'
, function(){
View::render('admin.laporan.keuangan.rekapitulasi');
})
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/laporan/rekapitulasi-test'
, function(){
View::render('admin.laporan.keuangan.rekapitulasitest');
})
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/laporan/tunggakan'
, function(){
View::render('admin.laporan.keuangan.tunggakan');
})
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;
$route
->add('/admin/laporan/tunggakandetail'
, function(){
View::render('admin.laporan.tunggakandetail');
})
->use('vendor/autoload.php')
->use('module/db.php')
->use('module/http/excelconf.php')
->use('module/perusahaan.php')
->middleware('cekloginadmin')
;