hapus bagian tanda tangan
This commit is contained in:
@@ -101,7 +101,6 @@ class Rpt_pr_direct extends MY_Controller
|
|||||||
$this->_pdf_header();
|
$this->_pdf_header();
|
||||||
$this->_pdf_data($details);
|
$this->_pdf_data($details);
|
||||||
$this->_pdf_terms();
|
$this->_pdf_terms();
|
||||||
$this->_pdf_signatures();
|
|
||||||
|
|
||||||
// ── Output ────────────────────────────────────────────────────────
|
// ── Output ────────────────────────────────────────────────────────
|
||||||
$filename = 'PRD_' . str_replace('/', '-', $header['PurchaseRequestDirectNumber']) . '.pdf';
|
$filename = 'PRD_' . str_replace('/', '-', $header['PurchaseRequestDirectNumber']) . '.pdf';
|
||||||
@@ -195,9 +194,10 @@ class Rpt_pr_direct extends MY_Controller
|
|||||||
array('Status', $header['PurchaseRequestDirectStatus']),
|
array('Status', $header['PurchaseRequestDirectStatus']),
|
||||||
);
|
);
|
||||||
$right = array(
|
$right = array(
|
||||||
array('Cabang', $header['M_BranchName']),
|
array('Cabang', $header['M_BranchName']),
|
||||||
array('Regional', $header['S_RegionalName']),
|
array('Regional', $header['S_RegionalName']),
|
||||||
array('Alamat', $header['M_BranchAddress']),
|
array('Alamat', $header['M_BranchAddress']),
|
||||||
|
array('Dibuat Oleh', $header['CreatedByName']),
|
||||||
);
|
);
|
||||||
|
|
||||||
$maxRow = max(count($left), count($right));
|
$maxRow = max(count($left), count($right));
|
||||||
@@ -351,26 +351,7 @@ class Rpt_pr_direct extends MY_Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
// PDF SECTION: Tanda Tangan
|
|
||||||
// =========================================================================
|
|
||||||
private function _pdf_signatures()
|
|
||||||
{
|
|
||||||
$pdf = $this->_pdf;
|
|
||||||
$pageW = $this->_pageW;
|
|
||||||
$header = $this->_header_data;
|
|
||||||
|
|
||||||
$colTtd = $pageW / 2;
|
|
||||||
|
|
||||||
$pdf->Ln(8);
|
|
||||||
$pdf->SetFont('Arial_Narrow', '', 9);
|
|
||||||
$pdf->Cell($colTtd, 5, 'Dibuat oleh,', 0, 0, 'C');
|
|
||||||
$pdf->Cell($colTtd, 5, 'Diketahui oleh,', 0, 1, 'C');
|
|
||||||
|
|
||||||
$pdf->Ln(15); // Ruang tanda tangan
|
|
||||||
$pdf->SetFont('Arial_Narrow', 'B', 9);
|
|
||||||
$pdf->Cell($colTtd, 5, '( ' . ($header['CreatedByName'] ?: ' ') . ' )', 0, 0, 'C');
|
|
||||||
$pdf->Cell($colTtd, 5, '( )', 0, 1, 'C');
|
|
||||||
}
|
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
// HELPER: Format tampilan
|
// HELPER: Format tampilan
|
||||||
|
|||||||
@@ -108,7 +108,6 @@ class Rpt_pr_direct_approval extends MY_Controller
|
|||||||
$this->_pdf_header();
|
$this->_pdf_header();
|
||||||
$this->_pdf_data($details);
|
$this->_pdf_data($details);
|
||||||
$this->_pdf_terms();
|
$this->_pdf_terms();
|
||||||
$this->_pdf_signatures();
|
|
||||||
|
|
||||||
// ── Output ────────────────────────────────────────────────────────
|
// ── Output ────────────────────────────────────────────────────────
|
||||||
$filename = 'PRD_APPROVAL_' . str_replace('/', '-', $header['PurchaseRequestDirectNumber']) . '.pdf';
|
$filename = 'PRD_APPROVAL_' . str_replace('/', '-', $header['PurchaseRequestDirectNumber']) . '.pdf';
|
||||||
@@ -191,65 +190,81 @@ class Rpt_pr_direct_approval extends MY_Controller
|
|||||||
$pdf->Ln(2);
|
$pdf->Ln(2);
|
||||||
|
|
||||||
// ── Info dokumen: 2 kolom (kiri & kanan) ─────────────────────────────
|
// ── Info dokumen: 2 kolom (kiri & kanan) ─────────────────────────────
|
||||||
$half = $pageW / 2;
|
$startY = $pdf->GetY();
|
||||||
$lbl = 30;
|
$halfW = $pageW / 2;
|
||||||
$val = $half - $lbl - 4;
|
$lblW = 28;
|
||||||
|
$valW = $halfW - $lblW - 4;
|
||||||
|
|
||||||
$left = array(
|
// ── Kolom Kiri ────────────────────────────────────────────────────────
|
||||||
array('Nomor', $header['PurchaseRequestDirectNumber']),
|
$pdf->SetY($startY);
|
||||||
array('Tanggal', $this->_fmt_date($header['PurchaseRequestDirectDate'])),
|
|
||||||
array('Tanggal Pelaksanaan', $this->_fmt_date($header['PurchaseRequestDirectDateUse'])),
|
$leftItems = array(
|
||||||
array('Status', $header['PurchaseRequestDirectStatus']),
|
array('Nomor', $header['PurchaseRequestDirectNumber'], true),
|
||||||
);
|
array('Tanggal', $this->_fmt_date($header['PurchaseRequestDirectDate']), false),
|
||||||
$right = array(
|
array('Tanggal Pelaksanaan', $this->_fmt_date($header['PurchaseRequestDirectDateUse']), false),
|
||||||
array('Cabang', $header['M_BranchName']),
|
array('Status', $header['PurchaseRequestDirectStatus'], false),
|
||||||
array('Regional', $header['S_RegionalName']),
|
|
||||||
array('Alamat', $header['M_BranchAddress']),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$maxRow = max(count($left), count($right));
|
foreach ($leftItems as $item) {
|
||||||
for ($i = 0; $i < $maxRow; $i++) {
|
$pdf->SetX(15);
|
||||||
// kolom kiri
|
$pdf->SetFont('Arial_Narrow', '', 9);
|
||||||
if (isset($left[$i])) {
|
$pdf->Cell($lblW, 5, $item[0], 0, 0, 'L');
|
||||||
$pdf->SetFont('Arial_Narrow', '', 9);
|
$pdf->Cell(4, 5, ':', 0, 0, 'C');
|
||||||
$pdf->Cell($lbl, 5, $left[$i][0], 0, 0, 'L');
|
if ($item[2]) {
|
||||||
$pdf->Cell(4, 5, ':', 0, 0, 'C');
|
$pdf->SetFont('Arial_Narrow', 'B', 9);
|
||||||
if ($left[$i][0] === 'Nomor') {
|
|
||||||
$pdf->SetFont('Arial_Narrow', 'B', 9);
|
|
||||||
} else {
|
|
||||||
$pdf->SetFont('Arial_Narrow', '', 9);
|
|
||||||
}
|
|
||||||
$pdf->Cell($val, 5, $left[$i][1], 0, 0, 'L');
|
|
||||||
} else {
|
} else {
|
||||||
$pdf->Cell($half, 5, '', 0, 0);
|
|
||||||
}
|
|
||||||
// kolom kanan
|
|
||||||
if (isset($right[$i])) {
|
|
||||||
$pdf->SetFont('Arial_Narrow', '', 9);
|
$pdf->SetFont('Arial_Narrow', '', 9);
|
||||||
$pdf->Cell($lbl, 5, $right[$i][0], 0, 0, 'L');
|
|
||||||
$pdf->Cell(4, 5, ':', 0, 0, 'C');
|
|
||||||
$pdf->SetFont('Arial_Narrow', '', 9);
|
|
||||||
$pdf->Cell($val, 5, $right[$i][1], 0, 1, 'L');
|
|
||||||
} else {
|
|
||||||
$pdf->Cell($half, 5, '', 0, 1);
|
|
||||||
}
|
}
|
||||||
|
$pdf->Cell($valW, 5, $item[1], 0, 1, 'L');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keterangan & Catatan (full width)
|
// Keterangan & Catatan langsung di bawah Status (tanpa spasi vertikal)
|
||||||
if (!empty($header['PurchaseRequestDirectDescription'])) {
|
if (!empty($header['PurchaseRequestDirectDescription'])) {
|
||||||
|
$pdf->SetX(15);
|
||||||
$pdf->SetFont('Arial_Narrow', '', 9);
|
$pdf->SetFont('Arial_Narrow', '', 9);
|
||||||
$pdf->Cell($lbl, 5, 'Keterangan', 0, 0, 'L');
|
$pdf->Cell($lblW, 5, 'Keterangan', 0, 0, 'L');
|
||||||
$pdf->Cell(4, 5, ':', 0, 0, 'C');
|
$pdf->Cell(4, 5, ':', 0, 0, 'C');
|
||||||
$pdf->Cell($pageW - $lbl - 4, 5, $header['PurchaseRequestDirectDescription'], 0, 1, 'L');
|
$pdf->MultiCell($valW, 5, $header['PurchaseRequestDirectDescription'], 0, 'L');
|
||||||
}
|
}
|
||||||
if (!empty($header['PurchaseRequestDirectNote'])) {
|
if (!empty($header['PurchaseRequestDirectNote'])) {
|
||||||
|
$pdf->SetX(15);
|
||||||
$pdf->SetFont('Arial_Narrow', '', 9);
|
$pdf->SetFont('Arial_Narrow', '', 9);
|
||||||
$pdf->Cell($lbl, 5, 'Catatan', 0, 0, 'L');
|
$pdf->Cell($lblW, 5, 'Catatan', 0, 0, 'L');
|
||||||
$pdf->Cell(4, 5, ':', 0, 0, 'C');
|
$pdf->Cell(4, 5, ':', 0, 0, 'C');
|
||||||
$pdf->Cell($pageW - $lbl - 4, 5, $header['PurchaseRequestDirectNote'], 0, 1, 'L');
|
$pdf->MultiCell($valW, 5, $header['PurchaseRequestDirectNote'], 0, 'L');
|
||||||
}
|
}
|
||||||
|
$leftY = $pdf->GetY();
|
||||||
|
|
||||||
$pdf->Ln(4);
|
// ── Kolom Kanan ───────────────────────────────────────────────────────
|
||||||
|
$pdf->SetY($startY);
|
||||||
|
$rightX = 15 + $halfW;
|
||||||
|
|
||||||
|
$rightItems = array(
|
||||||
|
array('Cabang', $header['M_BranchName']),
|
||||||
|
array('Regional', $header['S_RegionalName']),
|
||||||
|
array('Alamat', $header['M_BranchAddress']),
|
||||||
|
array('Dibuat Oleh', $header['CreatedByName']),
|
||||||
|
array('Disetujui Oleh', $header['ApprovedByName']),
|
||||||
|
array('Tanggal Approved', $this->_fmt_datetime($header['PurchaseRequestDirectApprovedDate'])),
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($rightItems as $item) {
|
||||||
|
$pdf->SetX($rightX);
|
||||||
|
$pdf->SetFont('Arial_Narrow', '', 9);
|
||||||
|
$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') {
|
||||||
|
$pdf->MultiCell($valW, 5, $item[1], 0, 'L');
|
||||||
|
} else {
|
||||||
|
$pdf->Cell($valW, 5, $item[1], 0, 1, 'L');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$rightY = $pdf->GetY();
|
||||||
|
|
||||||
|
// Posisikan Y ke yang paling bawah + margin
|
||||||
|
$pdf->SetY(max($leftY, $rightY) + 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
@@ -365,44 +380,6 @@ class Rpt_pr_direct_approval extends MY_Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// =========================================================================
|
|
||||||
// PDF SECTION: Tanda Tangan (Requestor, Reviewer, Approver)
|
|
||||||
// =========================================================================
|
|
||||||
private function _pdf_signatures()
|
|
||||||
{
|
|
||||||
$pdf = $this->_pdf;
|
|
||||||
$pageW = $this->_pageW;
|
|
||||||
$header = $this->_header_data;
|
|
||||||
|
|
||||||
// 3 kolom ttd
|
|
||||||
$colTtd = $pageW / 3;
|
|
||||||
|
|
||||||
$pdf->Ln(8);
|
|
||||||
$pdf->SetFont('Arial_Narrow', '', 9);
|
|
||||||
$pdf->Cell($colTtd, 5, 'Dibuat oleh,', 0, 0, 'C');
|
|
||||||
$pdf->Cell($colTtd, 5, 'Diketahui oleh,', 0, 0, 'C');
|
|
||||||
$pdf->Cell($colTtd, 5, 'Disetujui oleh,', 0, 1, 'C');
|
|
||||||
|
|
||||||
$pdf->Ln(15); // Ruang tanda tangan
|
|
||||||
$pdf->SetFont('Arial_Narrow', 'B', 9);
|
|
||||||
|
|
||||||
// Nama pembuat
|
|
||||||
$pdf->Cell($colTtd, 5, '( ' . ($header['CreatedByName'] ?: ' ') . ' )', 0, 0, 'C');
|
|
||||||
|
|
||||||
// Diketahui
|
|
||||||
$pdf->Cell($colTtd, 5, '( )', 0, 0, 'C');
|
|
||||||
|
|
||||||
// Penyetuju + info tanggal disetujui di bawah namanya
|
|
||||||
$pdf->Cell($colTtd, 5, '( ' . ($header['ApprovedByName'] ?: ' ') . ' )', 0, 1, 'C');
|
|
||||||
|
|
||||||
// Info Tanggal Approval di bawah ttd approver
|
|
||||||
if (!empty($header['ApprovedByName']) && $header['PurchaseRequestDirectApprovedDate'] !== '0000-00-00 00:00:00') {
|
|
||||||
$pdf->SetFont('Arial_Narrow', '', 7);
|
|
||||||
$pdf->Cell($colTtd * 2, 4, '', 0, 0);
|
|
||||||
$pdf->Cell($colTtd, 4, 'Approved: ' . date('d-m-Y H:i', strtotime($header['PurchaseRequestDirectApprovedDate'])), 0, 1, 'C');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
// HELPER: Format tampilan
|
// HELPER: Format tampilan
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user