Advertisement
Guest User

print.php

a guest
Nov 14th, 2013
873
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 12.96 KB | None | 0 0
  1.  
  2. <html>
  3.  
  4. <head>
  5.     <style>
  6.         /* General */
  7.        
  8.         table {
  9.             border-collapse:collapse;
  10.         }
  11.        
  12.         .center {
  13.             text-align:center;
  14.         }
  15.        
  16.         .right {
  17.             text-align : right;
  18.         }
  19.        
  20.         .left {
  21.             text-align : left;
  22.         }
  23.        
  24.         tr {
  25.             margin : 5px 0 ;
  26.             line-height : 18px;
  27.         }
  28.        
  29.         th {
  30.             text-align : center;
  31.             padding : 10px 0;
  32.         }
  33.  
  34.         td {
  35.             padding: 5px 0;
  36.             word-wrap: break-word;
  37.         }
  38.  
  39.         tr td.label {
  40.             width : 100px;
  41.         }
  42.        
  43.         .item-header {
  44.             margin : 15px 0;
  45.         }
  46.        
  47.         table.item-detail,
  48.         table.item-detail   th,
  49.         table.item-detail td {
  50.             border : 1px solid #000;
  51.         }
  52.        
  53.         /* Header */
  54.        
  55.         #header {
  56.             width : 755px;
  57.             padding-bottom : 5px;
  58.             border-bottom:3px solid #000;
  59.         }
  60.         #logo {
  61.             float:left;
  62.             display:inline;
  63.             width : 100px;
  64.         }
  65.         #kop-surat {
  66.             margin-top : -120px;
  67.             width : 600px;
  68.             display:inline-block;
  69.             text-align : center;
  70.         }
  71.         #separator {
  72.             padding : 2px 0;
  73.             border-bottom:1px solid #000;
  74.         }
  75.        
  76.         /* Content */
  77.        
  78.         #content {
  79.             width : 755px;
  80.         }
  81.        
  82.         #report-title {
  83.             font-size : 16px;
  84.             text-align : center;
  85.             margin-bottom:10px;
  86.         }
  87.        
  88.         table.item-summary {
  89.             margin : 15px 0;
  90.         }
  91.        
  92.         .currency {
  93.            
  94.         }
  95.        
  96.         .space {
  97.             width:20px;
  98.         }
  99.        
  100.     </style>
  101. </head>
  102.  
  103. <body>
  104.     <div id="container">
  105.         <div id="header">
  106.             <div id="logo">
  107.                 <?php echo CHtml::image(realpath(Yii::app()->basePath.'/../images/logo.jpg'),'LPS',array('style'=>'width:100px;')); ?>
  108.             </div>
  109.             <div id="kop-surat">
  110.                 <h2>PT. LANGGENG PRANAMAS SENTOSA</h2>
  111.                 GENERAL - SUPPLIER - EXPEDISI <br />
  112.                 Jl. Serdang Baru Raya No 12 RT 004, RW 05, Kel. Serdang, Kec. Kemayoran, Jakarta Pusat <br />
  113.                 Telp : 4248755,4221111,4265555 <br />
  114.                 Fax : 4242477 <br />
  115.                 Email : pitojo@cbn.net.id <br />
  116.             </div>
  117.         </div>
  118.         <div id="separator"></div>
  119.         <div id="content">
  120.            
  121.             <div id="report-title">KWITANSI</div>
  122.            
  123.             <table>
  124.                 <tr>
  125.                     <td class="label">No Kwitansi</td>
  126.                     <td class="desc" style="width:455px;"><?php echo $model->receipt_print_no; ?></td>
  127.                     <td class="label">Tgl Kwitansi</td>
  128.                     <td class="desc" class="right"><?php echo CDate::getDateFormat($model->receipt_transaction_date,'/'); ?></td>
  129.                 </tr>
  130.             </table>
  131.             <table>
  132.                 <tr>
  133.                     <td class="label">Kepada</td>
  134.                     <td class="desc">
  135.                         <?php echo $customer->customer_company_name; ?> <br />
  136.                         <?php echo $customer->addressStr; ?> <br />
  137.                          Telepon : <?php echo $customer->phoneStr; ?> <br />
  138.                     </td>
  139.                 </tr>
  140.             </table>
  141.            
  142.             <br />
  143.             <!-- Max BAPB page 1 , berikut header + footer = 33, items : 28. Other page : 45 with H  + F -->
  144.            
  145.             <?php
  146.                     $bapb = 0;
  147.                     $page = 1;
  148.                     $deliveryConfirmations = $model->deliveryConfirmations;
  149.                     $totalBapbRecords = count($deliveryConfirmations);
  150.                     $totalBapbPrinted = 0;
  151.             ?>
  152.            
  153.             <?php for($i = 1; $i <= 2; $i++): ?>
  154.             <?php foreach($deliveryConfirmations as $dc): ?>
  155.                 <?php $bapb++; ?>
  156.                
  157.                 <table class="item-header">
  158.                     <tr>   
  159.                         <td class="label"><strong>No BAPB</strong></td>
  160.                         <td class="desc" style="width:180px;"><?php echo $dc->dc_print_no; ?></td>
  161.                         <td class="label"><strong>Tgl BAPB</strong></td>
  162.                         <td class="desc" style="width:100px;"><?php echo CDate::getDateFormat($dc->dc_transaction_date,'/'); ?></td>
  163.                         <td class="label"><strong>Tujuan</strong></td>
  164.                         <td class="desc" style="width:130px;"><?php echo $area->area_name; ?></td>
  165.                     </tr>
  166.                     <tr>   
  167.                         <td class="label"><strong>Nama Kapal</strong></td>
  168.                         <td class="desc" style="width:180px;"><?php echo $dc->ship->ship_name; ?></td>
  169.                         <td class="label"><strong>Tgl Berangkat</strong></td>
  170.                         <td class="desc" style="width:100px;"><?php echo $dc->ship_depart_on; ?></td>
  171.                     </tr>
  172.                 </table>
  173.                
  174.                 <?php
  175.                     $totalDeliveryConfirmations = 0;
  176.                     $deliveryItems[$dc->primaryKey]['itemName'] = '';
  177.                     $deliveryItems[$dc->primaryKey]['itemQty'] = '';
  178.                     $deliveryItems[$dc->primaryKey]['itemUm'] = '';
  179.                     $deliveryItems[$dc->primaryKey]['itemTotal'] = '';
  180.                     $deliveryItems[$dc->primaryKey]['itemTotalPrice'] = '';
  181.                     foreach($dc->items as $item) {
  182.                         $deliveryItems[$dc->primaryKey]['itemName'] .= ($item->delivery_item_name.', ');
  183.                         $deliveryItems[$dc->primaryKey]['itemQty'] += $item->delivery_item_quantity;
  184.                         $deliveryItems[$dc->primaryKey]['itemUm'] = $item->um->unit_measurement_name;
  185.                         $deliveryItems[$dc->primaryKey]['itemTotal'] += $item->delivery_item_total;
  186.                     }
  187.                     $deliveryItems[$dc->primaryKey]['itemTotalPrice'] = $dc->dc_unit_price * $deliveryItems[$dc->primaryKey]['itemTotal'];
  188.                     $totalDeliveryConfirmations += $deliveryItems[$dc->primaryKey]['itemTotalPrice'];
  189.                 ?>
  190.                 <table class="item-detail">
  191.                     <tr>
  192.                         <th style="width : 250px;">Nama Barang</th>
  193.                         <th style="width : 50px;">Jumlah</th>
  194.                         <th style="width : 80px;">Satuan</th>
  195.                         <th style="width : 80px;">Total</th>
  196.                         <th style="width : 120px;">Harga (Rp)</th>
  197.                         <th style="width : 140px;">Total Harga (Rp)</th>
  198.                     </tr>
  199.                     <tr style="font-size : 11px;">
  200.                         <td><span class="space"></span><?php echo $deliveryItems[$dc->primaryKey]['itemName']; ?></td>
  201.                         <td class="center"><?php echo $deliveryItems[$dc->primaryKey]['itemQty']; ?></td>
  202.                         <td class="center"><?php echo $deliveryItems[$dc->primaryKey]['itemUm']; ?></td>
  203.                         <td class="center"><?php echo $deliveryItems[$dc->primaryKey]['itemTotal']; ?></td>
  204.                         <td class="right"><?php echo CNumber::priceFormat($dc->dc_unit_price); ?> <span class="space"></span></td>
  205.                         <td class="right"><?php echo CNumber::priceFormat($deliveryItems[$dc->primaryKey]['itemTotalPrice']); ?> <span class="space"></span></td>
  206.                     </tr>
  207.                     <tr style="font-size : 11px;">
  208.                         <td colspan="5" class="center">Subtotal (Rp)</td>
  209.                         <td class="right"><?php echo CNumber::priceFormat($deliveryItems[$dc->primaryKey]['itemTotalPrice']); ?> <span class="space"></span></td>
  210.                     </tr>
  211.                 </table>
  212.                 <table><tr><td style="color:#FFF;">-</td></tr></table>
  213.            
  214.             <?php $totalBapbPrinted++; ?>
  215.            
  216.             <?php
  217.                 if($totalBapbPrinted == $totalBapbRecords) { // Achieved total, now calculate summary
  218.                     if($page == 1) {
  219.                         $max = 2;
  220.                         $div =  '<table>
  221.                                         <tr><td style="color:#FFF;">-</td></tr><tr><td style="color:#FFF;">-</td></tr><tr><td style="color:#FFF;">-</td></tr>
  222.                                         <tr><td style="color:#FFF;">-</td></tr><tr><td style="color:#FFF;">-</td></tr><tr><td style="color:#FFF;">-</td></tr>
  223.                                     </table>';
  224.                     } else {
  225.                         $max = 4;
  226.                         $div =  '<table>
  227.                                         <tr><td style="color:#FFF;">-</td></tr><tr><td style="color:#FFF;">-</td></tr>
  228.                                         <tr><td style="color:#FFF;">-</td></tr><tr><td style="color:#FFF;">-</td></tr>
  229.                                     </table>';
  230.                     }
  231.                    
  232.                     if($bapb == $max) {
  233.                         $page++; // Go to next page        
  234.                         // echo $div; // Add new empty lines
  235.                         $bapb = 0; 
  236.                     }
  237.                 } else {
  238.                     if($page == 1) {
  239.                         $max = 4;
  240.                         $div =  '<table>
  241.                                         <tr><td style="color:#FFF;">-</td></tr><tr><td style="color:#FFF;">-</td></tr>
  242.                                         <tr><td style="color:#FFF;">-</td></tr><tr><td style="color:#FFF;">-</td></tr>
  243.                                     </table>';
  244.                     } else {
  245.                         $max = 6;
  246.                         $div =  '<table>
  247.                                         <tr><td style="color:#FFF;">-</td></tr><tr><td style="color:#FFF;">-</td></tr>
  248.                                     </table>';
  249.                     }
  250.                    
  251.                     if($bapb == $max) {
  252.                         $page++; // Go to next page        
  253.                         // echo $div; // Add new empty lines
  254.                         $bapb = 0;     
  255.                     }
  256.                 }
  257.             ?>
  258.            
  259.             <?php endforeach; ?>
  260.             <?php endfor; ?>
  261.            
  262.             <table class="item-summary" style="font-size : 11px;">
  263.                 <tr>
  264.                     <td style="width:470px;border-right:1px solid #000;"></td>
  265.                     <td class="center" style="width:120px;border:1px solid #000;font-weight:bold;">Total (Rp)</td>
  266.                     <td class="right" style="width:120px;border:1px solid #000;font-weight:bold;">
  267.                         <?php echo CNumber::priceFormat($totalDeliveryConfirmations); ?> <span class="space"></span>
  268.                     </td>
  269.                 </tr>
  270.                 <tr>
  271.                     <td style="width:470px;border-right:1px solid #000;"></td>
  272.                     <td class="center" style="width:120px;border:1px solid #000;">Asuransi (Rp)</td>
  273.                     <td class="right" style="width:120px;border:1px solid #000;">
  274.                         <?php echo CNumber::priceFormat($model->receipt_insurance_cost); ?> <span class="space"></span>
  275.                     </td>
  276.                 </tr>
  277.                 <tr>
  278.                     <td style="width:470px;border-right:1px solid #000;"></td>
  279.                     <td class="center" style="width:120px;border:1px solid #000;">Materai (Rp)</td>
  280.                     <td class="right" style="width:120px;border:1px solid #000;">
  281.                         <?php echo CNumber::priceFormat($model->receipt_stamp_cost); ?><span class="space"></span>
  282.                     </td>
  283.                 </tr>
  284.                 <tr>
  285.                     <td style="width:470px;border-right:1px solid #000;"></td>
  286.                     <td class="center" style="width:120px;border:1px solid #000;">Lainnya (Rp)</td>
  287.                     <td class="right" style="width:140px;border:1px solid #000;">
  288.                         <?php echo CNumber::priceFormat($model->receipt_other_costs); ?> <span class="space"></span>
  289.                     </td>
  290.                 </tr>
  291.                 <tr>
  292.                     <td style="width:470px;border-right:1px solid #000;"></td>
  293.                     <td class="center" style="width:120px;border:1px solid #000;">Diskon (Rp)</td>
  294.                     <td class="right" style="width:140px;border:1px solid #000;">
  295.                         <?php echo CNumber::priceFormat($model->receipt_discount); ?> <span class="space"></span>
  296.                     </td>
  297.                 </tr>
  298.                 <tr>
  299.                     <td style="width:470px;border-right:1px solid #000;"></td>
  300.                     <td class="center" style="width:120px;border:1px solid #000;font-weight:bold;">Grand Total (Rp)</td>
  301.                     <td class="right" style="width:140px;border:1px solid #000;font-weight:bold;">
  302.                         <?php echo CNumber::priceFormat($model->receipt_grand_total - $model->receipt_vat_amount); ?> <span class="space"></span>
  303.                     </td>
  304.                 </tr>
  305.                 <tr>
  306.                     <td style="width:470px;border-right:1px solid #000;"></td>
  307.                     <td class="center" style="width:120px;border:1px solid #000;">PPN (Rp)</td>
  308.                     <td class="right" style="width:140px;border:1px solid #000;">
  309.                         <?php echo CNumber::priceFormat($model->receipt_vat_amount); ?> <span class="space"></span>
  310.                     </td>
  311.                 </tr>
  312.                 <tr>
  313.                     <td style="width:470px;border-right:1px solid #000;"></td>
  314.                     <td class="center" style="width:120px;border:1px solid #000;font-weight:bold;">Grand Total (Rp)</td>
  315.                     <td class="right" style="width:140px;border:1px solid #000;font-weight:bold;">
  316.                         <?php echo CNumber::priceFormat($model->receipt_grand_total); ?> <span class="space"></span>
  317.                     </td>
  318.                 </tr>
  319.             </table>
  320.            
  321.             <br />
  322.            
  323.             <table id="terbilang">
  324.                 <tr>
  325.                     <td class="label">Terbilang </td>
  326.                     <td>
  327.                         <?php echo strtoupper(CNumber::terbilang($model->receipt_grand_total).' rupiah'); ?>
  328.                     </td>
  329.                 </tr>
  330.                 <tr style="width:625px;page-break-before: always;" >
  331.                     <td class="label">Keterangan </td>
  332.                     <td style="width:625px;" align="justify">
  333.                         <?php echo $model->receipt_desc ?>
  334.                         Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
  335.                         Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
  336.                         It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
  337.                     </td>
  338.                 </tr>
  339.             </table>
  340.            
  341.             <!--
  342.             <table id="signature">
  343.                 <tr>
  344.                     <td style="width:630px;"></td>
  345.                     <td class="label">Hormat Kami </td>
  346.                 </tr>
  347.                 <tr>
  348.                     <td style="width:630px;"></td>
  349.                     <td class="label" style="color:#FFF;">-</td>
  350.                 </tr>
  351.                 <tr>
  352.                     <td style="width:630px;"></td>
  353.                     <td class="label" style="color:#FFF;">-</td>
  354.                 </tr>
  355.                 <tr>
  356.                     <td style="width:630px;"></td>
  357.                     <td class="label">Mochtar Pitojo</td>
  358.                 </tr>
  359.             </table>
  360.            
  361.            
  362.             <div id="signature">
  363.                 <div style="margin-left:590px;margin-bottom:75px;">Hormat Kami</div>
  364.                 <div style="margin-left:590px">Mochtar Pitojo</div>
  365.             </div> -->
  366.            
  367.         </div>
  368.     </div>
  369. </body>
  370.  
  371. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement