オープンソース・ソフトウェア情報サイト

vtigerの見積・請求書PDFの修正

vtiger標準の見積書と請求書の宛名表示を日本の体裁に修正する方法です。

/vtigercrm/include/InventoryPDFController.php

社名の表示順を下記に変更
$addressValues = array();
$addressValues[] = $resultrow[‘code’];

if(!empty($resultrow[‘country’])) $addressValues[]= “\n”.$resultrow[‘country’];
if(!empty($resultrow[‘state’])) $addressValues[]= “\n”.$resultrow[‘state’];
if(!empty($resultrow[‘city’])) $addressValues[]= “”.$resultrow[‘city’];
if(!empty($resultrow[‘city’])) $addressValues[]= “\n”.$resultrow[‘address’];

請求先・送付先の順を下記に変更
function buildHeaderBillingAddress() {
$billPoBox = $this->focusColumnValues(array(‘bill_pobox’));
$billStreet = $this->focusColumnValues(array(‘bill_street’));
$billCity = $this->focusColumnValues(array(‘bill_city’));
$billState = $this->focusColumnValues(array(‘bill_state’));
$billCountry = $this->focusColumnValues(array(‘bill_country’));
$billCode = $this->focusColumnValues(array(‘bill_code’));
$address = $this->joinValues(array($billCode), ‘ ‘);
$address .= “\n”.$this->joinValues(array($billState, $billCity), ‘ ‘);
$address .= “\n”.$this->joinValues(array($billStreet), ‘ ‘);
return $address;
}

function buildHeaderShippingAddress() {
$shipPoBox = $this->focusColumnValues(array(‘ship_pobox’));
$shipStreet = $this->focusColumnValues(array(‘ship_street’));
$shipCity = $this->focusColumnValues(array(‘ship_city’));
$shipState = $this->focusColumnValues(array(‘ship_state’));
$shipCountry = $this->focusColumnValues(array(‘ship_country’));
$shipCode = $this->focusColumnValues(array(‘ship_code’));
$address = $this->joinValues(array($shipCode), ‘ ‘);
$address .= “\n”.$this->joinValues(array($shipState, $shipCity), ‘,’);
$address .= “\n”.$this->joinValues(array($shipStreet), ‘,’);
return $address;

ついでに数量と金額を右寄せにしてみましたが・・・
vtlib/Vtiger/PDF/inventory/ContentViewer.php
Line : 116
Original :
$pdf->MultiCell($cellWidth, $contentHeight, $model->get($cellName), 0, ‘L’, 0, 1, $contentLineX+$offsetX, $contentLineY);
Changes :
$pdf->MultiCell($cellWidth, $contentHeight, $model->get($cellName), 0, ‘R’, 0, 1, $contentLineX+$offsetX, $contentLineY);
shipping01
左寄せが右寄せに↓
shipping02
う~ん、惜しい!!製品コードと名はそのままじゃないと。
見栄えは若干良くなりますが、やはりPDFMakerを使用するのが良いですね。

関連記事

コメント

  1. この記事へのコメントはありません。

  1. この記事へのトラックバックはありません。

最近のコメント