EVOLUTION-NINJA
Edit File: view_purchase_order_po.php
<?php echo view('includes/header');?> <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>public/assets/css/avinash.css" > <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>public/assets/css/skin-blue.css" > <link rel='shortcut icon' type='image/x-icon' href="<?php echo base_url(); ?>public/assets/images/samll-big.png"/> <div class="page-content-wrapper"> <div class="page-content"> <div class="row"> <br> <div class="col-sm-10"></div> <div class="col-sm-1"><button class="btn btn-primary btn-lg pull-right" type="button" id="booking_print">Print </button></div> <div class="col-sm-1"><a href="<?php echo site_url('purchase_po_genereted_list_form');?>" class="pull-right btn btn-primary btn-lg">Back</a></div> </div> <div class="print" id="print_report" style="padding:10px;"> <table style="width:900px;border-spacing:0;"> <tr> <td colspan="10"></td> <td colspan="2" style="text-align:right;">E-mail: <?php if(!empty($fetch_address->email)) { echo $fetch_address->email; }?></td> </tr> <tr> <td colspan="10"></td> <td colspan="2" style="text-align:right;">Contact Person: <?php echo $fetch_address->contact_person;?></td> </tr> <tr> <td colspan="10"></td> <td colspan="2" style="text-align:right;">Contact No.: <?php echo $fetch_address->contact_number; ?></td> </tr> <tr> <td colspan="12" style="text-align:center;font-weight:900;font-size:20px;font-style:Akashi;">GSS PROJECT CONSULTANTS PRIVATE LIMITED</td> </tr> <tr> <td colspan="12" style="text-align:center;">Regd.Off:407.8th B MAIN,JAYANAGAR 4th BLOCK,BANGLORE-560011.INDIA</td> </tr> <tr> <td colspan="12" style="text-align:center;font-weight:600;text-decoration: underline;">PURCHASE ORDER</td> </tr> <tr> <td colspan="12" style="text-align:center;font-weight:600;text-decoration: underline;">GST NO. : 29AAACG3912GIZT</td> </tr> <tr> <td colspan="10"></td> <td colspan="2" style="text-align:right;"> </td> </tr> <tr> <td colspan="10"></td> <td colspan="2" style="text-align:right;"> </td> </tr> <tr> <td colspan="2"><input type="text" value=" <?php echo $fetch_address->vendor; ?>" style="width: 50 %; border: transparent;" readonly></td> </tr> <tr> <td colspan="6" ><textarea rows="6" cols="50" style="border: transparent;" readonly> <?php echo $fetch_address->vendor_address; ?></textarea></td> <td colspan="6" style="text-align:right;"><p style="margin-top:-45px !important;margin: 0 0 0;"><?php if($fetch_address->cancel_status=="CANCELLED"){echo "Cancelled "; }?>PO# : <?php echo $fetch_address->po_no; ?></p> <p style="margin: 0 0 0;">Date : <?php echo $fetch_address->date; ?></p><p style="margin: 0 0 0;">Currency : <?php echo $fetch_address->currency; ?></p></td> </tr> <tr> <td colspan="2" style="padding-top: 1%;">Sir / Madam,</td> <!--<td colspan="2" style="padding-top: 1%;">INDENT NO.114 DT. 23.05.17</td>--> <td colspan="8"></td> </tr> <tr> <td colspan="12"> <p style="padding-left:5%;padding-top: 1%;">We request you to supply the following materials as per the terms mentioned here below. kindly mention our PO No in your invoice.</p> </td> </tr> </table> <table border="1" style="width:900px;border-spacing:0;margin-top: 1%;" cellpadding="5px"> <thead> <tr> <th>SL No.</th> <th>PARTICULARS</th> <th>DESCRIPTION</th> <th>PROJECT</th> <th>INDENTS</th> <th>QTY</th> <?php if($fetch_address->currency == 'INR') { ?> <th>RATE IN INR</th> <?php } else if($fetch_address->currency == 'CHF') { ?> <th>RATE IN CHF</th> <?php } else if($fetch_address->currency == 'EUR') { ?> <th>RATE IN EUR</th> <?php } else if($fetch_address->currency == 'GBP') { ?> <th>RATE IN GBP</th> <?php } else if($fetch_address->currency == 'USD') { ?> <th>RATE IN USD</th> <?php } ?> <th>CGST</th> <th>CGST Value </th> <th>SGST</th> <th>SGST Value </th> <th>IGST</th> <th>IGST Value </th> <th>Total Value</th> <th>TOT VALUE IN INR</th> <!--<th></th> <th></th>--> </tr> </thead> <tbody> <?php $a=0;$b=0;$c=1; foreach($fetch_details as $fetch_add){?> <tr > <td><?php echo $c; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_add->product_name; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_add->description; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_add->project_name; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_add->indent; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_add->quentity; ?></td> <td><?php echo round($fetch_add->inr_value); ?></td> <td><?php echo $fetch_add->cgst; ?></td> <td><?php echo round($fetch_add->cgst*$fetch_add->inr_value)/100; ?></td> <td><?php echo $fetch_add->sgst; ?></td> <td><?php echo round($fetch_add->sgst*$fetch_add->inr_value)/100; ?></td> <td><?php echo $fetch_address->igst; ?></td> <td><?php echo round($fetch_add->igst*$fetch_add->inr_value)/100; ?></td> <td><?php echo round($fetch_add->total_value); ?></td> <td><?php echo round($fetch_add->total_value); ?></td> </tr> <?php $a=$a+$fetch_add->inr_value; $c++; } if(!empty($fetch_address->ot_total_value)){?> <tr> <td></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_address->ot_charges; ?></td> <td></td> <td></td> <td></td> <td><?php echo $fetch_address->ot_quantity; ?></td> <td><?php echo round($fetch_address->ot_inr_value); ?></td> <td><?php echo $fetch_address->ot_cgst; ?></td> <td><?php echo round($fetch_address->ot_cgst*$fetch_address->ot_inr_value)/100; ?></td> <td><?php echo $fetch_address->ot_sgst; ?></td> <td><?php echo round($fetch_address->ot_sgst*$fetch_address->ot_inr_value)/100; ?></td> <td><?php echo $fetch_address->ot_igst; ?></td> <td><?php echo round($fetch_address->ot_igst*$fetch_address->ot_inr_value)/100; ?></td> <td><?php echo round($fetch_address->ot_total_value); ?></td> <td><?php echo round($fetch_address->ot_total_value); ?></td> </tr> <?php $b=$fetch_address->ot_inr_value;}?> <tr> <td colspan="10" style="border-bottom:1px solid transparent !important;"> <textarea rows="1" id="note" name="note" style="width: 100%; border: transparent; " placeholder="NOTE : "><?php echo $fetch_address->note; ?></textarea> </td> <td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">Total in Rs</td> <td colspan="2" style="border-bottom:1px solid transparent !important;border-left:1px solid transparent !important;text-align:right;"><?php echo $fetch_address->total_amt; ?></td> </tr> <tr> <td colspan="10" style="border-bottom:1px solid transparent !important;"> </td> <td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">Discount@<?php if(!empty($fetch_address)){echo $fetch_address->discount; }?>%</td> <td colspan="2" style="border-bottom:1px solid transparent !important;border-left:1px solid transparent !important;text-align:right;"><?php echo (($fetch_address->total_amt * $fetch_address->discount)/100);?></td> </tr> <tr> <td colspan="10" style="border-bottom:1px solid transparent !important;"> </td> <td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in Rs</td> <td colspan="2" style="border-bottom:1px solid transparent !important;border-left:1px solid transparent !important;text-align:right;"><?php $gd_tot=($fetch_address->total_amt - (($fetch_address->total_amt * $fetch_address->discount)/100)) ; echo round($gd_tot);?></td> </tr> <tr> <td colspan="10" style="border-top:1px solid transparent !important;"></td> <?php if($fetch_address->currency == 'INR') { ?> <td colspan="5" style="border-top:1px solid transparent !important;"><b><?php echo "(Rupees ". convert_number_to_words($gd_tot) . "Only/-" .")"; ?></b></td> <?php } else if($fetch_address->currency == 'CHF') { ?> <td colspan="5" style="border-top:1px solid transparent !important;"><b><?php echo "(". convert_number_to_words($gd_tot) . "CHF/-" .")"; ?></b></td> <?php } else if($fetch_address->currency == 'EUR') { ?> <td colspan="5" style="border-top:1px solid transparent !important;"><b><?php echo "(". convert_number_to_words($gd_tot) . "€/-" .")"; ?></b></td> <?php } else if($fetch_address->currency == 'GBP') { ?> <td colspan="5" style="border-top:1px solid transparent !important;"><b><?php echo "(". convert_number_to_words($gd_tot) . "£/-" .")"; ?></b></td> <?php } else if($fetch_address->currency == 'USD') { ?> <td colspan="5" style="border-top:1px solid transparent !important;"><b><?php echo "(". convert_number_to_words($gd_tot) . "$/-" .")"; ?></b></td> <?php } ?> </tr> </tbody> </table> <table style="width:900px;margin-top:10px;"> <tr> <td>  1. Material Delivery : <span style="text-transform: uppercase !important;"><?php echo $fetch_address->material_delivery; ?></span></td> </tr> <tr> <td>  2. GST No. : <span style="text-transform: uppercase !important;"><?php echo $fetch_address->gst_no; ?></span> </td> </tr> <tr> <td>  3. Terms of payment : <span style="text-transform: uppercase !important;"> <?php echo $fetch_address->terms_of_payment; ?></span></td> </tr> <tr> <td >  4. Bank Details : <?php echo $fetch_address->bank_details; ?></td> </tr> </table> <table style="width:900px;margin-top:20px;"> <tr> <td>FOR GSS PROJECT CONSULTANTS (P) LIMITED</td> <td style="text-align:right;">FOR GSS PROJECT CONSULTANTS (P) LIMITED</td> </tr> <tr > <td style="padding-top:7%;">Authorized Signature</td> <td style="text-align:right;padding-top:7%;">DIRECTOR</td> </tr> <tr> <td colspan="2" style="text-align:center; padding-top:5%;">MKTG OFF:1104, FIRST FLOOR UDAYARAVI ROAD,KUVEMPUNAGAR,MYSORE-570023 </td> </tr> </table> </div> <?php echo view('includes/footer');?> <!--- content-wrapper ----> <!------------- content-wrapper END -----------------------------------------------------------------------------------------------------> <?php function convert_number_to_words($no) { //$no = round($number); //alert(); $hundred = null; $digits_1 = strlen($no); $i = 0; $str = array(); $words = array('0' => '', '1' => 'One', '2' => 'Two', '3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six', '7' => 'Seven', '8' => 'Eight', '9' => 'Nine', '10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve', '13' => 'Thirteen', '14' => 'Fourteen', '15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen', '18' => 'Eighteen', '19' =>'Nineteen', '20' => 'Twenty', '30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty', '60' => 'Sixty', '70' => 'Seventy', '80' => 'Eighty', '90' => 'Ninety'); $digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore'); while ($i < $digits_1) { $divider = ($i == 2) ? 10 : 100; $number = floor($no % $divider); $no = floor($no / $divider); $i += ($divider == 10) ? 1 : 2; if ($number) { $plural = (($counter = count($str)) && $number > 9) ? '' : null; $hundred = ($counter == 1 && $str[0]) ? ' And ' : null; $str [] = ($number < 21) ? $words[$number] . " " . $digits[$counter] . $plural . " " . $hundred : $words[floor($number / 10) * 10] . " " . $words[$number % 10] . " " . $digits[$counter] . $plural . " " . $hundred; } else $str[] = null; } $str = array_reverse($str); $result = implode('', $str); return $result ; } ?> </div> <!----- wrapper -----> </div> <script> $(document).ready(function(){ $("#booking_print").click(function(){ var divToPrint=document.getElementById("print_report"); newWin= window.open(""); newWin.document.write(divToPrint.outerHTML); newWin.print(); newWin.close(); }); }); </script> <style> .btn-primary { padding: 5px 20px !important; } </style>