EVOLUTION-NINJA
Edit File: export_report.php
<html> <head> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css"> </head> <?php function IND_money_format($number){ $decimal = (string)($number - floor($number)); $money = floor($number); $length = strlen($money); $delimiter = ''; $money = strrev($money); for($i=0;$i<$length;$i++){ if(( $i==3 || ($i>3 && ($i-1)%2==0) )&& $i!=$length){ $delimiter .=','; } $delimiter .=$money[$i]; } $result = strrev($delimiter); $decimal = preg_replace("/0\./i", ".", $decimal); $decimal = substr($decimal, 0, 3); if( $decimal != '0'){ $result = $result.$decimal; } return '₹ '.$result; } ?> <body> <table align="center" style="border: 1px solid black;"> <tr> <td> <a href = "<?php echo base_url();?>g_reports/summery_report_order_date" >Orders Received</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/summery_report_marketing" >Delivery Tracker</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/summery_report" >Sales Summary</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/export_report" >Sales - Export</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/fabric_reports" >Fabrics - Export</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/madeups_reports" >Madeups - Export</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/rex_report" >REX Details</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/duty_drawback_report" >Duty Drawback / Export Incentive Details</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/gst_report" >IGST List</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/gst_summery_reports" >IGST Summary</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/hscode_summery_reports" >HS Code Summary</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/po_reports" >PO Summary</a> </td> </tr> </table> <p style="background:#485b7f;"> <img src="<?php echo base_url();?>assets/img/2ND%20TT.svg" alt="logo" width="180" style="margin-top:3px;"/> </p> <table align="center" style="border: 1px solid black;"> <tr> <td> <a href = "<?php echo base_url();?>g_reports/export_report/all" >ALL</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/export_report/04" >April</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/export_report/05" >May</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/export_report/06" >June</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/export_report/07" >July</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/export_report/08" >Aug</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/export_report/09" >Sept</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/export_report/10" >Oct</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/export_report/11" >Nov</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/export_report/12" >Dec</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/export_report/01" >Jan</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/export_report/02" >Feb</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/export_report/03" >March</a> </td> </tr> </table> <div id="reports-pdf"> <!--<table align="center" style="border: 1px solid black;">--> <!-- <tr>--> <!-- <td colSpan = 12>--> <!-- <div id="summery_chart" style="width: 700px; height: 300px; background-color:powderblue;"></div>--> <!-- </td>--> <!-- </tr>--> <!--</table>--> <h2>Export Details</h2> <p> <h4><?php echo 'Financial Year : '.$year;?></h4> </p> <table align="center" style="border: 1px solid black;"> <tr> <th>Serial Number</th> <th>Invoice Number</th> <th>Invoice Date</th> <th>E Way Date </th> <th>Buyer</th> <th>Port</th> <th>Country</th> <th>Rex</th> <th>INCO</th> <th>Total Invoice Value</th> <th>Discount</th> <th>Freight/Insurance</th> <th>Ex Rate</th> <th>FOB INR Value</th> <!--<th>Product</th>--> <!--<th>HS Code</th>--> <th>Quantity</th> <th>Unit</th> <th>Cross Currency Rate for REX</th> <th>Shipping Bill Number</th> <th>Shipping Bill Date</th> <th>Port Code</th> <th>Drawback Amount</th> <th>Drawback Credit Date</th> <th>Export Incentive</th> <th>Export Incentive Date</th> </tr> <?php $i = 0; foreach($fabric as $row){ $i++; ?> <tr> <td><p><?php echo $i; ?></p></td> <td><p><?php echo $row->invoice_num; ?></p></td> <td><p><?php echo $row->invoice_date; ?></p></td> <td><p><?php echo $row->e_way_date; ?></p></td> <td><p><?php echo $row->customer_name; ?></p></td> <td><p><?php echo $row->port_discharge; ?></p></td> <td><p><?php echo $row->country; ?></p></td> <?php if($row->rex == 1){ ?> <td><p><?php echo 'Rex'; ?></p></td> <?php } else{ ?> <td><p></p></td> <?php } ?> <td><p><?php echo $row->contarct_type; ?></p></td> <td><p><?php echo number_format((float)$row->total_value, 2, '.', ''); ?></p></td> <td><p><?php echo $row->discount; ?></p></td> <td><p><?php echo $row->other_charges; ?></p></td> <td><p><?php echo IND_money_format(number_format((float)($row->shipping_customs_ex_rate), 2, '.', ''));?></p></td> <td><p><?php echo IND_money_format(number_format((float)($row->shipping_customs_inr_val), 2, '.', ''));?></p></td> <td><p><?php echo $row->sum_wt; ?></p></td> <td><p><?php echo $row->units; ?></p></td> <td><p><?php echo $row->cross_currecy; ?></p></td> <td><p><?php echo $row->shipping_bill_num; ?></p></td> <td><p><?php echo $row->shipping_bill_date; ?></p></td> <td><p><?php echo $row->shipping_port_code; ?></p></td> <td><p><?php echo IND_money_format(number_format((float)($row->drawack_amount), 2, '.', ''));?></p></td> <td><p><?php echo $row->drawback_credit_date; ?></p></td> <td><p><?php echo IND_money_format(number_format((float)($row->export_incentive), 2, '.', ''));?></p></td> <td><p><?php echo $row->incentive_credit_date; ?></p></td> </tr> <?php } foreach($madeups as $row){ $i++; ?> <tr> <td><p><?php echo $i; ?></p></td> <td><p><?php echo $row->invoice; ?></p></td> <td><p><?php echo $row->invoice_date; ?></p></td> <td><p><?php echo $row->e_way_date; ?></p></td> <td><p><?php echo $row->customer_name; ?></p></td> <td><p><?php echo $row->port_discharge; ?></p></td> <td><p><?php echo $row->country; ?></p></td> <?php if($row->rex == 1){ ?> <td><p><?php echo 'Rex'; ?></p></td> <?php } else{ ?> <td><p></p></td> <?php } ?> <td><p><?php echo $row->contarct_type; ?></p></td> <td><p><?php echo $row->total_value; ?></p></td> <td><p><?php echo $row->discount; ?></p></td> <td><p><?php echo $row->other_charges; ?></p></td> <td><p><?php echo IND_money_format(number_format((float)($row->shipping_customs_ex_rate), 2, '.', ''));?></p></td> <td><p><?php echo IND_money_format(number_format((float)($row->shipping_customs_inr_val), 2, '.', ''));?></p></td> <td><p><?php echo $row->sum_qty; ?></p></td> <td><p><?php echo $row->units; ?></p></td> <td><p><?php echo $row->cross_currecy; ?></p></td> <td><p><?php echo $row->shipping_bill_num; ?></p></td> <td><p><?php echo $row->shipping_bill_date; ?></p></td> <td><p><?php echo $row->shipping_port_code; ?></p></td> <td><p><?php echo IND_money_format(number_format((float)($row->drawack_amount), 2, '.', ''));?></p></td> <td><p><?php echo $row->drawback_credit_date; ?></p></td> <td><p><?php echo IND_money_format(number_format((float)($row->export_incentive), 2, '.', ''));?></p></td> <td><p><?php echo $row->incentive_credit_date; ?></p></td> </tr> <?php } ?> </table> </div> </body> <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.5/jspdf.min.js"></script> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script src="https://html2canvas.hertzen.com/dist/html2canvas.js"></script> <style> .chart-container { display: flex; align-items: center; } .legend { display: flex; flex-direction: column; margin-right: 20px; } .legend-item { display: flex; align-items: center; margin-bottom: 5px; } .legend-color { width: 20px; height: 20px; display: inline-block; margin-right: 5px; } </style> <style> table { font-family: arial, sans-serif; border-collapse: collapse; width: 100%; } td, th { border: 1px solid #dddddd; text-align: left; padding: 8px; } tr:nth-child(even) { background-color: #dddddd; } </style>