fin2@agn
BNI-PT
Man-PT
KasKecil
BCA 671
Man 709
Account Tree
db backup
eBook #1
eBook #2
eBook #3
Tax eBook #4
Color
Logout
Mutasi BNI PT
Mutasi Mandiri PT
Mutasi Mandiri 709
Mutasi Mandiri 202
Mutasi BCA 671
Mutasi BCA 471
Mutasi Jago
Action
Transaction
Journal
Report
FilePHP
Tes cURL [1]
Copy This
Save
folder
slug
param
method
body
remark
php
Copy
/home/u902783705/domains/azkapersada.com/public_html/sub/fin/
inc.journal.php
<main> <div class="container-fluid"> <div class="row align-items-center justify-content-between pt-2"> <div class="col-auto mb-3"> <h2>Journal Account <?=$year;?></h2> </div> <div class="col-12 col-xl-auto mb-3"> <?php for($year=2022;$year<2026;$year++) { $k2=$year-2017; echo '<br>'.$year.': '; echo '<a href="?op=journal&op2=list&col=year&q='.$year.'" class="mt-1 btn btn-xs btn-color-'.$ar['color'][$k2].'">0 list '.$year.'</a> '; echo '<a href="?op=journal&op2=count&year='.$year.'" class="mt-1 btn btn-xs btn-color-'.$ar['color'][$k2].'">1 count '.$year.'</a> '; echo '<a href="?op=journal&op2=equ&col=year&q='.$year.'" class="mt-1 btn btn-xs btn-color-'.$ar['color'][$k2].'">2 Equ '.$year.'</a> '; } ?> </div> </div> <?php switch($op2) { case "count"; $sql6="update account set sel2=0"; $res6=mysqli_query($db,$sql6); $sql3="SELECT * from action order by action_at,seq"; $res3=mysqli_query($db,$sql3); while($r3=mysqli_fetch_assoc($res3)) { $udt3=array( 'seq'=>$r3['seq'], ); Update($db,"journal",$udt3,"action_id=".$r3['id'],0); Update($db,"transaction",$udt3,"action_id=".$r3['id'],0); } $sql="SELECT account_code from journal group by account_code"; $res=mysqli_query($db,$sql); while($r1=mysqli_fetch_assoc($res)) { $sql2="SELECT * from journal where year=".$_GET['year']." and account_code='".$r1['account_code']."' order by action_at asc, seq asc"; echo $sql2."<br>"; $res2=mysqli_query($db,$sql2); $bal=0; $seq2=1; while($r2=mysqli_fetch_assoc($res2)) { $bal=$bal+$r2['debit']-$r2['credit']; $udt=array( 'balance'=>$bal, 'seq2'=>$seq2, 'update_at'=>time(), ); Update($db,"journal",$udt,"id=".$r2['id'],1); $seq2++; } $udt4=array( 'sel2'=>1, ); Update($db,"account",$udt4,"code='".$r1['account_code']."'",0); } $col="year"; $q="2024"; listjournal($q,$col,$q2,$col2,$sortby,$sort,$page); break; case "reset"; $udata=array( 'st'=>1, 'update_at'=>time(), ); Update($db,"journal",$udata,"",0); listjournal($q,$col,$q2,$col2,$sortby,$sort,$page); break; case "equ"; list_equ($q,$col,$q2,$col2,$sortby,$sort,$page); break; case "list"; default; listjournal($q,$col,$q2,$col2,$sortby,$sort,$page); } ?> </div> </main> <?php function listjournal($q,$col,$q2,$col2,$sortby,$sort,$page) { global $db,$ar; //print_r($ar); ?> <table class="table table-bordered table-hover" id="dataTable_4d" width="100%" cellspacing="0"> <thead> <tr class="table-primary"> <th>ID</th> <th>At</th> <th>Y</th> <th>M</th> <th>Seq</th> <th>Code</th> <th>Account</th> <th>Trx</th> <th>Act</th> <th>Description</th> <th>Via</th> <th>Debit</th> <th>Credit</th> <th>Balance</th> <th>UpdateAt</th> </tr> </thead> <tbody> <?php $sql = "select a.*,b.name as name, c.descr as descr, c.bank as bank from journal a JOIN account b ON a.account_code=b.code JOIN `action` c ON a.action_id=c.id where a.st>0 "; if($col!='') { $sql .= " and a.".$col."='".$q."' "; } if($col2!='') { $sql .= " and a.".$col2."='".$q2."' "; } $sql .= " order by a.".$sortby." desc, a.`account_code` desc"; $res = mysqli_query($db, $sql); //echo $sql; $j_d=0; $j_c=0; while($rw = mysqli_fetch_assoc($res)) { $j_c=$j_c+$rw['credit']; $j_d=$j_d+$rw['debit']; ?> <tr> <td><?=$rw['id'];?></td> <td><?=date("Y-m-d",$rw['action_at']);?></td> <td><a href="?op=journal&op2=list&col2=year&q2=<?=$rw['year'];?>"><?=$rw['year'];?></a></td> <td><a href="?op=journal&op2=list&col2=month&q2=<?=$rw['month'];?>"><?=$rw['month'];?></a></td> <td><?=$rw['seq2'];?></td> <td><a href="?op=journal&op2=list&col=account_code&q=<?=$rw['account_code'];?>&col2=year&q2=<?=$rw['year'];?>"><?=$rw['account_code'];?></a></td> <td><?=$rw['name'];?></td> <td><a href="?op=transaction&op2=edit&id=<?=$rw['transaction_id'];?>"><?=$rw['transaction_id'];?></a></td> <td><a href="?op=action&op2=edit&id=<?=$rw['action_id'];?>"><?=$rw['action_id'];?></a></td> <td><?=$rw['descr'];?></td> <td><?=$rw['bank'];?></td> <td class="text-right"><?=ang2($rw['debit']);?></td> <td class="text-right"><?=ang2($rw['credit']);?></td> <td class="text-right"><?=ang2($rw['balance']);?></td> <td class="text-right"><?=date("Y-m-d",$rw['update_at']);?></td> </tr> <?php } $j_bal=$j_d-$j_c; ?> </tbody> <tfoot> <tr class="table-danger"> <th colspan="11"></th> <th class="text-right"><?=ang2($j_d);?></th> <th class="text-right"><?=ang2($j_c);?></th> <th class="text-right"><?=ang2($j_bal);?></th> <th></th> </tr> </tfoot> </table> <?=$sql;?><br> <?php if($q!='' && $q2>2021) { $udt=array( 'amount'=>to_numeric($j_bal), 'update_at'=>time(), ); //Update($db,"report",$udt,"code='".$q."' and year=".$q2,1); } ?> <script> function updateRecord(tbl,col,val,id) { $.ajax({ url: "tbl.update.php", type: "POST", data:'tbl='+tbl+'&col='+col+'&val='+val+'&id='+id, success: function(data){ //$(editableObj).css("background","#FDFDFD"); } }); } </script> <?php } function list_equ($q,$col,$q2,$col2,$sortby,$sort,$page) { global $db,$ar; //print_r($ar); ?> <table class="table table-bordered table-hover" id="dataTable_1a" width="100%" cellspacing="0"> <thead> <tr class="table-primary text-center"> <th rowspan="2">ID</th> <th rowspan="2">At</th> <th rowspan="2">Descr</th> <th colspan="14">Aktiva Lancar</th> <th>+</th> <th colspan="6">Aktiva Tetap</th> <th>=</th> <th colspan="9">Hutang</th> <th>+</th> <th colspan="5">Modal</th> <th>+</th> <th colspan="4">Pendapatan</th> <th>-</th> <th colspan="3">HPP</th> <th>-</th> <th colspan="8">Beban</th> </tr> <tr class="table-primary text-center"> <th>1111</th> <th>1112</th> <th>1113</th> <th>1114</th> <th>1115</th> <th></th> <th>1140</th> <th>1150</th> <th></th> <th>1161</th> <th>1162</th> <th>1163</th> <th>1164</th> <th>1165</th> <th></th> <th>1210</th> <th>1211</th> <th>1220</th> <th>1221</th> <th>1230</th> <th>1240</th> <th></th> <th>2110</th> <th>2120</th> <th></th> <th>2131</th> <th>2132</th> <th>2133</th> <th>2134</th> <th>2135</th> <th>2136</th> <th></th> <th>3110</th> <th>3120</th> <th>3130</th> <th>3140</th> <th>3150</th> <th></th> <th>4100</th> <th>4200</th> <th>7100</th> <th>7200</th> <th></th> <th>5100</th> <th>5200</th> <th>5300</th> <th></th> <th>6100</th> <th>6200</th> <th>6300</th> <th>6400</th> <th>6500</th> <th>6600</th> <th>6700</th> <th>8100</th> </tr> </thead> <tbody> <?php $sql = "select a.*, b.descr as descr,b.seq as seq from account_equation a JOIN `action` b ON a.action_id=b.id where a.st>0 "; if($col!='') { $sql .= " and a.".$col."='".$q."' "; } if($col2!='') { $sql .= " and a.".$col2."='".$q2."' "; } $sql .= " order by a.".$sortby." asc, a.id asc"; $res = mysqli_query($db, $sql); foreach ($ar['equ'] as $k => $v) { $j[$v]=0; } while($rw = mysqli_fetch_assoc($res)) { foreach ($ar['equ'] as $k1 => $v1) { $j[$v1]=$j[$v1]+$rw[$v1]; } ?> <tr> <td><?=$rw['id'];?></td> <td class="text-right" nowrap><?=date("Y-m-d",$rw['action_at']);?>-<?=$rw['seq'];?></td> <td><?=$rw['descr'];?></td> <td class="text-right"><?=ang2($rw['c11110']);?></td> <td class="text-right"><?=ang2($rw['c11120']);?></td> <td class="text-right"><?=ang2($rw['c11130']);?></td> <td class="text-right"><?=ang2($rw['c11140']);?></td> <td class="text-right"><?=ang2($rw['c11150']);?></td> <th></th> <td class="text-right"><?=ang2($rw['c11400']);?></td> <td class="text-right"><?=ang2($rw['c11500']);?></td> <th></th> <td class="text-right"><?=ang2($rw['c11610']);?></td> <td class="text-right"><?=ang2($rw['c11620']);?></td> <td class="text-right"><?=ang2($rw['c11630']);?></td> <td class="text-right"><?=ang2($rw['c11640']);?></td> <td class="text-right"><?=ang2($rw['c11650']);?></td> <td>+</td> <td class="text-right"><?=ang2($rw['c12100']);?></td> <td class="text-right"><?=ang2($rw['c12110']);?></td> <td class="text-right"><?=ang2($rw['c12200']);?></td> <td class="text-right"><?=ang2($rw['c12210']);?></td> <td class="text-right"><?=ang2($rw['c12300']);?></td> <td class="text-right"><?=ang2($rw['c12400']);?></td> <td>=</td> <td class="text-right"><?=ang2($rw['c21100']);?></td> <td class="text-right"><?=ang2($rw['c21200']);?></td> <td>+</td> <td class="text-right"><?=ang2($rw['c21310']);?></td> <td class="text-right"><?=ang2($rw['c21320']);?></td> <td class="text-right"><?=ang2($rw['c21330']);?></td> <td class="text-right"><?=ang2($rw['c21340']);?></td> <td class="text-right"><?=ang2($rw['c21350']);?></td> <td class="text-right"><?=ang2($rw['c21360']);?></td> <td>+</td> <td class="text-right"><?=ang2($rw['c31100']);?></td> <td class="text-right"><?=ang2($rw['c31200']);?></td> <td class="text-right"><?=ang2($rw['c31300']);?></td> <td class="text-right"><?=ang2($rw['c31400']);?></td> <td class="text-right"><?=ang2($rw['c31500']);?></td> <td>+</td> <td class="text-right"><?=ang2($rw['c41000']);?></td> <td class="text-right"><?=ang2($rw['c42000']);?></td> <td class="text-right"><?=ang2($rw['c71000']);?></td> <td class="text-right"><?=ang2($rw['c72000']);?></td> <td>-</td> <td class="text-right"><?=ang2($rw['c51000']);?></td> <td class="text-right"><?=ang2($rw['c52000']);?></td> <td class="text-right"><?=ang2($rw['c53000']);?></td> <td>-</td> <td class="text-right"><?=ang2($rw['c61000']);?></td> <td class="text-right"><?=ang2($rw['c62000']);?></td> <td class="text-right"><?=ang2($rw['c63000']);?></td> <td class="text-right"><?=ang2($rw['c64000']);?></td> <td class="text-right"><?=ang2($rw['c65000']);?></td> <td class="text-right"><?=ang2($rw['c66000']);?></td> <td class="text-right"><?=ang2($rw['c67000']);?></td> <td class="text-right"><?=ang2($rw['c81000']);?></td> </tr> <?php } //// hitung rugi laba ///////////////// //total pendapatan $j['c49000']=$j['c41000']+$j['c42000']; //hpp $j['c58000']=$j['c51000']+$j['c52000']-$j['c53000']; //laba kotor $j['c59000']=$j['c49000']-$j['c58000']; //beban $j['c69000']=$j['c61000']+$j['c62000']+$j['c63000']+$j['c64000']+$j['c65000']+$j['c66000']; //pendapatn lain-lain $j['c79000']=$j['c71000']+$j['c72000']; //Laba (rugi) $j['c90000']=$j['c59000']+$j['c79000']-$j['c81000']-$j['c69000']; //Neraca //kas $j['c11100']=$j['c11110']+$j['c11120']+$j['c11130']+$j['c11140']+$j['c11150']; //piutang pajak $j['c11600']=$j['c11610']+$j['c11620']+$j['c11630']+$j['c11640']+$j['c11650']; // total aktiva lancar $j['c11900']=$j['c11100']+$j['c11400']+$j['c11500']+$j['c11600']; //total aktiva tetap $j['c12900']=$j['c12100']+$j['c12110']+$j['c12200']+$j['c12300']+$j['c12400']; //total aktiva $j['c13000']=$j['c11900']+$j['c12900']; //hutang pajak $j['c21300']=$j['c21310']+$j['c21320']+$j['c21330']+$j['c21340']+$j['c21350']; //total hutang $j['c21900']=$j['c21100']+$j['c21200']+$j['c21300']; //rugi-laba $j['c31300']=$j['c90000']; //$j['c31300']=0; //total modal $j['c31900']=$j['c31100']+$j['c31200']+$j['c31300']-$j['c31400']-$j['c31500']; //total pasiva $j['c39000']=$j['c31900']+$j['c21900']; ?> </tbody> <tfoot> <tr class="table-danger"> <th colspan="3"></th> <!-- --> <th class="text-right"><?=ang2($j['c11110']);?></th> <th class="text-right"><?=ang2($j['c11120']);?></th> <th class="text-right"><?=ang2($j['c11130']);?></th> <th class="text-right"><?=ang2($j['c11140']);?></th> <th class="text-right"><?=ang2($j['c11150']);?></th> <th>+</th> <th class="text-right"><?=ang2($j['c11400']);?></th> <th class="text-right"><?=ang2($j['c11500']);?></th> <th>+</th> <th class="text-right"><?=ang2($j['c11610']);?></th> <th class="text-right"><?=ang2($j['c11620']);?></th> <th class="text-right"><?=ang2($j['c11630']);?></th> <th class="text-right"><?=ang2($j['c11640']);?></th> <th class="text-right"><?=ang2($j['c11650']);?></th> <th>+</th> <th class="text-right"><?=ang2($j['c12100']);?></th> <th class="text-right"><?=ang2($j['c12110']);?></th> <th class="text-right"><?=ang2($j['c12200']);?></th> <th class="text-right"><?=ang2($j['c12210']);?></th> <th class="text-right"><?=ang2($j['c12300']);?></th> <th class="text-right"><?=ang2($j['c12400']);?></th> <th>=</th> <th class="text-right"><?=ang2($j['c21100']);?></th> <th class="text-right"><?=ang2($j['c21200']);?></th> <th>+</th> <th class="text-right"><?=ang2($j['c21310']);?></th> <th class="text-right"><?=ang2($j['c21320']);?></th> <th class="text-right"><?=ang2($j['c21330']);?></th> <th class="text-right"><?=ang2($j['c21340']);?></th> <th class="text-right"><?=ang2($j['c21350']);?></th> <th class="text-right"><?=ang2($j['c21360']);?></th> <th>+</th> <th class="text-right"><?=ang2($j['c31100']);?></th> <th class="text-right"><?=ang2($j['c31200']);?></th> <th class="text-right"><?=ang2($j['c31300']);?></th> <th class="text-right">-<?=ang2($j['c31400']);?></th> <th class="text-right">-<?=ang2($j['c31500']);?></th> <th>+</th> <th class="text-right"><?=ang2($j['c41000']);?></th> <th class="text-right"><?=ang2($j['c42000']);?></th> <th class="text-right"><?=ang2($j['c71000']);?></th> <th class="text-right"><?=ang2($j['c72000']);?></th> <th>-</th> <th class="text-right"><?=ang2($j['c51000']);?></th> <th class="text-right"><?=ang2($j['c52000']);?></th> <th class="text-right"><?=ang2($j['c53000']);?></th> <th>-</th> <th class="text-right"><?=ang2($j['c61000']);?></th> <th class="text-right"><?=ang2($j['c62000']);?></th> <th class="text-right"><?=ang2($j['c63000']);?></th> <th class="text-right"><?=ang2($j['c64000']);?></th> <th class="text-right"><?=ang2($j['c65000']);?></th> <th class="text-right"><?=ang2($j['c66000']);?></th> <th class="text-right"><?=ang2($j['c67000']);?></th> <th class="text-right"><?=ang2($j['c81000']);?></th> </tr> <tr class="table-warning"> <th colspan="3"></th> <th colspan="5" class="text-center"><?=ang2($j['c11100']);?></th> <th>+</th> <th class="text-right"><?=ang2($j['c11400']);?></th> <th class="text-right"><?=ang2($j['c11500']);?></th> <th>+</th> <th colspan="5" class="text-center"><?=ang2($j['c11600']);?></th> <th>+</th> <th colspan="6" class="text-ceter"><?=ang2($j['c12900']);?></th> <th>=</th> <th class="text-right"><?=ang2($j['c21100']);?></th> <th class="text-right"><?=ang2($j['c21200']);?></th> <th>+</th> <th colspan="6" class="text-center"><?=ang2($j['c21300']);?></th> <th>+</th> <th colspan="5" class="text-center"><?=ang2($j['c31900']);?></th> <th>+</th> <th colspan="4" class="text-center"><?=ang2($j['c79000']);?></th> <th>-</th> <th colspan="3" class="text-center"><?=ang2($j['c58000']);?></th> <th>-</th> <th colspan="7" class="text-center"><?=ang2($j['c69000']);?></th> <th>-<?=ang2($j['c81000']);?></th> </tr> <tr class="table-success"> <th colspan="3"></th> <th colspan="21" class="text-right"><?=ang2($j['c13000']);?></th> <th>=</th> <th colspan="33" class="text-left"><?=ang2($j['c39000']);?></th> </tr> </tfoot> </table> <?php echo "c31300=c90000=".$j['c59000']+$j['c79000']-$j['c81000']-$j['c69000']."= c59(".$j['c59000'].")-c79(".$j['c79000'].")-c81(".$j['c81000'].")-c69(".$j['c69000'].")"; echo "<hr>"; foreach ($ar['equ'] as $k1 => $v1) { //$j[$v1]=$j[$v1]+$rw[$v1]; $udt=array( 'update_at'=>time(), 'amount'=>$j[$v1], ); Update($db,"report",$udt,"`code`='".substr($v1,1)."' and `year`=".$q,0); } //laporan perubahan modal $j['pm01']=$j['c31100']; $j['pm02']=$j['c31400']; $j['pm03']=$j['c31500']; $j['pm04']=$j['c90000']; $j['pm09']=$j['pm01']-$j['pm02']-$j['pm03']+$j['pm04']; //kas dr customer $j['a1']=$j['c41000']+$j['c42000']; //kas keluar utk supplier/beli barang $j['a2']=$j['c11500']; //kas keluar utk beban operasi $j['a3']=-$j['c69000']; //kas keluar utk bayar bunga bank $j['a4']=-$j['c81000']; //kas keluar untuk pajak //jumlah kas dari aktivitas operasional $j['a9']=$j['a1']-$j['a2']+$j['a3']+$j['a4']; //arus kas dari aktivitas investasi $j['b1']=$j['c72000']; $j['b3']=-$j['c12100']-$j['c12200']; $j['b9']=$j['b1']+$j['b3']; //arus kas dari aktivitas pendanaan $j['c1']=$j['c31100']; $j['c2']=$j['c21100']+$j['c21200']; $j['c5']=-$j['c31500']; $j['c6']=-$j['c31400']; $j['c9']=$j['c1']+$j['c2']+$j['c5']-$j['c6']; $j['d']=$j['a9']+$j['b9']+$j['c9']; $ar['rlcol']=array( 'c11100'=>11100, 'c11600'=>11160, 'c11900'=>11900, 'c12900'=>12900, 'c13000'=>13000, 'c21300'=>21300, 'c21900'=>21900, 'c31200'=>31200, 'c31300'=>31300, 'c31900'=>31900, 'c39000'=>39000, 'c49000'=>49000, 'c39000'=>39000, 'c58000'=>58000, 'c69000'=>69000, 'c79000'=>79000, 'c90000'=>90000, 'pm01'=>'PM01', 'pm02'=>'PM02', 'pm03'=>'PM03', 'pm04'=>'PM04', 'pm09'=>'PM09', 'a1'=>'A1', 'a2'=>'A2', 'a3'=>'A3', 'a4'=>'A4', 'a9'=>'A9', 'b1'=>'B1', 'b3'=>'B3', 'b9'=>'B9', 'c1'=>'C1', 'c2'=>'C2', 'c5'=>'C5', 'c6'=>'C6', 'c9'=>'C9', 'd'=>'D', ); foreach ($ar['rlcol'] as $key => $val) { $udt=array( 'update_at'=>time(), 'amount'=>$j[$key], ); Update($db,"report",$udt,"`code`='".$val."' and `year`=".$q,0); } $sql3="update report set c1=0,c2=0,c3=0 where year=".$q; $res3=mysqli_query($db,$sql3); $sql4="SELECT a.*, b.col as vcol from report a JOIN account b on a.code=b.code where a.year=".$q." and a.amount!=0 and b.col>0"; $res4=mysqli_query($db,$sql4); //echo $sql4."<br>"; while($r4=mysqli_fetch_assoc($res4)) { //echo 'c'.$r4['vcol']."<br>"; $udt=array( 'c'.$r4['vcol']=>$r4['amount'], ); Update($db,"report",$udt,"code='".$r4['code']."' and year=".$q,0); } ?> <script> function updateRecord(tbl,col,val,id) { $.ajax({ url: "tbl.update.php", type: "POST", data:'tbl='+tbl+'&col='+col+'&val='+val+'&id='+id, success: function(data){ //$(editableObj).css("background","#FDFDFD"); } }); } </script> <?php } ?>