first commit
This commit is contained in:
@@ -0,0 +1,377 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : Inventory Advanced Systems
|
||||
Module : /apps/php/repo/rekap_promo.php
|
||||
Desc. : PHP - Laporan Penjualan Produk Promo
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : July 22th, 2011.
|
||||
Last Modified : March 28th, 2025.
|
||||
|
||||
(c) 2011 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
require_once(__DIR__."/../../../../../vendor/autoload.php");
|
||||
require_once(__DIR__."/../func/ias.php");
|
||||
require_once(__DIR__."/../func/report.php");
|
||||
|
||||
use siaupheng\fonia3\DB\MySQL;
|
||||
use siaupheng\fonia3\DB\SQL;
|
||||
use siaupheng\fonia3\Web\Param;
|
||||
use siaupheng\fonia3\Web\Table;
|
||||
use siaupheng\fonia3\Web\Form;
|
||||
use siaupheng\fonia3\Printer\PrintHTML;
|
||||
use siaupheng\fonia3\Data\SimpleXLS;
|
||||
|
||||
$db = (is_resource($db)) ? $db : new MySQL();
|
||||
$ajson = [];
|
||||
$data = Param::Get("data");
|
||||
$id_grup = Param::Get("Grup_InvID", 0);
|
||||
$id_inv = Param::Get("InvID", 0);
|
||||
|
||||
if ( $data == "print" || $data == "export" ) {
|
||||
$tipe = Param::Get("Tipe"); // R or D
|
||||
$rekap = Param::Get("Rekap"); // X, 1, 0
|
||||
$id_sales = Param::Get("SalesID", "SEMUA");
|
||||
$tglfrom = Param::Get("Tgl_From");
|
||||
$tglto = Param::Get("Tgl_To");
|
||||
$asales = []; $aproduk = [];
|
||||
if (!in_array($id_sales, [0,"NON","SEMUA"])) {
|
||||
$db->Query("SELECT Nama_Pegawai Nama_Sales FROM para_pegawai WHERE PegID='".$id_sales."' LIMIT 1");
|
||||
if ($db->Next()) $asales = $db->AllRow();
|
||||
}
|
||||
if ($id_sales=="NON") $asales['Nama_Sales'] = "TANPA SALES";
|
||||
if ($id_inv > 0) {
|
||||
$db->Query("SELECT UPPER(CONCAT('[',Kode_Produk,'] ',Nama_Produk,' (',Satuan_Normal,')')) Nama_Produk FROM vi_inv_produk WHERE InvID='".$id_inv."' LIMIT 1");
|
||||
if ($db->Next()) $aproduk = $db->AllRow();
|
||||
}
|
||||
|
||||
// generate report header
|
||||
$tglheader = "Periode : ".$tglfrom;
|
||||
if ($tglfrom!==$tglto) $tglheader .= " S/D ".$tglto;
|
||||
$tglfrom = tgl_sql2str($tglfrom);
|
||||
$tglto = tgl_sql2str($tglto);
|
||||
|
||||
$qdetail = ""; $qsql = "";
|
||||
if ($id_inv > 0) {
|
||||
$qdetail = " AND InvID='".$id_inv."'";
|
||||
} else if ($id_grup > 0) {
|
||||
$qsql .= " AND P.Grup_InvID='".$id_grup."'";
|
||||
} else {
|
||||
$qsql .= " AND P.Grup_InvID NOT IN ('".$_SESSION['__APP_IAS']['GRUP_PRODUK_KEMASAN']."','".$_SESSION['__APP_IAS']['GRUP_PRODUK_HADIAH']."')";
|
||||
}
|
||||
$qsql .= ($rekap<>"X") ? " AND J.Rekap='".intval($rekap)."'" : "";
|
||||
$qsql .= ($id_sales>0 && $id_sales<>"NON") ? " AND J.SalesID='".$id_sales."'" : "";
|
||||
$qsql .= ($id_sales=="NON") ? " AND J.SalesID=0" : "";
|
||||
|
||||
if ($tipe=="R") {
|
||||
$db->Query("SELECT SUM(-D.Qty) Qty,S.Nama_Satuan,CONCAT(P.Nama_Produk,IF(D.RasaID=0,'',CONCAT(' (',R.Nama_Rasa,')'))) Nama_Produk FROM (SELECT * FROM inv_detail WHERE (Tgl_Ref BETWEEN '".$tglfrom."' AND '".$tglto."') AND Pro_SQ=1".$qdetail.") D LEFT JOIN inv_jual J ON (J.No_Jual=D.No_Ref) LEFT JOIN para_outlet O ON (O.OutletID=J.OutletID) LEFT JOIN inv_produk P ON (P.InvID=D.InvID) LEFT JOIN para_satuan S ON (S.SatuanID=D.SatuanID) LEFT JOIN para_rasa R ON (R.RasaID=D.RasaID) WHERE J.Data_Jual=1".$qsql." GROUP BY D.InvID,D.RasaID,D.SatuanID ORDER BY P.Nama_Produk,D.RasaID,D.SatuanID");
|
||||
} else if ($tipe=="B") {
|
||||
if (trim($qsql)<>"") $qsql = " WHERE".substr($qsql,4);
|
||||
$db->Query("SELECT D.*,J.Tgl_Jual,O.Nama_Outlet,O.Alamat_Outlet FROM (SELECT B.No_Ref,B.InvID,B.SatuanID,J.SatuanID SatuanID2,B.Bonus,J.Qty FROM (SELECT No_Ref,InvID,SatuanID,-Qty Bonus FROM inv_detail WHERE (Tgl_Ref BETWEEN '".$tglfrom."' AND '".$tglto."') AND Pro_SQ=1 AND NotaID=5 AND Qty<>0".$qdetail.") B LEFT JOIN (SELECT No_Ref,InvID,SatuanID,SUM(-Qty) Qty FROM inv_detail WHERE (Tgl_Ref BETWEEN '".$tglfrom."' AND '".$tglto."') AND Pro_SQ=0 AND NotaID=5".$qdetail." GROUP BY No_Ref,InvID,SatuanID) J ON (B.No_Ref=J.No_Ref AND B.InvID=J.InvID)) D LEFT JOIN inv_jual J ON (D.No_Ref=J.No_Jual) LEFT JOIN para_outlet O ON (J.OutletID=O.OutletID) LEFT JOIN inv_produk P ON (P.InvID=D.InvID)".$qsql." ORDER BY J.Tgl_Jual");
|
||||
$aheader = []; $adata = [];
|
||||
while ($db->Next()) {
|
||||
$aheader[$db->Row("InvID")] = "";
|
||||
$adata[$db->Row("No_Ref")]['Kode'] = ($db->Row("SatuanID",0)==$db->Row("SatuanID2",0)?$adata[$db->Row("No_Ref")]['Kode']:" ***");
|
||||
$adata[$db->Row("No_Ref")]['No_Jual'] = $db->Row("No_Ref");
|
||||
$adata[$db->Row("No_Ref")]['Tgl_Jual'] = tgl_sql2str($db->Row("Tgl_Jual"));
|
||||
$adata[$db->Row("No_Ref")]['N_Outlet'] = $db->Row("Nama_Outlet");
|
||||
$adata[$db->Row("No_Ref")]['A_Outlet'] = $db->Row("Alamat_Outlet");
|
||||
$adata[$db->Row("No_Ref")][$db->Row("InvID")]['Qty'] = $db->RowFloat("Qty",0);
|
||||
$adata[$db->Row("No_Ref")][$db->Row("InvID")]['Bonus'] += $db->RowFloat("Bonus",0);
|
||||
}
|
||||
// Header Caption
|
||||
$t_judul = "";
|
||||
foreach ($aheader as $_key => $_val) {
|
||||
$t_judul .= "," . $_key;
|
||||
}
|
||||
$db->Query("SELECT InvID,Kode_Produk FROM inv_produk WHERE InvID IN (".substr($t_judul,1).")");
|
||||
while ($db->Next()) {
|
||||
$aheader[$db->Row("InvID")] = $db->Row("Kode_Produk");
|
||||
}
|
||||
} else {
|
||||
$db->Query("SELECT D.No_Ref,DATE_FORMAT(D.Tgl_Ref,'%d-%m-%Y') Tgl_Ref2,J.No_Faktur,O.Nama_Outlet,LEFT(O.Alamat_Outlet,100) Alamat_Outlet,-D.Qty Qty,S.Nama_Satuan,CONCAT(P.Nama_Produk,IF(D.RasaID=0,'',CONCAT(' (',R.Nama_Rasa,')'))) Nama_Produk FROM (SELECT * FROM inv_detail WHERE (Tgl_Ref BETWEEN '".$tglfrom."' AND '".$tglto."') AND Pro_SQ=1".$qdetail.") D LEFT JOIN inv_jual J ON (J.No_Jual=D.No_Ref) LEFT JOIN para_outlet O ON (O.OutletID=J.OutletID) LEFT JOIN inv_produk P ON (P.InvID=D.InvID) LEFT JOIN para_satuan S ON (S.SatuanID=D.SatuanID) LEFT JOIN para_rasa R ON (R.RasaID=D.RasaID) WHERE J.Data_Jual=1".$qsql." ORDER BY D.Tgl_Ref,O.Nama_Outlet,P.Nama_Produk,D.RasaID,D.SatuanID");
|
||||
}
|
||||
}
|
||||
|
||||
if ( $data == "print" ) {
|
||||
Report_Header("LAPORAN ".($tipe=="R"?"REKAP":($tipe=="B"?"DETAIL & BONUS":"DETAIL"))." PENJUALAN PRODUK PROMO", $tglheader);
|
||||
$pre = new PrintHTML();
|
||||
$pre->set_css("garis");
|
||||
|
||||
if ($tipe=="R") {
|
||||
if ($id_inv>0) echo "Nama Produk : ".$aproduk['Nama_Produk']."<br>";
|
||||
|
||||
$pre->add_field("NO.",10,"C");
|
||||
$pre->add_field("NAMA PRODUK",120);
|
||||
$pre->add_field("JUMLAH",20,"R","rupiah2");
|
||||
$pre->add_field("SATUAN",20);
|
||||
$pre->show_fields();
|
||||
|
||||
$no = 1;
|
||||
while ($db->Next()) {
|
||||
$pre->add_value($no++, $db->Row("Nama_Produk"), $db->Row("Qty"), $db->Row("Nama_Satuan"));
|
||||
}
|
||||
|
||||
} else if ($tipe=="B") {
|
||||
$t_head = '<table class="garis"><tbody>';
|
||||
if ($id_sales>0 && $id_sales=="NON") $t_head .= '<tr><td class="l nb b" colspan="'.((count($aheader)*2)+5).'">NAMA SALES : '.$asales['Nama_Sales'].'</td></tr>';
|
||||
$t_head .= '<tr><th class="c" rowspan="2" width="10">NO.</th><th class="c" rowspan="2" width="20">TANGGAL</th><th class="c" rowspan="2" width="20">NO. NOTA</th><th class="c" rowspan="2" width="120">NAMA OUTLET</th><th class="c" rowspan="2" width="120">ALAMAT OUTLET</th>';
|
||||
$t_shead = '<tr>';
|
||||
foreach ($aheader as $_key => $_val) {
|
||||
$t_head .= '<th class="c" colspan="2" width="60">'.$_val.'</th>';
|
||||
$t_shead .= '<th class="c" width="20">Qty</th><th class="c" width="20">Bonus</th>';
|
||||
}
|
||||
$t_head .= '</tr>' . $t_shead . '</tr>';
|
||||
|
||||
$t_cont = ""; $i_no = 1;
|
||||
foreach ($adata as $_key => $_val) {
|
||||
$t_cont .= '<tr><td class="c">'.$i_no.'</td><td class="c">'.$_val['Tgl_Jual'].'</td><td class="l">'.$_val['No_Jual'].$_val['Kode'].'</td><td class="l">'.$_val['N_Outlet'].'</td><td class="l">'.$_val['A_Outlet'].'</td>';
|
||||
foreach ($aheader as $_skey => $_sval) {
|
||||
$t_cont .= (isset($_val[$_skey])) ? '<td class="r">'.rupiah2($_val[$_skey]['Qty']).'</td><td class="r">'.rupiah2($_val[$_skey]['Bonus']).'</td>' : '<td class="r"> </td><td class="r"> </td>';
|
||||
}
|
||||
$t_cont .= '</tr>';
|
||||
$i_no++;
|
||||
}
|
||||
|
||||
$t_foot = '<tr><td colspan="'.((count($aheader)*2)+5).'" class="nb">'.$pre->get_stamp(1,true).'</td></tr></tbody></table>';
|
||||
echo $t_head . $t_cont . $t_foot;
|
||||
|
||||
} else {
|
||||
if ($id_inv>0) echo "Nama Produk : ".$aproduk['Nama_Produk']."<br>";
|
||||
|
||||
$pre->add_field("NO.",10,"C");
|
||||
$pre->add_field("NAMA PRODUK",120);
|
||||
$pre->add_field("JUMLAH",20,"R","rupiah2");
|
||||
$pre->add_field("SATUAN",20);
|
||||
$pre->show_fields();
|
||||
|
||||
$no = 1; $no_ref = "";
|
||||
while ($db->Next()) {
|
||||
if ($no_ref <> $db->Row("No_Ref")) {
|
||||
$pre->add_span(array(" ",4,"L,NB"));
|
||||
$pre->add_span(array('<table width="100%"><tr><td width="100" class="nb">NO. NOTA</td><td class="nb">: '.$db->Row("No_Ref")." / TANGGAL : ".$db->Row("Tgl_Ref2")." / NO. FAKTUR : ".$db->Row("No_Faktur").'</td></tr><tr><td class="nb">NAMA OUTLET</td><td class="nb">: '.$db->Row("Nama_Outlet").'</td></tr><tr><td class="nb">ALAMAT OUTLET</td><td class="nb">: '.$db->Row("Alamat_Outlet").'</td></tr></table>',4));
|
||||
$no = 1;
|
||||
}
|
||||
$pre->add_value($no++, $db->Row("Nama_Produk"), $db->Row("Qty"), $db->Row("Nama_Satuan"));
|
||||
$no_ref = $db->Row("No_Ref");
|
||||
}
|
||||
}
|
||||
if ($tipe <> "B") {
|
||||
$pre->add_stamp(1, true);
|
||||
$pre->show();
|
||||
}
|
||||
|
||||
} else if ( $data == "export" ) {
|
||||
$xls = new SimpleXLS([
|
||||
'title'=>"Laporan Penjualan ".($tipe=="R"?"Rekap":"Detail")." Penjualan",
|
||||
'subject'=>"PT.PMS",
|
||||
'desc'=>"Export Data dari IAS"
|
||||
]);
|
||||
$xls->add_header("<b>".strtoupper($_SESSION['__WEB_APP']['REG_NAME'])."</b>");
|
||||
|
||||
if ($tipe=="R") {
|
||||
$xls->add_header("<b>LAPORAN REKAP PENJUALAN PRODUK PROMO</b>");
|
||||
$xls->add_header($tglheader);
|
||||
|
||||
$xls->add_field("NO.", 5, "C");
|
||||
$xls->add_field("NAMA PRODUK", 80, "L");
|
||||
$xls->add_field("JUMLAH", 15, "R,N");
|
||||
$xls->add_field("SATUAN", 15, "L");
|
||||
$xls->add_sheet("REKAP PENJUALAN PROMO", false);
|
||||
|
||||
if ($id_inv>0) $xls->add_span(["Nama Produk : ".$aproduk['Nama_Produk'],4,"L"]);
|
||||
$xls->show_headers();
|
||||
|
||||
$no = 1;
|
||||
while ($db->Next()) {
|
||||
$xls->add_value($no++, $db->Row("Nama_Produk"), $db->Row("Qty"), $db->Row("Nama_Satuan"));
|
||||
}
|
||||
|
||||
} else if ($tipe=="B") {
|
||||
$wbook = new Spreadsheet_Excel_Writer();
|
||||
$fjudul =& $wbook->addFormat();
|
||||
$fjudul->setBold();
|
||||
$fjudul->setAlign("center");
|
||||
$fhead =& $wbook->addFormat();
|
||||
$fhead->setBold();
|
||||
$fhead->setAlign("center");
|
||||
$fhead->setVAlign("vcenter");
|
||||
$fhead->setBorder(1);
|
||||
$fhead->setTextWrap();
|
||||
$ftxt =& $wbook->addFormat();
|
||||
$ftxt->setVAlign("top");
|
||||
$ftxt->setTextWrap();
|
||||
$ftxt->setNumFormat("@");
|
||||
$fbtxt =& $wbook->addFormat();
|
||||
$fbtxt->setVAlign("top");
|
||||
$fbtxt->setItalic();
|
||||
$fbtxt->setNumFormat("@");
|
||||
$fnum =& $wbook->addFormat();
|
||||
$fnum->setNumFormat(4);
|
||||
|
||||
$jum_col = (count($aheader)*2) + 5;
|
||||
$baris = 4;
|
||||
|
||||
$wsheet =& $wbook->addWorksheet("DETAIL + BONUS");
|
||||
$wsheet->setColumn(0,0,4);
|
||||
$wsheet->setColumn(1,2,12);
|
||||
$wsheet->setColumn(3,3,20);
|
||||
$wsheet->setColumn(4,4,30);
|
||||
$wsheet->write(0,0,strtoupper($_SESSION['__WEB_APP']['REG_NAME']),$fjudul);
|
||||
$wsheet->setMerge(0,0,0,$jum_col-1);
|
||||
$wsheet->write(1,0,"LAPORAN DETAIL & BONUS PENJUALAN PRODUK PROMO",$fjudul);
|
||||
$wsheet->setMerge(1,0,1,$jum_col-1);
|
||||
$wsheet->write(2,0,"PERIODE : ".$tglheader,$fjudul);
|
||||
$wsheet->setMerge(2,0,2,$jum_col-1);
|
||||
|
||||
if ($id_sales>0 && $id_sales=="NON") {
|
||||
$wsheet->write($baris,0,"NAMA SALES : ".$nama_sales,$ftxt);
|
||||
$wsheet->setMerge($baris,0,$baris,$jum_col-1);
|
||||
$baris++;
|
||||
}
|
||||
|
||||
for ($_x=0;$_x<$jum_col;$_x++) {
|
||||
$wsheet->write($baris,$_x,"",$fhead);
|
||||
$wsheet->write($baris+1,$_x,"",$fhead);
|
||||
}
|
||||
$wsheet->write($baris,0,"No.",$fhead);
|
||||
$wsheet->setMerge($baris,0,$baris+1,0);
|
||||
$wsheet->write($baris,1,"Tanggal",$fhead);
|
||||
$wsheet->setMerge($baris,1,$baris+1,1);
|
||||
$wsheet->write($baris,2,"No. Nota",$fhead);
|
||||
$wsheet->setMerge($baris,2,$baris+1,2);
|
||||
$wsheet->write($baris,3,"Nama Outlet",$fhead);
|
||||
$wsheet->setMerge($baris,3,$baris+1,3);
|
||||
$wsheet->write($baris,4,"Alamat Outlet",$fhead);
|
||||
$wsheet->setMerge($baris,4,$baris+1,4);
|
||||
|
||||
$h_kol = 5;
|
||||
foreach ($aheader as $_key => $_val) {
|
||||
$wsheet->setColumn($h_kol,$h_kol+1,6);
|
||||
$wsheet->write($baris,$h_kol,$_val,$fhead);
|
||||
$wsheet->setMerge($baris,$h_kol,$baris,$h_kol+1);
|
||||
$wsheet->write($baris+1,$h_kol,"Qty",$fhead);
|
||||
$wsheet->write($baris+1,$h_kol+1,"Bonus",$fhead);
|
||||
$h_kol += 2;
|
||||
}
|
||||
$baris += 2;
|
||||
|
||||
$i_no = 1;
|
||||
foreach ($adata as $_key => $_val) {
|
||||
$wsheet->write($baris,0, $i_no, $ftxt);
|
||||
$wsheet->write($baris,1, $_val['Tgl_Jual'], $ftxt);
|
||||
$wsheet->write($baris,2, $_val['No_Jual'].$_val['Kode'], $ftxt);
|
||||
$wsheet->write($baris,3, $_val['N_Outlet'], $ftxt);
|
||||
$wsheet->write($baris,4, $_val['A_Outlet'], $ftxt);
|
||||
|
||||
$h_kol = 5;
|
||||
foreach ($aheader as $_skey => $_sval) {
|
||||
if (isset($_val[$_skey])) {
|
||||
$wsheet->write($baris,$h_kol, $_val[$_skey]['Qty'], $fnum);
|
||||
$wsheet->write($baris,$h_kol+1, $_val[$_skey]['Bonus'], $fnum);
|
||||
} else {
|
||||
$wsheet->write($baris,$h_kol, "", $fnum);
|
||||
$wsheet->write($baris,$h_kol+1, "", $fnum);
|
||||
}
|
||||
$h_kol += 2;
|
||||
}
|
||||
$i_no++;
|
||||
$baris++;
|
||||
}
|
||||
|
||||
$wsheet->write($baris,0,$xls->get_stamp(1,true),$fbtxt);
|
||||
$wbook->send("DATA DETAIL & BONUS PENJUALAN ".tgl_dmy(true).".xls");
|
||||
$wbook->close();
|
||||
|
||||
} else {
|
||||
$xls->add_header("<b>LAPORAN DETAIL PENJUALAN PRODUK PROMO</b>");
|
||||
$xls->add_header($tglheader);
|
||||
|
||||
$xls->add_field("NO.", 5, "C");
|
||||
$xls->add_field("NAMA PRODUK", 80, "L");
|
||||
$xls->add_field("JUMLAH", 15, "R,N");
|
||||
$xls->add_field("SATUAN", 15, "L");
|
||||
$xls->add_sheet("DETAIL PENJUALAN PROMO", false);
|
||||
|
||||
if ($id_inv>0) $xls->add_span(["Nama Produk : ".$aproduk['Nama_Produk'],4,"L"]);
|
||||
$xls->show_headers();
|
||||
|
||||
$no = 1; $no_ref = "";
|
||||
while ($db->Next()) {
|
||||
if ($no_ref <> $db->Row("No_Ref")) {
|
||||
$xls->add_span(array("",4,"L,NL"));
|
||||
$xls->add_span(array("NO. NOTA : ".$db->Row("No_Ref")." / TANGGAL : ".$db->Row("Tgl_Ref2")." / NO. FAKTUR : ".$db->Row("No_Faktur"),4,"L"));
|
||||
$xls->add_span(array("NAMA OUTLET : ".$db->Row("Nama_Outlet"),4,"L"));
|
||||
$xls->add_span(array("ALAMAT OUTLET : ".$db->Row("Alamat_Outlet"),4,"L"));
|
||||
$no = 1;
|
||||
}
|
||||
$xls->add_value($no++, $db->Row("Nama_Produk"), $db->Row("Qty"), $db->Row("Nama_Satuan"));
|
||||
$no_ref = $db->Row("No_Ref");
|
||||
}
|
||||
}
|
||||
$xls->add_stamp(1, true);
|
||||
$xls->send("Laporan Penjualan Produk Promo.xlsx");
|
||||
unset($xls);
|
||||
|
||||
} else if ( $data == "option-produk" ) {
|
||||
$tsql = ($id_grup == 0) ? " Grup_InvID NOT IN ('".$_SESSION['__APP_IAS']['GRUP_PRODUK_KEMASAN']."','".$_SESSION['__APP_IAS']['GRUP_PRODUK_HADIAH']."')" : " Grup_InvID='".$id_grup."'";
|
||||
$aoption = ['type' => "option", 'id' => "InvID", 'value' => 0, 'avalue' => [['value'=>0,'html'=>"SEMUA PRODUK"]]];
|
||||
$db->Query("SELECT * FROM inv_produk WHERE".$tsql." ORDER BY Nama_Produk");
|
||||
while ($db->Next()) {
|
||||
$aoption['avalue'][] = ['value'=>$db->Row("InvID"), 'html'=>$db->Row("Nama_Produk")];
|
||||
}
|
||||
$ajson[] = $aoption;
|
||||
|
||||
} else if ( $data == "default") {
|
||||
$asales = ['SEMUA' => "SEMUA SALES", 'NON' => "TANPA-SALES"];
|
||||
$db->Query("SELECT PegID,Nama_Pegawai FROM para_pegawai WHERE Jenis_PegID='".$_SESSION['__APP_IAS']['GRUP_PEG_SALES']."' ORDER BY Nama_Pegawai");
|
||||
while ($db->Next()){
|
||||
$asales[$db->Row("PegID")] = $db->Row("Nama_Pegawai");
|
||||
}
|
||||
|
||||
$form = new Form($db);
|
||||
$ttipe = $form->radio("_", "Tipe", "R", true, false, ["R"=>"Rekap","D"=>"Detail","B"=>"Detail + Bonus"]);
|
||||
$trekap = $form->radio("_", "Rekap", "X", true, false, ["1"=>"Antar","0"=>"Belum Antar","X"=>"Semua"]);
|
||||
$tsales = $form->option("_", "SalesID", "SEMUA", true, false, $asales);
|
||||
$tgrup = $form->option_db("_", "Grup_InvID", 0, true, false, "inv_produk_grup", ["Grup_InvID","Nama_Grup"], "Grup_InvID NOT IN ('".$_SESSION['__APP_IAS']['GRUP_PRODUK_KEMASAN']."','".$_SESSION['__APP_IAS']['GRUP_PRODUK_HADIAH']."') ORDER BY Nama_Grup", [0,"SEMUA GRUP PRODUK"], null, "RepoRekapPromoJS.oc_Grup();");
|
||||
$tproduk = $form->option("_", "InvID", $id_inv, true, false, []);
|
||||
$ttglfrom = $form->datebox("_", "Tgl_From", tgl_ymd(), true, false);
|
||||
$ttglto = $form->datebox("_", "Tgl_To", tgl_ymd(), true, false);
|
||||
echo '
|
||||
<div class="row mb-1">
|
||||
<label class="col-sm-5 col-lg-3 col-form-label" for="Tipe">Tipe Laporan</label>
|
||||
<div class="col">'.$ttipe.'</div>
|
||||
</div>
|
||||
<div class="row mb-1">
|
||||
<label class="col-sm-5 col-lg-3 col-form-label" for="Rekap">Status Order</label>
|
||||
<div class="col">'.$trekap.'</div>
|
||||
</div>
|
||||
<div class="row mb-1">
|
||||
<label class="col-sm-5 col-lg-3 col-form-label" for="SalesID">Nama Sales</label>
|
||||
<div class="col">'.$tsales.'</div>
|
||||
</div>
|
||||
<div class="row mb-1">
|
||||
<label class="col-sm-5 col-lg-3 col-form-label" for="Grup_InvID">Grup Produk</label>
|
||||
<div class="col">'.$tgrup.'</div>
|
||||
</div>
|
||||
<div class="row mb-1">
|
||||
<label class="col-sm-5 col-lg-3 col-form-label" for="InvID">Nama Produk</label>
|
||||
<div class="col">'.$tproduk.'</div>
|
||||
</div>
|
||||
<div class="row mb-1"><div class="col"><hr class="my-1"></div></div>
|
||||
<div class="row mb-1">
|
||||
<label class="col-sm-5 col-lg-3 col-form-label" for="Tgl_From">Dari Tanggal</label>
|
||||
<div class="col">'.$ttglfrom.'</div>
|
||||
</div>
|
||||
<div class="row mb-1">
|
||||
<label class="col-sm-5 col-lg-3 col-form-label" for="Tgl_To">Sampai Tanggal</label>
|
||||
<div class="col">'.$ttglto.'</div>
|
||||
</div>';
|
||||
|
||||
}
|
||||
|
||||
send_json($ajson);
|
||||
?>
|
||||
Reference in New Issue
Block a user