diff --git a/application/controllers/report/Rpt_surat_jalan.php b/application/controllers/report/Rpt_surat_jalan.php index c37d80e..60c196a 100644 --- a/application/controllers/report/Rpt_surat_jalan.php +++ b/application/controllers/report/Rpt_surat_jalan.php @@ -12,7 +12,7 @@ class SuratJalanFpdf extends FPDF public $printUsername = '-'; public $printDate = ''; - public function __construct($orientation='P', $unit='mm', $size='A4') + public function __construct($orientation = 'P', $unit = 'mm', $size = 'A4') { parent::__construct($orientation, $unit, $size); // Daftarkan Arial Narrow — file font ada di fpdf/font/Arial_Narrow.php @@ -109,7 +109,6 @@ class Rpt_surat_jalan extends MY_Controller header('Cache-Control: private, max-age=0, must-revalidate'); header('Pragma: public'); echo $this->_pdf->Output('S'); - } catch (Exception $exc) { $this->sys_error($exc->getMessage()); } @@ -132,8 +131,7 @@ class Rpt_surat_jalan extends MY_Controller tg.T_GoodsTransferType, tg.T_GoodsTransferFromM_BranchCode, tg.T_GoodsTransferToM_BranchCode, - bFrom.M_BranchName AS BranchFromName, - bFrom.M_BranchAddress AS BranchFromAddress, + rFrom.S_RegionalName AS RegionalFromName, bTo.M_BranchName AS BranchToName, bTo.M_BranchAddress AS BranchToAddress FROM suratjalan sj @@ -143,7 +141,7 @@ class Rpt_surat_jalan extends MY_Controller AND ex.ExpeditionIsActive = 'Y' LEFT JOIN expeditionstaff exs ON exs.ExpeditionStaffID = sj.SuratJalanEkspedisiStaffID AND exs.ExpeditionStaffIsActive = 'Y' - LEFT JOIN m_branch bFrom ON bFrom.M_BranchCode = tg.T_GoodsTransferFromM_BranchCode + LEFT JOIN s_regional rFrom ON rFrom.S_RegionalID = tg.T_GoodsTransferFromS_RegionalID LEFT JOIN m_branch bTo ON bTo.M_BranchCode = tg.T_GoodsTransferToM_BranchCode WHERE sj.SuratJalanIsActive = 'Y' AND sj.SuratJalanID = ? @@ -211,7 +209,7 @@ class Rpt_surat_jalan extends MY_Controller // ── Kolom Kiri ──────────────────────────────────────────────────────── $pdf->SetY($startY); - + $leftItems = array( array('Nomor SJ', $header['SuratJalanNumber'], true), array('Tanggal SJ', $this->_fmt_date($header['SuratJalanDate']), false), @@ -247,8 +245,7 @@ class Rpt_surat_jalan extends MY_Controller $rightX = 15 + $halfW; $rightItems = array( - array('Dari Cabang', $header['BranchFromName'] ?: '-'), - array('Alamat Asal', $header['BranchFromAddress'] ?: '-'), + array('Dari Regional', $header['RegionalFromName'] ?: '-'), array('Tujuan Cabang', $header['BranchToName'] ?: '-'), array('Alamat Tujuan', $header['BranchToAddress'] ?: '-'), array('Ekspedisi', $header['ExpeditionName'] ?: '-'), @@ -262,8 +259,8 @@ class Rpt_surat_jalan extends MY_Controller $pdf->Cell($lblW, 5, $item[0], 0, 0, 'L'); $pdf->Cell(4, 5, ':', 0, 0, 'C'); $pdf->SetFont('Arial_Narrow', '', 9); - - if ($item[0] === 'Alamat Asal' || $item[0] === 'Alamat Tujuan') { + + if ($item[0] === 'Alamat Tujuan') { $pdf->MultiCell($valW, 5, $item[1], 0, 'L'); } else { $pdf->Cell($valW, 5, $item[1], 0, 1, 'L'); @@ -289,7 +286,7 @@ class Rpt_surat_jalan extends MY_Controller // 8 + 62 + 20 + 20 + 42 + 28 = 180 $cols = array( array('No', 8, 'C'), - array('Nama / Uraian', 62, 'L'), + array('Nama', 62, 'L'), array('Unit', 20, 'C'), array('Qty Kirim', 20, 'R'), array('No. PR / Ref', 42, 'L'), @@ -316,9 +313,9 @@ class Rpt_surat_jalan extends MY_Controller $pdf->Cell($cols[0][1], 6, $no, 1, 0, 'C'); $pdf->Cell($cols[1][1], 6, $d['M_ItemDesc'] ?: ($d['M_ItemCode'] ?: '-'), 1, 0, 'L'); $pdf->Cell($cols[2][1], 6, $d['ItemUnitName'] ?: ($d['ItemUnitCode'] ?: '-'), 1, 0, 'C'); - $pdf->Cell($cols[3][1], 6, $this->_fmt_qty($d['SuratJalanDetailQty']), 1, 0, 'R'); + $pdf->Cell($cols[3][1], 6, $this->_fmt_qty($d['SuratJalanDetailQty']), 1, 0, 'C'); $pdf->Cell($cols[4][1], 6, $d['PurchaseRequestNumber'] ?: '-', 1, 0, 'L'); - $pdf->Cell($cols[5][1], 6, $this->_fmt_qty($d['SuratJalanDetailQtyReceived']), 1, 0, 'R'); + $pdf->Cell($cols[5][1], 6, $this->_fmt_qty($d['SuratJalanDetailQtyReceived']), 1, 0, 'C'); $pdf->Ln(); $no++;