私は請求書の印刷に取り組んでいます。TCPDFマニュアル改ページ
請求書の印刷に問題があります。正確に1ページのアイテムで構成される請求書があるとします。問題は、すべての商品の後に小計、税金、および総額があることです。
この場合、これらの3つは第2ページ(新しいページ)に表示され、アイテムは第1ページに表示されます。
私はtcpdfで保持できる行(すべてのレイアウト形式などの後)を調べて、1ページが28の項目で構成されていることを確認しました。これは、すべての項目が1行で構成されているとうまくいきます。ただし、アイテムの一部が2行以上の行で構成されている場合、計算に問題が発生し、構造全体が混乱することになります。
合計アイテムが28アイテムの場合、自動的に一部のアイテムを2ページ目に移動することができるので、2ページ目は小計、税金、および総計で構成されます。
は、ここに私のコード
$count = 0;
$i = 0;
if(count($finalProduct)>0){
foreach($finalProduct as $product){
foreach($product['product'] as $prod){
if($prod['qty'] > 0){
/* check the row */
if($count >= 27){
$PDFCONTENT .= '<tr style="page-break-after:initial"><td colspan="6"></td></tr>';
$PDFCONTENT .= '<tr><td colspan="6"></td></tr>';
$count = 0;
}
$PDFCONTENT .= '
<tr nobr="true">';
$PDFCONTENT .= '<td align="center" width="7%">'.$prod['index_number'].'</td>';
</tr>';
}
$count++;
}
$PDFCONTENT .= '<tr><td></td></tr>';
}
}
$PDFCONTENT .= '<tfoot>
<tr> <td> </td> </tr>
<tr>
<th align="right" colspan="6">SUB TOTAL $:-</th>
<th style="border-top: 1px solid black;border-bottom: 1px solid black;" align="center">'.number_format($data['total'],2).'</th>
</tr>
<tr>
<th align="right" colspan="6">ADD '.number_format($data['transaction_tax_percentage']).'% $:-</th>
<th style="border-top: 1px solid black;border-bottom: 1px solid black;" align="center">'.number_format($data['transaction_tax_amount'],2).'</th>
</tr>
<tr>
<th align="right" colspan="6">TOTAL $:-</th>
<th style="border-top: 1px solid black;border-bottom: 1px solid black;" align="center">'.number_format($data['grand_total'],2).'</th>
</tr>
</tfoot>';