D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
view-proforma.php
back
Copy
<?php ob_start(); session_start(); include 'config.php'; $login = $_SESSION['login_email']; if($login == ''){ echo '<script>location.replace("index.php")</script>'; } $id = $_GET['id']; if(isset($_SESSION["source_id"])){ $source_id = $_SESSION['source_id']; } $companyd = mysqli_query($conn,"SELECT * FROM `company_details`"); $companyrow = mysqli_fetch_assoc($companyd); $contact_person = $companyrow['contact_person']; $company_name = $companyrow['company_name']; $company_logo = $companyrow['company_logo']; $GSTIN = $companyrow['GSTIN']; $phone = $companyrow['phone']; $eb_email = $companyrow['email']; $address = $companyrow['address']; $city = $companyrow['city']; $state = $companyrow['state']; $country = $companyrow['country']; $account_name = $companyrow['account_name']; $account_no = $companyrow['account_no']; $bank_name = $companyrow['bank_name']; $ifsc = $companyrow['ifsc']; $shift = $companyrow['shift']; $branch = $companyrow['branch']; $company_color = $companyrow['company_color']; $currency = $companyrow['currency']; $invoice_prifix = $companyrow['invoice_prifix']; $default_invoice = $companyrow['default_invoice']; $signature = $companyrow['signature']; $invoice_note = $companyrow['invoice_note']; ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Invoice Management | Invoice</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta content="A fully featured admin theme which can be used to build CRM, CMS, etc." name="description" /> <meta content="Coderthemes" name="author" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <!-- Font Awsome --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <!-- App favicon --> <link rel="shortcut icon" href="assets/images/favicon.png"> <!-- Pie Chart Css --> <!--<link href="assets/pie charts/style.css" rel="stylesheet" type="text/css" />--> <!-- App css --> <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link href="assets/css/icons.css" rel="stylesheet" type="text/css" /> <link href="assets/css/metismenu.min.css" rel="stylesheet" type="text/css" /> <link href="assets/css/style.css" rel="stylesheet" type="text/css" /> <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/css/select2.min.css'> <script src="assets/js/modernizr.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script type="text/javascript" src="script.js"></script> <link href="plugins/sweet-alert2/sweetalert2.min.css" rel="stylesheet" type="text/css"> <link href="plugins/jquery-toastr/jquery.toast.min.css" rel="stylesheet" /> <style> .table td, .table th { padding: .75rem; vertical-align: top; border-top: 0px solid #dee2e6; border-bottom: 1px solid #dee2e6; } </style> </head> <body> <!-- Begin page --> <div id="wrapper"> <!-- Top Bar Start --> <?php include 'top-header.php'; ?> <!-- Top Bar End --> <!-- ========== Left Sidebar Start ========== --> <?php include 'left-sidebar.php'; ?> <!-- Left Sidebar End --> <!-- ============================================================== --> <!-- Start right Content here --> <!-- ============================================================== --> <div class="content-page"> <!-- Start content --> <div class="content"> <div class="container-fluid"> <div class="row"> <div class="col-12"> <div class="page-title-box"> <h4 class="page-title float-left">View Proforma</h4> <ol class="breadcrumb float-right"> <li class="breadcrumb-item"><a href="#">Sales</a></li> <li class="breadcrumb-item ">All Proforma</li> <li class="breadcrumb-item active">View Proforma</li> </ol> <div class="clearfix"></div> </div> </div> </div> <!-- end row --> <?php $companyId =""; $sql = " SELECT * FROM proforma where id = '$id' and data_delete = 'NO'"; // echo $sql; $result = mysqli_query($conn,$sql); while( $row = mysqli_fetch_array($result)){ $bill_pay_name = $row['bill_pay_name']; $proforma_id = $row['proforma_id']; $date = $row['date']; $terms = $row['terms']; $due_date = $row['due_date']; $billingAddress = $row['billingAddress']; $deliver_address = $row['deliver_address']; $client_name = $row['client_name']; $pincode = $row['pincode']; $mobile_no = $row['mobile_no']; $email = $row['email']; $gstin = $row['gstin']; $type = $row['type']; $buyer_reference = $row['buyer_reference']; $delivery_type = $row['delivery_type']; $delivery_terms = $row['delivery_terms']; $mode_of_shipment = $row['mode_of_shipment']; $shipping_date = $row['shipping_date']; $port_of_loading = $row['port_of_loading']; $port_of_delivery = $row['port_of_delivery']; $country_of_goods = $row['country_of_goods']; $country_of_destination = $row['country_of_destination']; $payment_method = $row['payment_method']; $hs_code = $row['hs_code']; $terms_of_payment = $row['terms_of_payment']; $bank_details = $row['bank_details']; $other_charges = $row['other_charges']; $other_charge_msg = $row['other_charge_msg']; $other_price = $row['other_price']; $subtotal_price = $row['subtotal_price']; $bank_charge = $row['bank_charge']; $amount_paid = $row['amount_paid']; $comment = $row['comment']; ?> <div class="card-box"> <div class="col-md-12"> <div class="row" > <div class="col-md-12 mt-3 mb-3"> <h3 class="text-center" style="color:<?php echo $row['company_color'] ?>;"><b>Proforma</b></h3> </div> </div> <div class="row"> <div class="col-md-8"> <p><b>SHIPPER :</b></p> <h3 class="mb-0"><?php echo $company_name ?></h3> <p class="mb-0"><?php echo $address.','.$city.','.$state.','.$country; ?></p> <p class="mb-0">Contact Person : <?php echo $contact_person ?></p> <p class="mb-0">Contact Number : <?php echo $phone ?></p> <p class="mb-0">Email : <?php echo $eb_email ?></p> </div> <div class="col-md-4 text-right"> <h3 class="mb-0">Proforma No. : <?php echo $proforma_id ?></h3> <p class="mb-0">Proforma Date : <?php echo $date ?></p> <p class="mb-0">Buyer's Order : <?php echo $buyer_reference ?></p> <p><b>Comment:</b> <?php echo $comment ?></p> </div> </div> <hr> <?php $contactsql = mysqli_query($conn,"SELECT * FROM `contact` where id='$bill_pay_name' and data_delete ='no'"); $contactrow = mysqli_fetch_assoc($contactsql); $customer_type = $contactrow['customer_type']; $bill_display_name = $contactrow['bill_display_name']; $contact_person_name = $contactrow['contact_person_name']; $contact_person_designation = $contactrow['contact_person_designation']; // billing address $getad_b = mysqli_query($conn,"SELECT * FROM `contact_address` where id='$billingAddress'"); $getadrow_b = mysqli_fetch_assoc($getad_b); $address_get_b = $getadrow_b['address'] .', '. $getadrow_b['city'] .', '. $getadrow_b['state'] .', '. $getadrow_b['country']; // delivery address $getad = mysqli_query($conn,"SELECT * FROM `contact_address` where id='$deliver_address'"); $getadrow = mysqli_fetch_assoc($getad); $address_get = $getadrow['address'] .', '. $getadrow['city'] .', '. $getadrow['state'] .', '. $getadrow['country']; $iecno = $getadrow['iecno']; ?> <div class="row"> <div class="col-md-8"> <p><b>CONSIGNEE :</b></p> <p class="mb-0"> <b><?php echo $bill_display_name ?></b> </p> <p class="mb-0"> <?php echo $address_get_b ?></p> <p class="mb-0">Zip Code : <?php echo $pincode ?></p> <p class="mb-0">GSTIN : <?php echo $gstin ?></p> <p class="mb-0">IEC No.: <?php echo $iecno ?></p> <p class="mb-0">Contact Person: <?php echo $client_name ?></p> <!--<p class="mb-0">Contact Person: <?php echo $contact_person_name ?></p>--> <p class="mb-0">Contact No.: <?php echo $mobile_no ?></p> </div> <div class="col-md-4 text-right"> <p class="mb-0">Delivery Terms :<?php echo $delivery_terms ?></p> <p class="mb-0">Delivery Type : <?php echo $delivery_type ?></p> <p class="mb-0">Payment Method : <?php echo $payment_method ?></p> <p class="mb-0">Payment Terms : <?php echo $terms_of_payment ?></p> <p class="mb-0">Port Of loading : <?php echo $port_of_loading ?></p> <p class="mb-0">Port Of Delivery : <?php echo $port_of_delivery ?></p> <p class="mb-0">Country Of Origin Of Goods : <?php echo $country_of_goods ?></p> <p class="mb-0">Country Of Final Destination : <?php echo $country_of_destination ?></p> </div> </div> <hr> <div class="row"> <div class="col-md-8"> <p><b>SHIP TO :</b></p> <p><?php echo $address_get ?></p> </div> <div class="col-md-4 text-right"> <h4 class="mb-0">Beneficary Name : <?php echo $account_name ?></h4> <p class="mb-0">Bank A/C No. : <?php echo $account_no ?></p> <p class="mb-0">Bank Name : <?php echo $bank_name ?></p> <p class="mb-0">Swift Name : <?php echo $shift ?></p> <p class="mb-0">Address : <?php echo $address ?></p> </div> </div> </div> <div class="row" > <table class="table table-responsive"> <thead> <tr style="width:100%"> <th>Item Code</th> <th>Image</th> <th>Item Name</th> <th>Size</th> <th>Color</th> <th>Qty.</th> <th>Unit</th> <th>Price (<?php echo $currency ?>)</th> <th>Total (<?php echo $currency ?>)</th> </tr> </thead> <tbody id="itemsadd"> <?php $getitemsql = mysqli_query($conn,"SELECT * FROM proforma_item a left join inventory b on a.item_id = b.id where a.proforma_id = '$proforma_id'"); while($item_row = mysqli_fetch_assoc($getitemsql)){ $item_image = $item_row['item_image']; if(!empty($item_image)){ $if_image = '<img src="inventory/'.$item_image.'" width="50">'; }else{ $if_image = ''; } ?> <tr style="width:100%"> <td style="width:10%"><?php echo $item_row['item_code'] ?></td> <td style="width:5%"><?php echo $if_image ?></td> <td style="width:5%"><?php echo $item_row['name'] ?></td> <td style="width:10%"><?php echo $item_row['size'] ?></td> <td style="width:5%"><?php echo $item_row['color'] ?></td> <td style="width:5%"><?php echo $item_row['qty'] ?></td> <td style="width:5%"><?php echo $item_row['unit_of_measure'] ?></td> <td style="width:10%"><?php echo $item_row['price'] ?></td> <td style="width:10%"><?php echo $item_row['row_total'] ?></td> </tr> <?php }?> </tbody> </table> </div> <div class="row"> <div class="col-md-8"></div> <div class="col-md-4"> <div class="form-group row"> <p class="col-9 mb-0 ">Other <small>(<?php echo $other_charge_msg ?>)</small> </label> <div class="col-3"> <p class="mb-0 "><?php echo $currency ?> <?php echo $other_price?> </p> </div> </div> <div class="form-group row"> <p class="col-9 mb-0 ">Sub Total </label> <div class="col-3"> <p class="mb-0 "><?php echo $currency ?> <?php echo $subtotal_price?> </p> </div> </div> <div class="form-group row"> <p class="col-9 mb-0 ">Bank Charges </label> <div class="col-3"> <p class="mb-0 "><?php echo $currency ?> <?php echo $bank_charge?> </p> </div> </div> <div class="form-group row"> <p class="col-9 mb-0 "> Amount Paid </label> <div class="col-3"> <p class="mb-0 "><?php echo $currency ?> <?php echo $amount_paid?> </p> </div> </div> </div> <div class="col-md-8"> </div> <?php $sql_proforma = "SELECT SUM(qty) AS item_qty FROM proforma_item WHERE proforma_id = '$proforma_id'"; $sql_proforma_item = mysqli_query($conn,$sql_proforma); $sql_proforma_r = mysqli_fetch_assoc($sql_proforma_item); $total_proforma_qty = $sql_proforma_r['item_qty']; ?> <?php $sql_c = "SELECT SUM(qty) AS item_qty FROM invoice_item WHERE marge_status='no' and proforma_id = '$proforma_id'"; $sql_c_i = mysqli_query($conn,$sql_c); $sql_c_r = mysqli_fetch_assoc($sql_c_i); $total_invoice_qty = $sql_c_r['item_qty']; ?> <div class="col-md-12"> <?php //echo $total_invoice_qty ." " . $total_proforma_qty ?> <a href="edit-proforma.php?id=<?php echo $id ?>" class="btn w-md waves-effect waves-light btn-info" data-toggle="tooltip" data-placement="top" title="" data-original-title="Edit"><i class="fa fa-pencil"></i> Edit</a> <button type="button" class="btn w-md waves-effect waves-light btn-danger" value="<?php echo $id ?>" data-toggle="tooltip" data-placement="top" title="" data-original-title="Delete" id="btnDelete" onclick="deleteProforma(this)"><i class="fa fa-trash-o"></i> Delete</button> <?php // if($total_invoice_qty < $total_proforma_qty){ ?> <a href="add_invoice.php?id=<?php echo $id ?>" class="btn w-md waves-effect waves-light btn-warning" value="<?php echo $id ?>" data-toggle="tooltip" data-placement="top" title="" data-original-title="Convert To Invoice" id="btnConvert"> Convert To Invoice</a> <?php // } ?> <a href="print-proforma.php?id=<?php echo $id ?>" target="blank" class="btn w-md waves-effect waves-light btn-success" data-toggle="tooltip" data-placement="top" title="" data-original-title="Print"><i class="fa fa-print"></i> Print</a> <a href="create-purchase-order.php?id=<?php echo $id ?>" class="btn w-md waves-effect waves-light btn-secondary" data-toggle="tooltip" data-placement="top" title="" data-original-title=" Convert To purchase Order "><i class="fa fa-print"></i> Convert To purchase Order </a> </div> </div> </div> <?php } ?> </div> </div> <!-- container --> </div> <!-- content --> <?php include 'copyrignt.php' ?> </div> <!-- ============================================================== --> <!-- End Right content here --> <!-- ============================================================== --> </div> <!-- END wrapper --> <!-- /.modal --> <script src="assets/js/jquery.min.js"></script> <script src="assets/js/popper.min.js"></script><!-- Popper for Bootstrap --> <script src="assets/js/bootstrap.min.js"></script> <script src="assets/js/metisMenu.min.js"></script> <!--<script src="assets/js/waves.js"></script>--> <script src="assets/js/jquery.slimscroll.js"></script> <!-- Dashboard init --> <!-- <script src="assets/pages/jquery.dashboard.js"></script> --> <!-- App js --> <script src="assets/js/jquery.core.js"></script> <script src="assets/js/jquery.app.js"></script> <!-- Chart Js --> <!-- <script src="assets/pie charts/script.js"></script>--> <!-- <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js'></script> --> <!-- <script src='https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/js/select2.min.js'></script> --> <script src="plugins/sweet-alert2/sweetalert2.min.js"></script> <script src="plugins/jquery-toastr/jquery.toast.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ if (localStorage.getItem("proformaDeleted") == "true") { successMessage("Proforma Successfully Deleted."); localStorage.setItem("proformaDeleted", "false"); } }); function deleteProforma(button){ var itemId = $(button).val(); swal({ title: 'Are you sure?', text: "Do you really want to restore this Item??", type: 'warning', showCancelButton: true, confirmButtonColor: '#4fa7f3', cancelButtonColor: '#d57171', confirmButtonText: "Yes, I'm Sure!" }).then(function () { $.ajax({ url : "PHP/response.php", data : "action=DeleteProforma&proformaId="+itemId, method : "POST", async : false, success : function(response){ if(response == "DELETED"){ localStorage.setItem("proformaDeleted", "true"); location.replace('proforma.php'); } else{ errorMessage("Item could not be deleted."); } }, error : function(error){ errorMessage("Item could not be deleted."); } }); }); } function errorToast(msg){ $.toast({ heading: 'Error!', text: msg, position: 'top-right', loaderBg: '#bf441d', icon: 'error', hideAfter: 3000, stack: 1 }); } function successMessage(msg){ swal({ title: 'Success!', text: msg, type: 'success', confirmButtonColor: '#4fa7f3' }); } function errorMessage(msg){ swal({ title: 'Error!', text: msg, type: 'error', confirmButtonColor: '#4fa7f3' }); } </script> </body> </html>