fix report surat jalan
This commit is contained in:
@@ -12,7 +12,7 @@ class SuratJalanFpdf extends FPDF
|
|||||||
public $printUsername = '-';
|
public $printUsername = '-';
|
||||||
public $printDate = '';
|
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);
|
parent::__construct($orientation, $unit, $size);
|
||||||
// Daftarkan Arial Narrow — file font ada di fpdf/font/Arial_Narrow.php
|
// 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('Cache-Control: private, max-age=0, must-revalidate');
|
||||||
header('Pragma: public');
|
header('Pragma: public');
|
||||||
echo $this->_pdf->Output('S');
|
echo $this->_pdf->Output('S');
|
||||||
|
|
||||||
} catch (Exception $exc) {
|
} catch (Exception $exc) {
|
||||||
$this->sys_error($exc->getMessage());
|
$this->sys_error($exc->getMessage());
|
||||||
}
|
}
|
||||||
@@ -132,8 +131,7 @@ class Rpt_surat_jalan extends MY_Controller
|
|||||||
tg.T_GoodsTransferType,
|
tg.T_GoodsTransferType,
|
||||||
tg.T_GoodsTransferFromM_BranchCode,
|
tg.T_GoodsTransferFromM_BranchCode,
|
||||||
tg.T_GoodsTransferToM_BranchCode,
|
tg.T_GoodsTransferToM_BranchCode,
|
||||||
bFrom.M_BranchName AS BranchFromName,
|
rFrom.S_RegionalName AS RegionalFromName,
|
||||||
bFrom.M_BranchAddress AS BranchFromAddress,
|
|
||||||
bTo.M_BranchName AS BranchToName,
|
bTo.M_BranchName AS BranchToName,
|
||||||
bTo.M_BranchAddress AS BranchToAddress
|
bTo.M_BranchAddress AS BranchToAddress
|
||||||
FROM suratjalan sj
|
FROM suratjalan sj
|
||||||
@@ -143,7 +141,7 @@ class Rpt_surat_jalan extends MY_Controller
|
|||||||
AND ex.ExpeditionIsActive = 'Y'
|
AND ex.ExpeditionIsActive = 'Y'
|
||||||
LEFT JOIN expeditionstaff exs ON exs.ExpeditionStaffID = sj.SuratJalanEkspedisiStaffID
|
LEFT JOIN expeditionstaff exs ON exs.ExpeditionStaffID = sj.SuratJalanEkspedisiStaffID
|
||||||
AND exs.ExpeditionStaffIsActive = 'Y'
|
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
|
LEFT JOIN m_branch bTo ON bTo.M_BranchCode = tg.T_GoodsTransferToM_BranchCode
|
||||||
WHERE sj.SuratJalanIsActive = 'Y'
|
WHERE sj.SuratJalanIsActive = 'Y'
|
||||||
AND sj.SuratJalanID = ?
|
AND sj.SuratJalanID = ?
|
||||||
@@ -247,8 +245,7 @@ class Rpt_surat_jalan extends MY_Controller
|
|||||||
$rightX = 15 + $halfW;
|
$rightX = 15 + $halfW;
|
||||||
|
|
||||||
$rightItems = array(
|
$rightItems = array(
|
||||||
array('Dari Cabang', $header['BranchFromName'] ?: '-'),
|
array('Dari Regional', $header['RegionalFromName'] ?: '-'),
|
||||||
array('Alamat Asal', $header['BranchFromAddress'] ?: '-'),
|
|
||||||
array('Tujuan Cabang', $header['BranchToName'] ?: '-'),
|
array('Tujuan Cabang', $header['BranchToName'] ?: '-'),
|
||||||
array('Alamat Tujuan', $header['BranchToAddress'] ?: '-'),
|
array('Alamat Tujuan', $header['BranchToAddress'] ?: '-'),
|
||||||
array('Ekspedisi', $header['ExpeditionName'] ?: '-'),
|
array('Ekspedisi', $header['ExpeditionName'] ?: '-'),
|
||||||
@@ -263,7 +260,7 @@ class Rpt_surat_jalan extends MY_Controller
|
|||||||
$pdf->Cell(4, 5, ':', 0, 0, 'C');
|
$pdf->Cell(4, 5, ':', 0, 0, 'C');
|
||||||
$pdf->SetFont('Arial_Narrow', '', 9);
|
$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');
|
$pdf->MultiCell($valW, 5, $item[1], 0, 'L');
|
||||||
} else {
|
} else {
|
||||||
$pdf->Cell($valW, 5, $item[1], 0, 1, 'L');
|
$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
|
// 8 + 62 + 20 + 20 + 42 + 28 = 180
|
||||||
$cols = array(
|
$cols = array(
|
||||||
array('No', 8, 'C'),
|
array('No', 8, 'C'),
|
||||||
array('Nama / Uraian', 62, 'L'),
|
array('Nama', 62, 'L'),
|
||||||
array('Unit', 20, 'C'),
|
array('Unit', 20, 'C'),
|
||||||
array('Qty Kirim', 20, 'R'),
|
array('Qty Kirim', 20, 'R'),
|
||||||
array('No. PR / Ref', 42, 'L'),
|
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[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[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[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[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();
|
$pdf->Ln();
|
||||||
|
|
||||||
$no++;
|
$no++;
|
||||||
|
|||||||
Reference in New Issue
Block a user