EVOLUTION-NINJA
Edit File: view_civil_work_order.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" style=" text-align: right;"> <button class="btn btn-success btn-lg" type="button" id="booking_print" style=" padding-top: 2px; padding-bottom: 3px; padding-left: 15px; padding-right: 15px; background: rgb(72,91,127); color: white; border: initial !important; font-size: 22px;">Print </button> <span class="close-right" ><a href="<?php echo site_url('civil-work-order-list');?>" style="font-size: 22px;border: 1px solid;padding-left: 15px;padding-right: 15px;background: rgb(72,91,127);color: white;padding-bottom: 7px;text-decoration:none;">Back</a></span> </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> <?php if($wo_bill_details){?> <tr> <td colspan="12" style="text-align:center;font-weight:900;font-size:20px;font-style:Akashi;"><?php echo strtoupper($wo_bill_details->name); ?></td> </tr> <tr> <td colspan="12" style="text-align:center;">Regd.Off:<?php echo strtoupper($wo_bill_details->address); ?></td> </tr> <tr> <td colspan="12" style="text-align:center;font-weight:600;text-decoration: underline;">WORK ORDER</td> </tr> <tr> <td colspan="12" style="text-align:center;font-weight:600;">GSTIN No.:<?php echo $wo_bill_details->gstno; ?> </td> </tr> <?php } ?> <tr> <td colspan="10"></td> <td colspan="2" style="text-align:right;"> </td> </tr> <tr> <td colspan="10"><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:-50px !important;margin: 0 0 0;"><?php if($fetch_address->cancel_status=="CANCELLED"){echo "Cancelled "; }?>WO# : <?php if($wo_bill_details) { if($wo_bill_details->mid == 2){?> GSS\ <?php }else{?> <?php }} ?>CIVIL\<?php echo $civil_project->nick_name; ?>\<?php echo '0000';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="11"> <p style="padding-left:5%;padding-top: 1%;">We request you to execute the following work as per the terms mentioned here below. kindly mention our WO 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 style="width:20%;">PARTICULARS</th> <th>INDENTS</th> <th>NUMBER</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_address){?> <tr > <td><?php echo $c; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_address->product_name; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_address->indent; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_address->purpose_no; ?></td> <td><?php echo round($fetch_address->inr_value); ?></td> <td><?php echo $fetch_address->cgst; ?></td> <td><?php echo round($fetch_address->cgst*$fetch_address->inr_value)/100; ?></td> <td><?php echo $fetch_address->sgst; ?></td> <td><?php echo round($fetch_address->sgst*$fetch_address->inr_value)/100; ?></td> <td><?php echo $fetch_address->igst; ?></td> <td><?php echo round($fetch_address->igst*$fetch_address->inr_value)/100; ?></td> <td><?php echo round($fetch_address->total_value); ?></td> <!--<td><?php echo round($fetch_address->total_value); ?></td> --></tr> <?php $a=$a+$fetch_address->inr_value; $c++; } if($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><?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="8" style="border-bottom:1px solid transparent !important;"><textarea rows="1" id="note" name="note" style="width: 100%; border: transparent; " placeholder="NOTE : " readonly><?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 round($fetch_address->total_amt); ?></td> </tr> <tr> <td colspan="8" 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 round(($fetch_address->total_amt * $fetch_address->discount)/100);?></td> </tr> <tr> <td colspan="8" style="border-bottom:1px solid transparent !important;"> </td> <td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">TDS@<?php if(!empty($fetch_address)){echo $fetch_address->tds; }?>%</td> <td colspan="2" style="border-bottom:1px solid transparent !important;border-left:1px solid transparent !important;text-align:right;"><?php $t_tds = round((($a+$b) - ((($a+$b) * $fetch_address->discount)/100)) * $fetch_address->tds)/100; echo ($t_tds);?></td> </tr> <tr> <td colspan="8" 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 $tot=(round($fetch_address->total_amt) - (round($fetch_address->total_amt * $fetch_address->discount)/100) - (round((($a+$b) - ((($a+$b) * $fetch_address->discount)/100)) * $fetch_address->tds)/100)) ; echo round($tot);?></td> </tr> <tr> <td colspan="8" 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(round($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(round($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(round($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(round($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(round($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>  3. TDS @ : <input type="text" class="tds" id="tds" name="tds" style="width: 5%;"value="<?php if(!empty($fetch_address)){echo $fetch_address->tds; }?>" readonly> % On Total Value.<br/> </tr> <tr> <td >  4. Bank Details : <?php echo $fetch_address->bank_details; ?></td> </tr> </table> <table style="width:900px;margin-top:20px;"> <?php if($wo_bill_details) { if($wo_bill_details->mid == 2){?> <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> <?php }else{ ?> <tr> <td>Prepared By</td> <td style="text-align:right;">Approved By</td> </tr> <!-- <tr> <td style="padding-top:7%;">Authorized Signature</td> <td style="text-align:right;padding-top:7%;">DIRECTOR</td> </tr>--> <?php }} ?> </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> <!--<script> var divContents = $(".print").html(); newWin= window.open(""); newWin.document.write(divContents); newWin.print(); newWin.close(); </script>-->