EVOLUTION-NINJA
Edit File: preview_po.php
<?php $this->load->view('includes/header.php')?> <link rel="stylesheet" href="<?php echo base_url('assets/css/jquery-ui.css');?>" /> <link rel="stylesheet" type="text/css" href="<?php echo base_url('dashboard_assets/css/main.css'); ?>" /> <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> <script src="<?php echo base_url('assets/js/jquery-ui.js');?>"></script> <script type="text/javascript" src="<?php echo base_url('dashboard_assets/js/popper.min.js'); ?>" ></script> <div class="page-content-wrapper"> <div class="page-content"> <div class="row" style="float: right !important;"> <div class="" style=" margin-bottom: 40px;"> <button class="btn" type="button" id="booking_print" style="background: #405189; color: white;">Print </button> <a href="<?php echo site_url('po-list'); ?>"><button class="btn" type="button" style="background: #EEEEEE; color: black;">Back </button></a> </div> </div> <!--<div class="content-wrapper print" id="print_report" style="padding:30px; border: 1px solid #C1C1C1; margin-bottom: 20px; margin-top: 20px;position:relative;">--> <div class="content-wrapper print" id="print_report" style="padding:30px; border: 1px solid #C1C1C1; margin-bottom: 20px; margin-top: 20px; padding-top:0px !important;"> <!--<div class="logo-img" style="position: absolute;left:15px;top:15px;">--> <!-- <img class="img-fluid d-block mx-auto" style="width:150px;" src="<?php echo base_url('assets/images/logo_mmg_trends.jpg ');?>" alt="logo"/>--> <!--</div>--> <table width="100%" style="border-spacing:0;"> <tr> <td colspan="6">PO# : <?php echo $po->po_no; ?></td> <td colspan="6" style="text-align:right;"><img class="img-fluid" style="width:150px;float:right;" src="<?php echo base_url('assets/images/mmg_logo.png ');?>" alt="logo"/></td> </tr> <tr> <td colspan="6">Date : <?php echo $po->po_date; ?></td> <td colspan="6" style="text-align:right;"> <p style="margin:0;">MMG CONSTRUCTIONS LLP<br> #617, 1st Floor, New Kantharaja Urs Road,<br> Kuvempunagar,Chamaraja Mohalla, Mysore-23</p> <p style="margin:0;">GSTN:     PAN: </p> </tr> <tr> <td colspan="12"><p style="font-weight:600;text-align:center;text-decoration: underline;">PURCHASE ORDER</p></td> </tr> <tr> <td colspan="6">Currency : <?php echo $po->currency; ?></td> <td colspan="6" style="text-align:right;">E-mail : sales@mmg_constructions.com</td> </tr> <!-- <tr> <td colspan="6"><?php if(empty($vendor_data)) { } else { echo $vendor_data->vendor . "<br/>" .$vendor_data->address . "<br/>". $vendor_data->city . "<br/>". $vendor_data->country . "-". $vendor_data->pincode; } ?></td> <td colspan="6" style="text-align:right;">Phone : 9900486845</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 P.O No in your invoice.</p> </td> </tr> </table> <table border="1" width="100%" style="border-spacing:0;margin-top: 1%; border:1px solid #C1C1C1;" cellpadding="5px"> <thead> <tr> <th>SL No.</th> <th>PRODUCT NAME</th> <th>PRODUCT TYPE</th> <th>QTY</th> <?php if($po->currency == 'INR') { ?> <th>RATE IN INR</th> <th>VALUE IN INR</th> <?php } else if($po->currency == 'CHF') { ?> <th>RATE IN CHF</th> <th>VALUE IN CHF</th> <?php } else if($po->currency == 'EUR') { ?> <th>RATE IN EUR</th> <th>VALUE IN EUR</th> <?php } else if($po->currency == 'GBP') { ?> <th>RATE IN GBP</th> <th>VALUE IN GBP</th> <?php } else if($po->currency == 'USD') { ?> <th>RATE IN USD</th> <th>VALUE IN USD</th> <?php } ?> <th>CGST</th> <th>SGST</th> <th>IGST</th> <th>TAX Amount</th> <th>TOT VALUE IN INR</th> <!--<th></th> <th></th>--> </tr> </thead> <tbody> <?php $i=1; $ttl_amt=0; $ttl_amtt=0;$t_val8=0;?> <?php if(isset($po_data)) { foreach($po_data as $po_data){ ?> <?php $t=0;$t_val1=0; $t_val2=0; $t_val3=0;$t_val4=0;$t_val5=0;$t_val6=0;$totalvalue=0;$t_amt=0;$totalvalue1=0;$t_val7=0; $t_amtt=0; $t_val1 = $po_data->cgst; $t_val2 = $po_data->sgst; $t_val22 = $po_data->igst; $t_val3 = $po_data->inr_value; $t = $t_val1+$t_val2+$t_val22; $t_val4 = $t_val3 * $t/100; //$totalvalue = $t_val4 + $t_val5; $taxvalue = $t_val4; $t_val6 = $po_data->total_value; $t_amt = $taxvalue+$t_val6; $ttl_amt += $t_amt; $t_val7=$po_data->total_value; $t_amtt=$t_amt - $taxvalue ; $ttl_amtt+=$po_data->total_value; $t_val8+=$po_data->total_value; ?> <tr > <td><?php echo $i; ?></td> <td style="text-transform: uppercase !important;"><?php echo $po_data->product_name; ?></td> <td style="text-transform: uppercase !important;white-space: nowrap;"><?php echo $po_data->product_type; ?></td> <td><?php echo $po_data->quantity; ?></td> <td><?php echo $po_data->unit_price ; ?></td> <td><?php echo $po_data->inr_value; ?></td> <td><?php echo $po_data->cgst; ?></td> <td><?php echo $po_data->sgst; ?></td> <td><?php echo $po_data->igst; ?></td> <td><?php echo $t_val4; ?></td> <td><?php echo $po_data->total_value; ?></td> </tr> <?php $i++; } } ?> <tr> <th colspan="9" rowspan="5"> <textarea rows="3" id="note" name="note" style="width: 100%; border: transparent;text-transform: uppercase !important;" placeholder="NOTE : " ><?php echo $po->note; ?></textarea> </th> <td colspan="1">TOTAL AMOUNT</td> <td colspan="1" style="padding-bottom: 10px;"><input type="text" class="total_amt" id="total_amt" name="total_amt" value="<?php echo $po->total_amt; ?>" style="width: 100%;border: transparent;" readonly="readonly" required onfocusin="amount_total1()"></td> </tr> <!--<tr> <td colspan="3">DISCOUNT %<br/>DISCOUNT Rs</td> <td colspan="2" style="padding-bottom: 10px;"><input type="text" class="discount" id="discount" name="discount" value="<?php echo $po->discount; ?>" onkeyup="discountvalue(this.value)" style="width: 100%;border: transparent;"> <span>%</span> <tdcolspan="2" style="padding-bottom: 10px;"><input type="text" name="discount_amount" class="discount_amount" value="<?php echo $po->discount_amount; ?>" onkeyup="discountamount(this.value)" style="width: 100%;border: transparent;margin-top: 10px;"> <span>Rs</span> </td> </tr>--> <tr> <td colspan="1">TAX AMOUNT</td> <td colspan="1" style="padding-bottom: 10px;"><input type="text" name="tax_amount" id="tax_amount" class="tax_amount" value="<?php echo $po->tax_amount; ?>" style="width: 100%;border: transparent;" readonly="readonly" required> </td> </tr> <tr> <td colspan="1">TOTAL</td> <td colspan="1" style="padding-bottom: 10px;"><input type="text" name="tax_amount" id="total" class="total" value="<?php echo $po->total; ?>" style="width: 100%;border: transparent;" readonly="readonly" required> </td> </tr> <tr> <td colspan="1"><p><span onclick="plus_function();">Plus</span>/<span onclick="minus_function();">Minus</span></p></td> <td colspan="1" style="padding-bottom: 10px;"><input type="text" name="round_off" id="round_off" class="round_off" onkeyup="rounded_of(this.value)" value="<?php echo $po->round_off; ?>" style="width: 100%;border: transparent;" required> </td> </tr> <tr> <td colspan="1">GRAND TOTAL</td> <td colspan="1" style="padding-bottom: 10px;"><input type="text" class="g_total" id="g_total" name="g_total" value="<?php echo $po->g_total; ?>" style="width: 100%;border: transparent;" readonly="readonly" required></td> </tr> <!-- <tr> <td colspan="9" style="border-bottom:1px solid transparent !important;"> <textarea rows="1" id="note" name="note" style="width: 100%; border: transparent; " placeholder="NOTE : "><?php echo 'NOTE :'.$po->note; ?></textarea> </td> <!-- <?php if($po->currency == 'INR') { ?> <td colspan="4" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total after <?php echo $po->discount; ?>% Discount in ₹</td> <?php } else if($po->currency == 'CHF') { ?> <td colspan="4" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total after <?php echo $po->discount; ?>% Discount in CHF</td> <?php } else if($po->currency == 'EUR') { ?> <td colspan="4" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total after <?php echo $po->discount; ?>% Discount in €</td> <?php } else if($po->currency == 'GBP') { ?> <td colspan="4" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total after <?php echo $po->discount; ?>% Discount in £</td> <?php } else if($po->currency == 'USD') { ?> <td colspan="4" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total after <?php echo $po->discount; ?>% Discount in $</td> <?php } ?> <td colspan="1"><?php echo $po->tax_amount; ?></td> <td colspan="1"><?php echo $po->g_total; ?></td> </tr>--> <tr> <!--<td colspan="5" style="border-top:1px solid transparent !important;"></td>--> <?php if($po->currency == 'INR') { ?> <td colspan="11" style="border-top:1px solid #C1C1C1 !important;text-align:right;"><b><?php echo "(". convert_number_to_words(round($po->g_total)) . "₹/-" .")"; ?></b></td> <?php } else if($po->currency == 'CHF') { ?> <td colspan="5" style="border-top:1px solid transparent !important;"><b><?php echo "(". convert_number_to_words(round($po->g_total)) . "CHF/-" .")"; ?></b></td> <?php } else if($po->currency == 'EUR') { ?> <td colspan="5" style="border-top:1px solid transparent !important;"><b><?php echo "(". convert_number_to_words(round($po->g_total)) . "€/-" .")"; ?></b></td> <?php } else if($po->currency == 'GBP') { ?> <td colspan="5" style="border-top:1px solid transparent !important;"><b><?php echo "(". convert_number_to_words(round($po->g_total)) . "£/-" .")"; ?></b></td> <?php } else if($po->currency == 'USD') { ?> <td colspan="5" style="border-top:1px solid transparent !important;"><b><?php echo "(". convert_number_to_words(round($po->g_total)) . "$/-" .")"; ?></b></td> <?php } ?> </tr> </tbody> </table> <br> <p><b>Terms and Conditions:<br> <span class="bold" style="font-size:15px">Quantity : We accept </span>only +/- 10%.Any excess Qty will be returned back to the vendor.</b></p> <table width="100%" style="margin-top:10px;"> <tr> <td>  1. Material Delivery : <?php echo $po->comment; ?></td> </tr> <tr> <td>  2. GST No. : <?php echo $po->gst_no; ?></td> </tr> <tr> <td>  3. Terms of payment : <?php echo $po->terms_payment; ?></td> </tr> <tr> <td >  4. Bank Details : <?php echo $po->bank_details; ?></td> </tr> </table> <table style="width:100%;margin-top:20px;"> <tr> <td>FOR MMG Constructions</td> <td style="text-align:right;">FOR MMG Constructions</td> </tr> <tr > <td style="padding-top:7%;">EXECUTIVE - PURCHASE</td> <td style="text-align:right;padding-top:7%;">Authorized signature</td> </tr> <tr> <td colspan="2" style="text-align:center; padding-top:5%;">IT IS A COMPUTER GENERATED FORMAT. SIGNATURE IS NOT REQUIRED</td> </tr> </table> </div> <!--- content-wrapper ----> <?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) { $counter = count($str); $hundred = ($counter == 1 && $str[0]) ? 'And ' : null; $str [] = ($number < 21) ? $words[$number] . " " . $digits[$counter] . " " . $hundred : $words[floor($number / 10) * 10] . " " . $words[$number % 10] . " " . $digits[$counter] . " " . $hundred; } /*if ($number) { $plural = (($counter = count($str)) && $number > 9) ? 's' : 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> table tr th, table tr td, table tr td p { font-size: 7px; } .logo-img { position: absolute; left:15px; top:15px; } .logo-img img { width:150px; } /*#print_report table{*/ /* border:1px solid #C1C1C1;*/ /*}*/ @media (min-width: 1200px){ .content-wrapper { max-width: 900px !important; } } </style> <?php $this->load->view('includes/footer.php')?>