  var table ;

  var profile_id = '';

  var HTML_VIEW_PAY = '';
  var print_page =  `
                      <script>
                        window.print();
                        window.onload = function() { window.print(); }
                      </script>
                      `;
  var HTML_Table = `
                    <!DOCTYPE html>
                    <html lang="ar" dir="rtl">
                    <head>
                      <meta charset="utf-8">
                      <meta http-equiv="X-UA-Compatible" content="IE=edge">
                      <style>

                        .print {  
                          -webkit-print-color-adjust: exact;
                        }
                        
                        .table0_td {
                          
                          border:none;
                          padding:0in 0pt 0in 0pt;
                          height:9.95pt
                          
                        }
                        
                        .table0_td1 {
                          
                          border:none;
                          border-bottom:solid #984806 1.0pt;
                          padding:0in 0pt 0in 0pt;
                          height:9.95pt
                          
                        }
                        
                        
                        
                        .table1_td {
                          
                          border:solid #984806 1.0pt;
                          border-left-color: white;
                          background:#9f9f9f;
                          padding:0pt 0pt 0pt 0pt;
                          height:.1in
                          
                        }
                        
                        .last_td {
                          border-left-color: #984806 !important;
                        }
                        
                        .table1_td1 {
                          
                          border:solid #984806 1.0pt;
                          border-top:none;
                          background:white;
                          padding:0pt 0pt 0pt 0pt;
                          height:.1in
                          
                        }
                        
                        .table2_td {
                          
                          border:solid #984806 1.0pt;
                          border-left-color: white;
                          background:#9f9f9f;
                          padding:0pt 0pt 0pt 0pt;
                          height:.1in;
                          
                        }
                        
                        .td_head {
                          text-align: center;
                          
                          color : white;
                          height: .3in;
                        }
                        
                        .td_body {
                          text-align: center;
                          
                          color : black;
                          height: .2in;
                          border:solid #984806 1.0pt;
                        }
                        
                        #inv_table tr:nth-child(odd) {
                          background-color: #FDE9D9;
                        }
                        
                        @font-face {
                          font-family: "Noto Kufi Arabic";
                          src: url(assets/custom_font/NotoKufiArabic-Regular.ttf) format("truetype");
                          }
                        
                        .badge {
                          display: inline-block;
                          min-width: 10px;
                          padding: 3px 7px;
                          font-size: 12px;
                          font-weight: 500;
                          color: #fff;
                          line-height: 1.5384616;
                          vertical-align: middle;
                          white-space: nowrap;
                          text-align: center;
                          background-color: #999999;
                          border-radius: 10px;
                        } 
                        
                        .badge {
                          padding: 1px 1px 1px 1px;
                          font-size: 10px;
                          letter-spacing: 0px;
                          vertical-align: baseline;
                          
                        }
                        
                        .bg-orange-400 {
                          background-color: #FFA726;
                          border-color: #FFA726;
                          color: #fff;
                        }
                        
                        .col-sm-4 {
                          width: 33.33333333%;
                        }
                        
                        .col-sm-3 {
                          width: 25%;
                        }

                      </style>

                    </head>

                    <body class="print" style=" font-family: 'Noto Kufi Arabic', Times, serif;">
                      <div align=center>
                    `;

  var table_invoice     =`
                          <html>

                            <head>
                                <meta charset="utf-8">
                                <meta http-equiv=Content-Type content="text/html; charset=utf-8">
                                <meta name=Generator content="Microsoft Word 15 (filtered)">
                                <style>
                                
                                .print {  
                                    -webkit-print-color-adjust: exact;
                                    }
                                    <!--
                                    /* Font Definitions */
                                    
                                    @font-face {
                                        font-family: "Cambria Math";
                                        panose-1: 2 4 5 3 5 4 6 3 2 4;
                                    }
                                    
                                    @font-face {
                                        font-family: Calibri;
                                        panose-1: 2 15 5 2 2 2 4 3 2 4;
                                    }
                                    
                                    @font-face {
                                        font-family: "Calibri Light";
                                        panose-1: 2 15 3 2 2 2 4 3 2 4;
                                    }
                                    
                                    @font-face {
                                        font-family: "Century Gothic";
                                        panose-1: 2 11 5 2 2 2 2 2 2 4;
                                    }
                                    
                                    @font-face {
                                        font-family: Tahoma;
                                        panose-1: 2 11 6 4 3 5 4 4 2 4;
                                    }
                                    /* Style Definitions */
                                    
                                    p.MsoNormal,
                                    li.MsoNormal,
                                    div.MsoNormal {
                                        margin-top: 0in;
                                        margin-right: 0in;
                                        margin-bottom: 8.0pt;
                                        margin-left: 0in;
                                        line-height: 105%;
                                        font-size: 11.0pt;
                                        font-family: "Calibri", sans-serif;
                                    }
                                    
                                    h2 {
                                        mso-style-link: "Heading 2 Char";
                                        margin: 0in;
                                        margin-bottom: .0001pt;
                                        page-break-after: avoid;
                                        font-size: 8.0pt;
                                        font-family: "Calibri Light", sans-serif;
                                        color: #262626;
                                        font-weight: normal;
                                    }
                                    
                                    p.MsoHeader,
                                    li.MsoHeader,
                                    div.MsoHeader {
                                        mso-style-link: "Header Char";
                                        margin: 0in;
                                        margin-bottom: .0001pt;
                                        font-size: 8.0pt;
                                        font-family: "Calibri", sans-serif;
                                        color: #262626;
                                    }
                                    
                                    a:link,
                                    span.MsoHyperlink {
                                        color: blue;
                                        text-decoration: underline;
                                    }
                                    
                                    a:visited,
                                    span.MsoHyperlinkFollowed {
                                        color: purple;
                                        text-decoration: underline;
                                    }
                                    
                                    span.Heading2Char {
                                        mso-style-name: "Heading 2 Char";
                                        mso-style-link: "Heading 2";
                                        font-family: "Calibri Light", sans-serif;
                                        color: #262626;
                                    }
                                    
                                    p.msonormal0,
                                    li.msonormal0,
                                    div.msonormal0 {
                                        mso-style-name: msonormal;
                                        margin-right: 0in;
                                        margin-left: 0in;
                                        font-size: 12.0pt;
                                        font-family: "Times New Roman", serif;
                                    }
                                    
                                    span.HeaderChar {
                                        mso-style-name: "Header Char";
                                        mso-style-link: Header;
                                        font-family: "Calibri", sans-serif;
                                        color: #262626;
                                    }
                                    
                                    p.msopapdefault,
                                    li.msopapdefault,
                                    div.msopapdefault {
                                        mso-style-name: msopapdefault;
                                        margin-right: 0in;
                                        margin-bottom: 8.0pt;
                                        margin-left: 0in;
                                        line-height: 105%;
                                        font-size: 12.0pt;
                                        font-family: "Times New Roman", serif;
                                    }
                                    
                                    p.msochpdefault,
                                    li.msochpdefault,
                                    div.msochpdefault {
                                        mso-style-name: msochpdefault;
                                        margin-right: 0in;
                                        margin-left: 0in;
                                        font-size: 10.0pt;
                                        font-family: "Times New Roman", serif;
                                    }
                                    
                                    p.Slogan,
                                    li.Slogan,
                                    div.Slogan {
                                        mso-style-name: Slogan;
                                        margin-top: 0in;
                                        margin-right: 0in;
                                        margin-bottom: 3.0pt;
                                        margin-left: 0in;
                                        font-size: 7.0pt;
                                        font-family: "Calibri", sans-serif;
                                        color: #A6A6A6;
                                        letter-spacing: .2pt;
                                        font-style: italic;
                                    }
                                    
                                    p.ContactInfo,
                                    li.ContactInfo,
                                    div.ContactInfo {
                                        mso-style-name: "Contact Info";
                                        margin-top: 26.0pt;
                                        margin-right: 0in;
                                        margin-bottom: 0in;
                                        margin-left: 0in;
                                        margin-bottom: .0001pt;
                                        text-align: center;
                                        font-size: 8.0pt;
                                        font-family: "Calibri", sans-serif;
                                        color: #A6A6A6;
                                    }
                                    
                                    p.ThankYou,
                                    li.ThankYou,
                                    div.ThankYou {
                                        mso-style-name: "Thank You";
                                        margin: 0in;
                                        margin-bottom: .0001pt;
                                        text-align: center;
                                        font-size: 9.0pt;
                                        font-family: "Calibri", sans-serif;
                                        color: #262626;
                                        font-weight: bold;
                                        font-style: italic;
                                    }
                                    
                                    span.companyphones {
                                        mso-style-name: company_phones;
                                    }
                                    
                                    span.companyemail {
                                        mso-style-name: company_email;
                                    }
                                    
                                    span.invoiceno {
                                        mso-style-name: invoice_no;
                                    }
                                    
                                    span.invoicedate {
                                        mso-style-name: invoice_date;
                                    }
                                    
                                    span.deliverystatus {
                                        mso-style-name: delivery_status;
                                    }
                                    
                                    span.destination {
                                        mso-style-name: destination;
                                    }
                                    
                                    .MsoChpDefault {
                                        font-size: 10.0pt;
                                    }
                                    
                                    @page WordSection1 {
                                        size: 595.3pt 841.9pt;
                                        margin: .3in .3in .3in .3in;
                                    }
                                    
                                    div.WordSection1 {
                                        page: WordSection1;
                                    }
                                    
                                    -->
                                </style>
                                <script type="text/javascript" src="assets/js/core/libraries/jquery.min.js"></script>
                            </head>
                            <?php include('models/translation.class.php'); ?>
                            <script >
                              var CSS_PATH        = '<?php echo $CSS; ?>';
                              var LANGUAGE_NAME       = '<?php echo $LANG; ?>';
                              var LANGUAGE_DIR      = '<?php echo $DIR; ?>';

                              var Left_Arraw        = 'l';
                              var Right_Arraw       = 'r';

                              if(LANGUAGE_DIR == 'ltr'){
                                Left_Arraw        = 'r';
                                Right_Arraw       = 'l';
                              }
                              

                              var Keyword_Array_Js    = <?php echo json_encode($op) ; ?>;

                              function Auto_Translate(){
                                
                                var Js_Array_len  = Keyword_Array_Js.length;

                                $(".multi_lang").each(function() {

                                    var Item_Text   = $(this).text();
                                    if(Item_Text==null || Item_Text == undefined || Item_Text ==''){
                                      Item_Text   = $(this).attr('placeholder');
                                    }

                                    if(Item_Text !=null && Item_Text != undefined && Item_Text !=''){
                                      


                                      for (var j = 0; j < Js_Array_len ; ++j) {
                                        
                                        if(Item_Text.trim() == Keyword_Array_Js[j].keyword){
                                          
                                          var Translated_key = Keyword_Array_Js[j].translated_keyword;
                                          if(Translated_key ==null || Translated_key == ''){
                                            Translated_key = Keyword_Array_Js[j].keyword
                                          }
                                          $(this).text(Translated_key);
                                          $(this).attr('placeholder',Translated_key);
                                          break;
                                        }
                                      } // for j
                                    } 
                                });
                              }
                              

                              function Translation(msg){

                                var translated_msg  = msg;
                                if(msg !=null && msg != undefined && msg !=''){
                                  var len_array   = Keyword_Array_Js.length;
                                    for (var j = 0; j < len_array; ++j) {
                                      if(msg.trim() == Keyword_Array_Js[j].keyword){

                                        var Translated_key = Keyword_Array_Js[j].translated_keyword;
                                        if(Translated_key ==null || Translated_key == ''){
                                          Translated_key = Keyword_Array_Js[j].keyword
                                        }
                                        return Translated_key;
                                      }
                                    }
                                }
                                
                                return translated_msg;
                              }
                              

                            </script>

                            <body lang=EN-US link=blue vlink=purple>

                                <div class=WordSection1>

                                    <div align=center>

                            `;






   function show_invoice(itm,printing=null,detail_show=null){

          
          var headers           ='';
          var attach            = "";
          var attach_other      = "";
          var footers           ="";
          var customer_details  = "";
          var print_attach      = "";

          $.ajax({
                url : 'models/crul_invoice.php',
                type : 'POST',
                data : {type:'show_invoice', id : itm},
                dataType : 'json',
                success : function(response) {
                    // console.log(response)
                    
                        headers =`

                                  <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=734 style='width:550.5pt;border-collapse:collapse'>
                                    <tr style='height:.25in'>
                                        <td width=264 nowrap colspan=3 style='width:2.75in;border:none;border-bottom:  solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:.25in'>
                                            <p class=Slogan style='line-height:105%'><span style='font-family:"Century Gothic",sans-serif'>
                                            <img   width=86 height=77 src="`+COMPANY_LOGO+`">
                                            </p>
                                            <p class=Slogan style='line-height:105%'>
                                                <b>
                                                    <span style='font-size:9.0pt; line-height:105%;font-family:"Century Gothic",sans-serif'>
                                                    `+COMPANY_NAME+`
                                                    </span>
                                                </b>
                                            </p>
                                            
                                            <br>
                                        </td>
                                        <td width=409 colspan=11 style='width:307.0pt;border:none;border-bottom:solid windowtext 1.0pt; padding:0in 0in 0in 0in;height:.25in'>
                                            <p class=MsoNormal align=center style='text-align:center'>
                                                <span style='font-size:36.0pt;line-height:105%;font-family:"Century Gothic", sans-serif; color:#A6A6A6'>
                                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INVOICE
                                                </span>
                                            </p>
                                        </td>
                                        <td width=60 nowrap style='width:45.15pt;border:none;border-bottom:solid windowtext 1.0pt;   padding:0in 5.4pt 0in 5.4pt;height:.25in'>
                                            <p class=MsoNormal dir=RTL style='margin-bottom:0in;margin-bottom:.0001pt; text-align:right;direction:rtl;unicode-bidi:embed'>
                                                <span style=' position:relative;top:0px;z-index:-1895822336'>
                                                <span dir=LTR><img width=31  height=62 src="image/sys/image005.gif"></span>
                                            </p>
                                        </td>
                                    </tr>
                                    <tr style='height:25.15pt'>
                                        <td width=156 nowrap colspan=4 style='width:117.0pt;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:25.15pt'>
                                            <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center'>
                                                <b>
                                                <span style='font-size:12.0pt;line-height:105%'>
                                                `+Translation('Invoice #')+`
                                                </span>
                                                
                                                <b><span style='font-size:12.0pt;line-height:105%'>&nbsp;</span></b>
                                                <span lang=AR-SA dir=RTL style='font-size:12.0pt;line-height:105%'>
                                                `+Translation('')+`</span>
                                            </p>
                                        </td>
                                        <td width=108 colspan=3 style='width:81.0pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:25.15pt'>
                                            <h2 align=center style='text-align:center;line-height:105%'>
                                                <b>
                                                <span  style='font-size:12.0pt;line-height:105%;font-family:"Calibri",sans-serif'>
                                                `+Translation('Date')+` 
                                                </span>
                                                </b>
                                                <span lang=AR-SA dir=RTL style='font-size:  12.0pt;line-height:105%;font-family:"Calibri",sans-serif'>
                                                `+Translation('')+`</span>

                                            </h2>
                                        </td>
                                        <td width=108 colspan=4 style='width:81.0pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:25.15pt'>
                                            <h2 align=center style='text-align:center;line-height:105%'>
                                                <b>
                                                <span  style='font-size:12.0pt;line-height:105%;font-family:"Calibri",sans-serif'>
                                                `+Translation('Branch')+` 
                                                </span>
                                                </b>
                                            </h2>
                                        </td>
                                        
                                        <td width=146 nowrap colspan=4 style='width:109.15pt;border-top:none;  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:25.15pt'>
                                            <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'>
                                                <b>
                                                    <span style='font-size:12.0pt'>`+Translation('Payment Terms')+`</span>
                                                </b>
                                            </p>
                                        </td>
                                    </tr>
                                    <tr style='height:26.95pt' align=center>
                                        <td width=156 nowrap colspan=4 style='width:117.0pt;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:26.95pt'>
                                            `+response.invoice[0].invoice_number+`
                                        </td>
                                        <td width=108 colspan=3 style='width:81.0pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:26.95pt'>
                                            `+response.invoice[0].invoice_date+`
                                        </td>
                                        <td width=108 colspan=4 style='width:81.0pt;border-top:none;border-left:solid windowtext 1.0pt;  border-bottom:solid windowtext 1.0pt;border-right:none;padding:0in 0in 0in 0in;  height:26.95pt'>
                                            `+response.invoice[0].branch_name+`
                                            
                                        </td>
                                        
                                        <td width=146 nowrap colspan=4 style='width:109.15pt;border-top:none;  border-left:solid 1pt;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:26.95pt'>
                                            <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center'>
                                                <b>
                                                    <span style='font-size:12.0pt;line-height:105%'>`+30+` days</span>
                                                </b>
                                            </p>
                                        </td>
                                    </tr> `;
                        
                        

                        customer_details = `


                                          <tr style='height:19.25pt'>
                                              <td width=156 nowrap colspan=2 rowspan=4 style='width:117.0pt;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:19.25pt'>
                                                  <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal'>
                                                      <b>`+Translation('Client Details')+`</b>
                                                  </p>
                                              </td>
                                              <td width=108 valign=top style='width:81.0pt;padding:0in 5.4pt 0in 5.4pt;  height:19.25pt'>
                                                  <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'>
                                                      `+Translation('Name:')+`
                                                  </p>
                                              </td>
                                              <td width=324 colspan=9 valign=top style='width:243.0pt;border:none;  border-right:solid windowtext 1.0pt;padding:0in 0in 0in 0in;height:19.25pt'>
                                                  <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'>
                                                  `+response.invoice[0].customer_full_name+`
                                                  </p>
                                              </td>
                                              <td width=146 colspan=3 rowspan=4 style='width:109.15pt;border-top:none;  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:19.25pt'>
                                                  <p class=MsoNormal dir=RTL style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:right;line-height:normal;direction:rtl;unicode-bidi:embed'>
                                                      <b>
                                                          <span  lang=AR-IQ style='color:black'>
                                                          `+Translation('تفاصيل الزبون')+`
                                                          </span>
                                                      </b>
                                                  </p>
                                              </td>
                                          </tr>
                                          <tr style='height:17.0pt'>
                                              <td width=108 valign=top style='width:81.0pt;padding:0in 5.4pt 0in 5.4pt;height:17.0pt'>
                                                  <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'>
                                                  `+Translation('المشتري:')+`
                                                  </p>
                                              </td>
                                              <td width=324 colspan=9 valign=top style='width:243.0pt;border:none; border-right:solid windowtext 1.0pt;padding:0in 0in 0in 0in;height:17.0pt'>
                                                  <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'>
                                                      <span dir=LTR>`+response.invoice[0].author  +`</span>
                                                  </p>
                                              </td>
                                          </tr>
                                          <tr style='height:17.0pt'>
                                              <td width=108 valign=top style='width:81.0pt;padding:0in 5.4pt 0in 5.4pt;height:17.0pt'>
                                                  <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'>
                                                  `+Translation('Email:')+`
                                                  </p>
                                              </td>
                                              <td width=324 colspan=9 valign=top style='width:243.0pt;border:none;  border-right:solid windowtext 1.0pt;padding:0in 0in 0in 0in;height:17.0pt'>
                                                  <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'>
                                                  `+response.invoice[0].customer_email+`
                                                  </p>
                                              </td>
                                          </tr>
                                          <tr style='height:17.0pt'>
                                              <td width=108 valign=top style='width:81.0pt;padding:0in 5.4pt 0in 5.4pt;height:17.0pt'>
                                                  <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'>
                                                  `+Translation('Phone No.:')+`
                                                  </p>
                                              </td>
                                              <td width=324 colspan=9 valign=top style='width:243.0pt;border:none; border-right:solid windowtext 1.0pt;padding:0in 0in 0in 0in;height:17.0pt'>
                                                  <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'>
                                                  `+response.invoice[0].customer_phone+`
                                                  </p>
                                              </td>
                                          </tr>
                                            `;

                      attach =  `
                                    <tr style='height:26.0pt'>
                                      <td width=72 nowrap style='width:.75in;border:solid windowtext 1.0pt; border-top:none;padding:0in 5.4pt 0in 5.4pt;height:26.0pt'>
                                          <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'>
                                              <b><span style='color:black'>`+Translation('Item No.')+`</span>
                                              </b>
                                          </p>
                                      </td>
                                      <td width=84 nowrap colspan=4 style='width:63.0pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:26.0pt'>
                                          <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'>
                                              <b>
                                                  <span style='color:black'>`+Translation('Item Name')+`</span>
                                              </b>
                                          </p>
                                      </td>
                                      <td  nowrap colspan=2 style='width:100.5pt;border:solid windowtext 1.0pt;  border-left:none;padding:0in 5.4pt 0in 5.4pt;height:26.0pt'>
                                          <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'>
                                              <b><span style='color:black'>`+Translation('Quantity')+`</span> 
                                              </b>
                                          </p>
                                      </td>
                                      <td width=72 nowrap colspan=3 style='width:.75in;border:solid windowtext 1.0pt;  border-left:none;padding:0in 5.4pt 0in 5.4pt;height:26.0pt'>
                                          <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'>
                                              <b><span style='color:black'>`+Translation('Discount')+`</span>
                                              </b>
                                          </p>
                                      </td>
                                      <td nowrap colspan=2 style='width:80pt;border:solid windowtext 1.0pt;border-left:  none;padding:0in 5.4pt 0in 5.4pt;height:26.0pt'>
                                          <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'>
                                              <b><span style='color:black'>`+Translation('Unit Price')+`</span>
                                              </b>
                                          </p>
                                      </td>
                                      <td width=80 nowrap style='width:90pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:26.0pt'>
                                          <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'>
                                              <b><span style='color:black'>`+Translation('Total Price')+`</span> 
                                              </b>
                                          </p>
                                      </td>
                                      <td width=66 nowrap colspan=2 style='width:49.25pt;border:solid windowtext 1.0pt;  border-left:none;padding:0in 5.4pt 0in 5.4pt;height:26.0pt'>
                                          <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'>
                                              <b><span style='color:black'>`+Translation('Notes')+`</span>
                                              </b>
                                          </p>
                                      </td>
                                  </tr>


                                  `;
                     
                      // show sell item details       

                      

                      for(var i=0 ; i < response.invoice.length;i++){                        


                          attach = attach + `
                                               <tr style='height:15.0pt'>
                                                  <td width=72 nowrap style='width:.75in;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                      `+(i+1)+`
                                                  </td>
                                                  <td width=84 nowrap colspan=4 style='width:63.0pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                      <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'>
                                                      <span style='color:black' id="product_code">
                                                      `+response.invoice[i].product_name+`
                                                      
                                                      </span>
                                                    </p>
                                                  </td>
                                                  <td colspan=2 style='width:100.5pt;border-top:none;border-left:  solid windowtext 1.0pt;border-bottom:solid windowtext 1.0pt;border-right:  solid black 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                      <span style='font-size:10.0pt;line-height:105%;font-family:"Times New Roman",serif'>
                                                          `+response.invoice[i].sell_item_quantity+`
                                                      </span>
                                                  </td>
                                                  
                                                  <td width=72 nowrap colspan=3 style='width:.75in;border-top:none;border-left:  none;border-bottom:solid windowtext 1.0pt;border-right:solid gray 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                      <span style='font-size:10.0pt;  line-height:105%;font-family:"Times New Roman",serif'>
                                                          `+response.invoice[i].sell_actual_discount+`
                                                      </span>
                                                  </td>

                                                  <td width=78 nowrap colspan=2 style='width:80pt;border-top:none;border-left:none;border-bottom: solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;  height:15.0pt'>
                                                      <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-align: right;'>
                                                      <span dir="RTL" style='color:black' id="unit_price">`+currency_format_display(response.invoice[i].item_sell_price_per_unit)+`</span>
                                                      </p>
                                                  </td>
                                                  <td width=80 nowrap style='width:90pt;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                      <p class=MsoNormal align=right style='margin-bottom:0in;margin-bottom:.0001pt;   text-align:right;line-height:normal'>
                                                      <span dir="RTL" style='color:black' id="row_price">`+currency_format_display(response.invoice[i].row_price)+`</span>
                                                    </p>
                                                  </td>
                                                  <td width=66 nowrap colspan=2 style='width:49.25pt;border-top:none;  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                      <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;   text-align:center;line-height:normal'>
                                                      <span style='color:black' id="notes">`+response.invoice[i].sell_item_notes+`</span>
                                                    </p>
                                                  </td>
                                              </tr>
                                             `;
                        
                        
                       
                      } // for i

                      if(printing != null){
                        print_attach = `
                                        <script>
                                          window.print();
                                          window.onload = function() { window.print(); }
                                        </script>
                                        `;
                      }else{
                        print_attach = "";
                      }

                      footers =`

                                  <tr style='height:17.1pt'>
                                      <td width=72 nowrap style='width:.75in;border:solid windowtext 1.0pt;                  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                            
                                      </td>
                                      <td width=516 colspan=11 valign=top style='width:387.0pt;border-top:none;                border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                          <p class=MsoNormal align=right style='margin-bottom:0in;margin-bottom:.0001pt;       text-align:right;line-height:normal'>
                                              <b>
                                                  <span style='color:black'>`+Translation('Grand Total (USD)')+`</span> 
                                              </b>
                                          </p>
                                      </td>
                                      <td width=80 valign=top style='width:59.9pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                          <p class=MsoNormal align=right style='margin-bottom:0in;margin-bottom:.0001pt; text-align:right;line-height:normal'>
                                          <b>
                                            <span dir="RTL" style='color:black' id="total_invoice">`+currency_format_display(response.invoice[0].invoice_total_price_actual)+`</span>
                                          </b>
                                        </p>
                                      </td>
                                      <td width=66 nowrap colspan=2 style='width:49.25pt;border-top:none;  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                          
                                      </td>
                                  </tr>
                                  <tr style='height:17.1pt'>
                                      <td width=72 nowrap style='width:.75in;border:solid windowtext 1.0pt; border-top:none;padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                          
                                      </td>
                                      <td width=516 colspan=11 valign=top style='width:387.0pt;border-top:none;  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                          <p class=MsoNormal align=right style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:right;line-height:normal'>
                                              <b><span style='color:red'>`+Translation('Discount (USD)')+`</span> </b>
                                          </p>
                                      </td>
                                      <td width=80 valign=top style='width:59.9pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                          <p class=MsoNormal align=right style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:right;line-height:normal'>
                                          <b>
                                            <span dir="RTL" style='color:black' id="total_discount">`+currency_format_display(response.invoice[0].actual_discount)+`</span>
                                          </b>
                                        </p>
                                      </td>
                                      <td width=66 nowrap colspan=2 style='width:49.25pt;border-top:none;  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                          
                                      </td>
                                  </tr>
                                  <tr style='height:17.1pt'>
                                      <td width=72 nowrap style='width:.75in;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                          
                                      </td>
                                      <td width=516 colspan=11 valign=top style='width:387.0pt;border-top:none;  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                          <p class=MsoNormal align=right style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:right;line-height:normal'>
                                              <span style='color:green'>`+Translation('Amount Paid in Advance')+`</span> 
                                          </p>
                                      </td>
                                      <td width=80 style='width:59.9pt;border-top:none;border-left:none;border-bottom:  solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;  height:17.1pt'>
                                          <p class=MsoNormal align=right style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:right;line-height:normal'>
                                          <b>
                                            <span dir="RTL" style='color:black' id="total_paid">`+currency_format_display(response.invoice[0].total_paid)+`</span>
                                          </b>
                                        </p>
                                      </td>
                                      <td width=66 nowrap colspan=2 style='width:49.25pt;border-top:none;  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                          
                                      </td>
                                  </tr>
                                  <tr style='height:17.1pt'>
                                      <td width=72 nowrap style='width:.75in;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                          
                                      </td>
                                      <td width=516 colspan=11 valign=top style='width:387.0pt;border-top:none;  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                          <p class=MsoNormal align=right style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:right;line-height:normal'>
                                              <b><span style='color:#862D03'>`+Translation('Balance (Not Paid)')+`</span> </b>
                                          </p>
                                      </td>
                                      <td width=80 style='width:59.9pt;border-top:none;border-left:none;border-bottom:  solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;  height:17.1pt'>
                                          <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal; text-align: right;'>
                                          <b>
                                            <span dir="RTL" style='color:black' id="total_remain">`+currency_format_display(response.invoice[0].total_remained)+`</span>
                                          </b>
                                        </p>
                                      </td>
                                      <td width=66 nowrap colspan=2 style='width:49.25pt;border-top:none;  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                          
                                      </td>
                                  </tr>
                                  <tr style='height:26.0pt'>
                                      <td width=72 valign=bottom style='width:.75in;padding:0in 5.4pt 0in 5.4pt;height:26.0pt'>
                                          <p class=ContactInfo align=left style='margin-top:0in;text-align:left; line-height:105%'>
                                              <b><span style='font-size:9.0pt;line-height:105%'>`+Translation('Note:')+`</span></b>
                                          </p>
                                      </td>
                                      <td width=662 colspan=14 valign=bottom style='width:496.15pt;padding:0in 0in 0in 0in;  height:26.0pt'>
                                          <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'>
                                          <span style='font-size:10.0pt; color:black'>
                                            `+response.invoice[0].invoice_note+`
                                          </span>
                                        </p>
                                      </td>
                                  </tr>
                                  <tr style='height:30.5pt'>
                                      <td width=72 valign=top style='width:.75in;padding:0in 5.4pt 0in 5.4pt;  height:30.5pt'>
                                          <p class=ContactInfo align=left style='text-align:left;line-height:105%'>
                                              <b><span  style='font-size:9.0pt;line-height:105%'>`+Translation('Signed By:')+`</span></b>
                                          </p>
                                      </td>
                                      <td width=662 colspan=14 valign=top style='width:496.15pt;padding:0in 0in 0in 0in;  height:30.5pt'>
                                          
                                      </td>
                                  </tr>
                                  <tr style='height:6.0pt'>
                                      <td width=734 colspan=15 valign=top style='width:550.15pt;padding:0in 5.4pt 0in 5.4pt;  height:6.0pt'>
                                          <p class=ContactInfo style='margin-top:0in;line-height:105%'>
                                              <span style='font-size:9.0pt;line-height:105%;color:#7F7F7F'>
                                              `+Translation('Make all checks payable to DARA Company')+`</span>
                                          </p>
                                      </td>
                                  </tr>
                                  <tr style='height:6.0pt'>
                                      <td width=734 colspan=15 valign=top style='width:550.15pt;padding:0in 5.4pt 0in 5.4pt;  height:6.0pt'>
                                          <p class=ThankYou style='line-height:105%'>
                                          `+Translation('Thank you for your business!')+`
                                          </p>
                                      </td>
                                  </tr>
                                  <tr style='height:6.0pt'>
                                      <td width=734 colspan=15 valign=top style='width:550.15pt;padding:0in 5.4pt 0in 5.4pt;  height:6.0pt'>
                                          <p class=ContactInfo style='margin-top:12.0pt;line-height:105%'>
                                              <span lang=AR-KW dir=RTL style='font-size:10.0pt;line-height:105%;font-family:"Sakkal Majalla"; color:#7F7F7F'>
                                              `+Translation('شارع ١٠٠م محلة نازناز, مقابل مطار أربيل الدولي, أربيل, عراق')+`
                                              </span>
                                          </p>
                                      </td>
                                  </tr>
                                  <tr style='height:.25in'>
                                      <td width=294 nowrap colspan=4 style='width:220.5pt;padding:0in 5.4pt 0in 5.4pt;  height:.25in'>
                                          <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center'>
                                          
                                            <span dir=LTR class="company_phones">`+COMPANY_PHONE+`</span></span></b></p>

                                          </p>
                                      </td>
                                      <td width=144 nowrap colspan=3 style='width:1.5in;padding:0in 5.4pt 0in 5.4pt; height:.25in'>
                                          <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center'>
                                              <span style='color:black; text-decoration:none'>`+Translation('www.dara.co')+`</span>
                                          </p>
                                      </td>
                                      <td width=296 nowrap colspan=8 style='width:221.65pt;padding:0in 5.4pt 0in 5.4pt;  height:.25in'>
                                          <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center'>
                                              <span dir=LTR class="company_email">`+COMPANY_EMAIL+`</span> </span></p>
                                             

                                          </p>
                                      </td>
                                  </tr>
                                  <tr>
                                      <td width=72 style='width:.75in;padding:0in 0in 0in 0in'></td>
                                      <td width=84 style='width:63.0pt;padding:0in 0in 0in 0in'></td>
                                      <td width=108 style='width:81.0pt;padding:0in 0in 0in 0in'></td>
                                      <td width=30 style='width:22.5pt;padding:0in 0in 0in 0in'></td>
                                      <td width=87 colspan=2 style='width:64.95pt;padding:0in 0in 0in 0in'></td>
                                      <td width=57 style='width:43.05pt;padding:0in 0in 0in 0in'></td>
                                      <td width=30 style='width:22.2pt;padding:0in 0in 0in 0in'></td>
                                      <td width=25 colspan=2 style='width:18.75pt;padding:0in 0in 0in 0in'></td>
                                      <td width=17 style='width:13.05pt;padding:0in 0in 0in 0in'></td>
                                      <td width=78 style='width:58.5pt;padding:0in 0in 0in 0in'></td>
                                      <td width=80 style='width:59.9pt;padding:0in 0in 0in 0in'></td>
                                      <td width=5 style='width:4.1pt;padding:0in 0in 0in 0in'></td>
                                      <td width=60 style='width:45.15pt;padding:0in 0in 0in 0in'></td>
                                  </tr>
                                  <tr height=0>
                                      <td width=72 style='border:none'></td>
                                      <td width=84 style='border:none'></td>
                                      <td width=108 style='border:none'></td>
                                      <td width=30 style='border:none'></td>
                                      <td width=78 style='border:none'></td>
                                      <td width=9 style='border:none'></td>
                                      <td width=57 style='border:none'></td>
                                      <td width=30 style='border:none'></td>
                                      <td width=12 style='border:none'></td>
                                      <td width=13 style='border:none'></td>
                                      <td width=17 style='border:none'></td>
                                      <td width=78 style='border:none'></td>
                                      <td width=80 style='border:none'></td>
                                      <td width=5 style='border:none'></td>
                                      <td width=60 style='border:none'></td>
                                  </tr>
                              </table>

                          </div>

                          

                      </div>

                  </body>

                  
                     `+print_attach+`
                    </html>`;

                      

                     
                },
                complete: function() {
                       //  me.data('requestRunning', false);
                       HTML_VIEW = table_invoice + headers + customer_details + attach + attach_other + footers;
                       //  me.data('requestRunning', false);
                        window.open().document.write(HTML_VIEW);
                }

          }); // submit ajax


    }
    
    function show_invoice1(itm,printing=null,detail_show=null){

          
          var headers           ='';
          var attach            = "";
          var attach_other      = "";
          var footers           ="";
          var customer_details  = "";
          var print_attach      = "";

          $.ajax({
                url : 'models/crul_invoice.php',
                type : 'POST',
                data : {type:'show_invoice', id : itm},
                dataType : 'json',
                success : function(response) {
                    // console.log(response)
                    
                  headers =`
                            <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="96%" style='width:96.58%;border-collapse:collapse'>
                              <tr style='height:25.55pt'>
                                  <td width=228 nowrap colspan=11 style='text-align:center;width:171.0pt;border:none;border-bottom:  solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:30.55pt'>
                                      
                                      <p><b><span style='align:center;font-size:16.0pt;  line-height:105%;font-family:"Century Gothic",sans-serif'>
                                       `+COMPANY_NAME+`
                                      </span></b></p>
                                  </td>
                                  
                              </tr>

                              <tr style='height:25.15pt'>
                                  <td width=138 nowrap colspan=3 style='width:103.5pt;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:25.15pt'>
                                      <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center'><b><span style='font-size:12.0pt;line-height:105%'>
                                      Invoice #
                                      </span> </b></p>
                                  </td>
                                  <td width=90 style='width:67.5pt;border-top:none;border-left:none;border-bottom:  solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 0in 0in 0in;  height:25.15pt'>
                                      <h2 align=center style='text-align:center;line-height:105%'><b><span  style='color:#a00303; font-size:14.0pt;line-height:105%;font-family:"Calibri",sans-serif'>
                                      `+response.invoice[0].invoice_number+`
                                      </span></b><span style='font-family:"Calibri",sans-serif'> </span></h2>
                                  </td>
                                  <td width=168 colspan=3 style='width:1.75in;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:25.15pt'>
                                      <h2 align=center style='text-align:center;line-height:105%'><b><span  style='font-size:12.0pt;line-height:105%;font-family:"Calibri",sans-serif'>
                                      Order Date
                                      </span></b></h2>
                                  </td>
                                  <td width=138 colspan=2 style='width:103.5pt;border-top:none;border-left:  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:25.15pt'>
                                      <h2 align=center style='text-align:center;line-height:105%'><b><span  style='color:#a00303;font-size:12.0pt;line-height:105%;font-family:"Calibri",sans-serif'>
                                       `+response.invoice[0].invoice_date+`
                                      </span></b></h2>
                                  </td>
                                  <td width=84 style='width:63.0pt;border-top:none;border-left:none;border-bottom:  solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 0in 0in 0in;  height:25.15pt'>
                                      <h2 align=center style='text-align:center;line-height:105%'><b><span  style='font-size:12.0pt;line-height:105%;font-family:"Calibri",sans-serif'>
                                      Delivery Date
                                      </span></b></h2>
                                  </td>
                                  <td width=93 nowrap style='width:69.7pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:25.15pt'>
                                      <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;color:#a00303;  text-align:center;line-height:normal'><b><span style='font-size:12.0pt'>
                                       `+response.invoice[0].delivery_time+`
                                      </span></b></p>
                                  </td>
                              </tr>
                              <!--
                              <tr style='height:17.9pt'>
                                  <td width=138 nowrap colspan=3 style='width:103.5pt;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:17.9pt'>
                                      <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal; text-align:center;'><span style='font-size:16.0pt; text-align:center;'>
                                      `+response.invoice[0].invoice_number+`
                                      </span></p>
                                  </td>
                                  <td width=90 style='width:67.5pt;border-top:none;border-left:none;border-bottom:  solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 0in 0in 0in;  height:17.9pt'>
                                      <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal; text-align:center;'><span style='font-size:12.0pt; text-align:center;'>
                                      `+response.invoice[0].invoice_date+`
                                      </span></p>
                                  </td>
                                  <td width=168 colspan=3 style='width:1.75in;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:17.9pt'>
                                      <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal; text-align:center;'><span style='font-size:12.0pt; text-align:center;'>
                                      `+response.invoice[0].delivery_time+`
                                      </span></p>
                                  </td>
                                  <td width=138 colspan=2 style='width:103.5pt;border-top:none;border-left:  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:17.9pt'>
                                      <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal'><span style='font-size:12.0pt; text-align:center;'>
                                      &nbsp;
                                      </span></p>
                                  </td>
                                  <td width=84 style='width:63.0pt;border-top:none;border-left:none;border-bottom:  solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 0in 0in 0in;  height:17.9pt'>
                                      <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'>
                                      &nbsp;
                                      </p>
                                  </td>
                                  <td width=93 nowrap style='width:69.7pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.9pt'>
                                      <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'>
                                      &nbsp;
                                      </p>
                                  </td>
                              </tr>
                              -->
                              <tr style='height:3.5pt'>
                                  <td width=138 nowrap colspan=3 style='width:103.5pt;border:none;border-bottom:  solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:3.5pt'></td>
                                  <td width=90 style='width:67.5pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:3.5pt'></td>
                                  <td width=168 colspan=3 style='width:1.75in;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:3.5pt'></td>
                                  <td width=138 colspan=2 style='width:103.5pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:3.5pt'></td>
                                  <td width=84 style='width:63.0pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:3.5pt'></td>
                                  <td width=93 nowrap style='width:69.7pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:3.5pt'>
                                      <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'><span style='font-size:3.0pt;line-height:105%'>&nbsp;</span></p>
                                  </td>
                              </tr>`;
                  
                  

                  customer_details = `

                                    <tr style='height:17.0pt'>
                                      <td width=138 nowrap colspan=3 rowspan=2 style='width:103.5pt;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:17.0pt'>
                                          <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal'><b>
                                          Client Details
                                          </b> </p>
                                      </td>
                                      <td width=90 style='width:67.5pt;border-top:none;border-left:none;border-bottom:  solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;  height:17.0pt'>
                                          <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center'><span id="customer_info"></span><b>
                                          C.Company:
                                          </b></p>
                                      </td>
                                      <td width=306 colspan=5 style='width:229.5pt;border-top:none;border-left:  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:17.0pt'>
                                      `+response.invoice[0].customer_company+`
                                      </td>
                                      <td width=84 style='width:63.0pt;border-top:none;border-left:none;border-bottom:  solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 0in 0in 0in;  height:17.0pt'>
                                          <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center'><b>
                                          Author :
                                          </b></p>
                                      </td>
                                      <td width=93 style='width:69.7pt;border-top:none;border-left:none;border-bottom:  solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 0in 0in 0in;  height:17.0pt'>
                                       `+response.invoice[0].author+`
                                      </td>
                                  </tr>
                                  <tr style='height:17.0pt'>
                                      <td width=90 style='width:67.5pt;border-top:none;border-left:none;border-bottom:  solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;  height:17.0pt'>
                                          <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center'><b>
                                          Customer:
                                          </b></p>
                                      </td>
                                      <td width=306 colspan=5 style='width:229.5pt;border-top:none;border-left:  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:17.0pt'>
                                       `+response.invoice[0].customer_full_name+`
                                      </td>
                                      <td width=84 style='width:63.0pt;border-top:none;border-left:none;border-bottom:  solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 0in 0in 0in;  height:17.0pt'>
                                          <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center'><b>
                                          Phone No.:
                                          </b></p>
                                      </td>
                                      <td width=93 style='width:69.7pt;border-top:none;border-left:none;border-bottom:  solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 0in 0in 0in;  height:17.0pt'>
                                      `+response.invoice[0].customer_phone+`
                                      </td>
                                  </tr>

                                    <tr style='height:3.5pt'>
                                      <td width=138 nowrap colspan=3 style='width:103.5pt;border:none;border-bottom:  solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;height:3.5pt'></td>
                                      <td width=90 style='width:67.5pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:3.5pt'></td>
                                      <td width=168 colspan=3 style='width:1.75in;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:3.5pt'></td>
                                      <td width=138 colspan=2 style='width:103.5pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:3.5pt'></td>
                                      <td width=84 style='width:63.0pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:3.5pt'></td>
                                      <td width=93 nowrap style='width:69.7pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:3.5pt'>
                                        <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt'><span style='font-size:3.0pt;line-height:105%'>&nbsp;</span></p>
                                      </td>
                                  </tr>`;



                  attach =  `
                              <tr style='height:19.75pt'>
                                <td width=36 nowrap style='width:27.15pt;border:solid windowtext 1.0pt;  border-top:none;background:#D9D9D9;padding:0in 5.4pt 0in 5.4pt;height:19.75pt'>
                                    <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><b><span style='color:black'>
                                    No
                                    </span></b></p>
                                </td>
                                <td width=48 nowrap style='width:35.85pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  background:#D9D9D9;padding:0in 5.4pt 0in 5.4pt;height:19.75pt'>
                                    <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><b><span style='color:black'>
                                    Price
                                    </span></b></p>
                                </td>
                                <td width=54 nowrap style='width:40.5pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  background:#D9D9D9;padding:0in 5.4pt 0in 5.4pt;height:19.75pt'>
                                    <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><b><span style='color:black'>
                                    FIYAT
                                    </span></b></p>
                                </td>
                                <td width=90 nowrap style='width:67.5pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  background:#D9D9D9;padding:0in 5.4pt 0in 5.4pt;height:19.75pt'>
                                    <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><b><span style='color:black'>
                                    (M2)
                                    </span>  </b></p>
                                </td>
                                <td width=90 style='width:67.5pt;border-top:none;border-left:none;border-bottom:  solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;background:#D9D9D9;  padding:0in 5.4pt 0in 5.4pt;height:19.75pt'>
                                    <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><b>
                                    LENGTH
                                    </b></p>
                                </td>
                                <td width=75 style='width:56.55pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  background:#D9D9D9;padding:0in 0in 0in 0in;height:19.75pt'>
                                    <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><b>
                                    WIDTH
                                    </b></p>
                                </td>
                                <td width=51 colspan=2 style='width:38.1pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  background:#D9D9D9;padding:0in 0in 0in 0in;height:19.75pt'>
                                    <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><b>
                                    QTY
                                    </b></p>
                                </td>
                                <td width=90 style='width:67.35pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  background:#D9D9D9;padding:0in 0in 0in 0in;height:19.75pt'>
                                    <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><b>
                                    COMMENT
                                    </b></p>
                                </td>
                                <td width=84 nowrap style='width:63.0pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  background:#D9D9D9;padding:0in 5.4pt 0in 5.4pt;height:19.75pt'>
                                    <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><b><span style='color:black'>
                                    MODEL
                                    </span></b></p>
                                </td>
                                <td width=93 nowrap style='width:69.7pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  background:#D9D9D9;padding:0in 5.4pt 0in 5.4pt;height:19.75pt'>
                                    <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><b><span style='color:black'>
                                    COLOR
                                    </span></b></p>
                                </td>
                            </tr>`;
                      
                  var total_areas = '';
                  // show sell item details  

                  var is_splited = false;  // to split between tac_isik and wood rows

                  for(var i=0 ; i < response.invoice.length;i++){                        

                      var areas   = '';

                      var fiyats  = 0;

                      var itm_H   = '';
                      var itm_W   = '';

                      var m_name  ='';
                      var quty    ='';
                      var u_price ='';
                      
                      var m_code  = '';

                      var c_code  = '';


                      u_price     = parseInt(response.invoice[i].item_sell_price_per_unit) + " $";
                      quty        = parseInt(response.invoice[i].sell_item_quantity);
                      m_code      = response.invoice[i].model_code;
                      c_code      = response.invoice[i].product_code_color;


                      if(response.invoice[i].model_type !="TAC" && response.invoice[i].model_type !="ISIK"){
                        areas =  response.invoice[i].sell_item_height * response.invoice[i].sell_item_width * response.invoice[i].sell_item_quantity / 1000000; 
                        total_areas = +total_areas + +areas; 

                        areas = areas.toFixed(5);

                        fiyats = response.invoice[i].item_sell_price_per_unit *  response.invoice[i].sell_item_height * response.invoice[i].sell_item_width * response.invoice[i].sell_item_quantity / 1000000;
                        itm_H  = parseInt(response.invoice[i].sell_item_height);
                        itm_W  = parseInt(response.invoice[i].sell_item_width);

                        fiyats = currency_format_display_no_space(fiyats);

                        m_name = response.invoice[i].model_name;
                         
                         
                        if(m_name.toLowerCase() =="empty"){

                          areas     = '';
                          u_price   = '';

                          fiyats  = '';
                          itm_H   = '';
                          itm_W   = '';
                          quty    = '';
                          m_code  = '';
                          c_code  = '';

                        }

                      }else{
                       areas = response.invoice[i].model_type;
                       fiyats = response.invoice[i].item_sell_price_per_unit *   response.invoice[i].sell_item_quantity ;

                      }

                      if(response.invoice[i].model_type !="TAC" && response.invoice[i].model_type !="ISIK"){

                        attach = attach + `

                                          <tr style='height:15.0pt'>
                                            <td width=36 nowrap style='width:27.15pt;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+(i+1)+`
                                                </span></p>
                                            </td>
                                            <td width=48 nowrap style='width:35.85pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+u_price+`
                                                
                                                </span></p>
                                            </td>
                                            <td width=54 style='width:40.5pt;border-top:none;border-left:solid windowtext 1.0pt;  border-bottom:solid windowtext 1.0pt;border-right:solid black 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+(fiyats)+`
                                                </span></p>
                                            </td>
                                            <td width=90 nowrap style='width:67.5pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid gray 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+areas+`
                                                </span></p>
                                            </td>
                                            <td width=90 style='width:67.5pt;border-top:none;border-left:none;border-bottom:  solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;  height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+itm_H+`
                                                </span></p>
                                            </td>
                                            <td width=75 style='width:56.55pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+itm_W+`
                                                </span></p>
                                            </td>
                                            <td width=51 colspan=2 style='width:38.1pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+quty+`
                                                </span></p>
                                            </td>
                                            <td width=90 style='width:67.35pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+response.invoice[i].sell_item_comment+`
                                                </span></p>
                                            </td>
                                            <td width=84 nowrap style='width:63.0pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+m_code+`
                                                </span></p>
                                            </td>
                                            <td width=93 nowrap style='width:69.7pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+c_code+`
                                                </span></p>
                                            </td>
                                        </tr>`;

                      }else{

                        if (is_splited == false){

                            
                          attach_other = attach_other + `
                                          <tr style='height:6.65pt'>
                                            <td width=36 nowrap style='width:27.15pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:6.65pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                            </td>
                                            <td width=48 nowrap style='width:35.85pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:6.65pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                            </td>
                                            <td width=54 style='width:40.5pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:6.65pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                            </td>
                                            <td width=90 nowrap style='width:67.5pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:6.65pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                            </td>
                                            <td width=90 style='width:67.5pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:6.65pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                            </td>
                                            <td width=75 style='width:56.55pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:6.65pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                            </td>
                                            <td width=51 colspan=2 style='width:38.1pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:6.65pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                            </td>
                                            <td width=90 style='width:67.35pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:6.65pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                            </td>
                                            <td width=84 nowrap style='width:63.0pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:6.65pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                            </td>
                                            <td width=93 nowrap style='width:69.7pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:6.65pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                            </td>
                                          </tr>  `;

                          is_splited = true;

                        }

                        if(response.invoice[i].model_type =="TAC" ){
                              attach_other = attach_other + `

                                          <tr style='height:15.0pt'>
                                            <td width=36 nowrap style='width:27.15pt;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                #
                                                </span></p>
                                            </td>
                                            <td width=48 nowrap style='width:35.85pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+u_price+`
                                                
                                                </span></p>
                                            </td>
                                            <td width=54 style='width:40.5pt;border-top:none;border-left:solid windowtext 1.0pt;  border-bottom:solid windowtext 1.0pt;border-right:solid black 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+(fiyats)+`
                                                </span></p>
                                            </td>
                                            <td width=90 colspan=3 nowrap style='width:67.5pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid gray 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+areas+`
                                                </span></p>
                                            </td>
                                            <!--<td width=90 style='width:67.5pt;border-top:none;border-left:none;border-bottom:  solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;  height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+itm_H+`
                                                </span></p>
                                            </td>
                                            <td width=75 style='width:56.55pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+itm_W+`
                                                </span></p>
                                            </td> -->
                                            <td width=51 colspan=2 style='width:38.1pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+quty+`
                                                </span></p>
                                            </td>
                                            <td width=90 style='width:67.35pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+response.invoice[i].sell_item_comment+`
                                                </span></p>
                                            </td>
                                            <td width=84 nowrap style='width:63.0pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+m_code+`
                                                </span></p>
                                            </td>
                                            <td width=93 nowrap style='width:69.7pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+c_code+`
                                                </span></p>
                                            </td>
                                        </tr>`;
                        }else{

                              attach_other = attach_other + `

                                          <tr style='height:15.0pt'>
                                            <td width=36 nowrap style='width:27.15pt;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                #
                                                </span></p>
                                            </td>
                                            <td width=48 nowrap style='width:35.85pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+u_price+`
                                                
                                                </span></p>
                                            </td>
                                            <td width=54 style='width:40.5pt;border-top:none;border-left:solid windowtext 1.0pt;  border-bottom:solid windowtext 1.0pt;border-right:solid black 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+(fiyats)+`
                                                </span></p>
                                            </td>
                                            <td width=90 colspan=3 nowrap style='width:67.5pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid gray 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+areas+`
                                                </span></p>
                                            </td>
                                            <!--<td width=90  style='width:67.5pt;border-top:none;border-left:none;border-bottom:  solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;  height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+itm_H+`
                                                </span></p>
                                            </td>
                                            <td width=75 style='width:56.55pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+itm_W+`
                                                </span></p>
                                            </td> -->
                                            <td width=51 colspan=2 style='width:38.1pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+quty+`
                                                </span></p>
                                            </td>
                                            <td width=90 style='width:67.35pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+response.invoice[i].sell_item_comment+`
                                                </span></p>
                                            </td>
                                            <td width=84 nowrap style='width:63.0pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+m_code+`
                                                </span></p>
                                            </td>
                                            <td width=93 nowrap style='width:69.7pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:15.0pt'>
                                                <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:10.0pt'>
                                                `+c_code+`
                                                </span></p>
                                            </td>
                                        </tr>`;

                        }



                      }

                      
                    
                    
                   
                  } // for i

                      if(printing != null){
                        print_attach = `
                                        <script>
                                            setTimeout(function() {
                                              window.print()
                                            }, 2000)
                                        </script>
                                        `;
                      }else{
                        print_attach = "";
                      }

                     
                      if(total_areas !=''){
                            total_areas = total_areas.toFixed(2);
                      }

                      var total_isik  = response.invoice[0].total_ISIK_price;
                      var total_tac   = response.invoice[0].total_TAC_price;

                      if(total_isik != null && total_isik !=''){
                        total_isik = parseInt(total_isik);
                      }else{
                        total_isik = 0;
                      }

                      if(total_tac != null && total_tac !=''){
                        total_tac = parseInt(total_tac);
                      }else{
                        total_tac = 0;
                      }


                      footers =`

                                <tr style='height:6.65pt'>
                                  <td width=36 nowrap style='width:27.15pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:6.65pt'>
                                      <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                  </td>
                                  <td width=48 nowrap style='width:35.85pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:6.65pt'>
                                      <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                  </td>
                                  <td width=54 style='width:40.5pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:6.65pt'>
                                      <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                  </td>
                                  <td width=90 nowrap style='width:67.5pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:6.65pt'>
                                      <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                  </td>
                                  <td width=90 style='width:67.5pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:6.65pt'>
                                      <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                  </td>
                                  <td width=75 style='width:56.55pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:6.65pt'>
                                      <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                  </td>
                                  <td width=51 colspan=2 style='width:38.1pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:6.65pt'>
                                      <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                  </td>
                                  <td width=90 style='width:67.35pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 0in 0in 0in;height:6.65pt'>
                                      <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                  </td>
                                  <td width=84 nowrap style='width:63.0pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:6.65pt'>
                                      <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                  </td>
                                  <td width=93 nowrap style='width:69.7pt;border:none;border-bottom:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:6.65pt'>
                                      <p class=MsoNormal align=center style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:center;line-height:normal'><span style='font-size:6.0pt'>&nbsp;</span></p>
                                  </td>
                                </tr>
                                

                                <tr style='height:17.1pt'>
                                  <td width=36 nowrap style='width:27.15pt;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:17.1pt'></td>
                                  <td width=582 colspan=9 valign=top style='width:436.35pt;border-top:none;  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                      <p class=MsoNormal align=right style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:right;line-height:normal'><b><span style='color:#2E75B6'>
                                      M<sup>2</sup>
                                      </span></b></p>
                                  </td>
                                  <td width=93 valign=top style='width:69.7pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                      <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal ;  text-align:center;'><span style='font-size:12.0pt'>
                                      `+total_areas+`
                                      </span></p>
                                  </td>
                              </tr>

                              <tr style='height:17.1pt'>
                                  <td width=36 nowrap style='width:27.15pt;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:17.1pt'></td>
                                  <td width=582 colspan=9 valign=top style='width:436.35pt;border-top:none;  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                      <p class=MsoNormal align=right style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:right;line-height:normal'><b><span style='color:#00B050'>
                                      Price (USD)
                                      </span></b></p>
                                  </td>
                                  <td width=93 valign=top style='width:69.7pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                      <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal;  text-align:center;'><span style='font-size:12.0pt'>
                                      `+currency_format_display(response.invoice[0].total_PVC_price)+`
                                      </span></p>
                                  </td>
                              </tr>

                              
                              
                              <tr style='height:17.1pt'>
                                  <td width=36 nowrap style='width:27.15pt;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                      <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal'><span style='font-size:10.0pt'>
                                      &nbsp;
                                      </span></p>
                                  </td>
                                  <td width=582 colspan=9 valign=top style='width:436.35pt;border-top:none;  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                      <p class=MsoNormal align=right style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:right;line-height:normal'><b><span style='color:#7030A0'>
                                      TAC
                                      </span></b></p>
                                  </td>
                                  <td width=93 valign=top style='width:69.7pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                      <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal;  text-align:center;'><span style='font-size:12.0pt'>
                                      `+parseInt(total_tac)+` $
                                      </span></p>
                                  </td>
                              </tr>
                              <tr style='height:17.1pt'>
                                  <td width=36 nowrap style='width:27.15pt;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                      <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal'><span style='font-size:10.0pt'>
                                      &nbsp;
                                      </span></p>
                                  </td>
                                  <td width=582 colspan=9 valign=top style='width:436.35pt;border-top:none;  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                      <p class=MsoNormal align=right style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:right;line-height:normal'><b><span style='color:#7030A0'>
                                      ISIK  BANDI
                                      </span></b></p>
                                  </td>
                                  <td width=93 valign=top style='width:69.7pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                      <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal;  text-align:center;'><span style='font-size:12.0pt'>
                                      `+parseInt(total_isik)+` $
                                      </span></p>
                                  </td>
                              </tr>

                              <tr style='height:17.1pt'>
                                  <td width=36 nowrap style='width:27.15pt;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:17.1pt'></td>
                                  <td width=582 colspan=9 valign=top style='width:436.35pt;border-top:none;  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                      <p class=MsoNormal align=right style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:right;line-height:normal'><b><span style='color:red'>
                                      Discount (USD)
                                      </span> </b></p>
                                  </td>
                                  <td width=93 valign=top style='width:69.7pt;border-top:none;border-left:none;  border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                      <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal;  text-align:center;'><span style='font-size:12.0pt'>
                                      `+parseInt(response.invoice[0].actual_discount)+` $
                                      </span></p>
                                  </td>
                              </tr>

                              <tr style='height:17.1pt'>
                                  <td width=36 nowrap style='width:27.15pt;border:solid windowtext 1.0pt;  border-top:none;padding:0in 5.4pt 0in 5.4pt;height:17.1pt'></td>
                                  <td width=582 colspan=9 valign=top style='width:436.35pt;border-top:none;  border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;  padding:0in 5.4pt 0in 5.4pt;height:17.1pt'>
                                      <p class=MsoNormal align=right style='margin-bottom:0in;margin-bottom:.0001pt;  text-align:right;line-height:normal'><b><span style='color:black'>
                                      Grand Total (USD)
                                      </span> </b></p>
                                  </td>
                                  <td width=93 style='width:69.7pt;border-top:none;border-left:none;border-bottom:  solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt;  height:17.1pt'>
                                      <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:  normal ;  text-align:center;'><span style='font-size:14.0pt'>
                                      <b>`+currency_format_display(response.invoice[0].total_price_disc)+`</b>
                                      </span></p>
                                  </td>
                              </tr>
                              <tr style='height:18.8pt'>
                                  <td width=84 colspan=2 valign=bottom style='width:63.0pt;padding:0in 5.4pt 0in 5.4pt;  height:18.8pt'>
                                      <p class=ContactInfo align=left style='margin-top:0in;text-align:left;  line-height:105%'><b><span style='font-size:10.0pt;line-height:105%'>
                                      Note:
                                      </span></b><span style='font-size:10.0pt;line-height:105%'> </span></p>
                                  </td>
                                  <td width=627 colspan=9 valign=bottom style='width:470.2pt;padding:0in 0in 0in 0in;  height:18.8pt'>
                                      <p class=ContactInfo align=left style='margin-top:0in;text-align:left;  line-height:105%'><span style='font-size:10.0pt;line-height:105%'>
                                      `+response.invoice[0].invoice_note+`
                                      </span></p>
                                  </td>
                              </tr>
                              <tr style='height:15.3pt'>
                                  <td width=84 colspan=2 valign=top style='width:63.0pt;padding:0in 5.4pt 0in 5.4pt;  height:15.3pt'>
                                      <p class=ContactInfo align=left style='margin-top:0in;text-align:left;  line-height:105%'><b><span style='font-size:5.0pt;line-height:105%'>&nbsp;</span></b></p>
                                      <p class=ContactInfo align=left style='margin-top:0in;text-align:left;  line-height:105%'><b><span style='font-size:10.0pt;line-height:105%'>
                                      Signed  By:
                                      </span></b><span style='font-size:10.0pt;line-height:105%'> </span></p>
                                  </td>
                                  <td width=627 colspan=9 valign=top style='width:470.2pt;padding:0in 0in 0in 0in;  height:15.3pt'>
                                      <p class=ContactInfo align=left style='margin-top:0in;text-align:left;  line-height:105%'><span style='font-size:10.0pt;line-height:105%'>&nbsp;</span></p>
                                  </td>
                              </tr>
                              <tr style='height:6.0pt'>
                                  <td width=711 colspan=11 valign=top style='width:533.2pt;padding:0in 5.4pt 0in 5.4pt;  height:6.0pt'>
                                      <p class=ContactInfo style='margin-top:0in;line-height:105%'><span style='font-size:10.0pt;line-height:105%;color:#7F7F7F'>
                                      `+Translation('Make all checks payable to Oscar Company')+`
                                      </span><span style='font-size:10.0pt;  line-height:105%'> </span></p>
                                  </td>
                              </tr>
                              <tr style='height:6.0pt'>
                                  <td width=228 colspan=4 valign=top style='width:171.0pt;padding:0in 5.4pt 0in 5.4pt;  height:6.0pt'>
                                      <p class=ContactInfo align=left style='margin-top:0in;text-align:left;  line-height:105%'><span style='font-size:10.0pt;line-height:105%;color:#7F7F7F'>
                                      
                                      </span></p>
                                  </td>
                                  <td width=216 colspan=4 valign=top style='width:162.15pt;padding:0in 0in 0in 0in;  height:6.0pt'>
                                      <p class=ContactInfo style='margin-top:0in;line-height:105%'><span style='font-size:10.0pt;line-height:105%;color:#7F7F7F'>
                                      `+Translation('www.oscar.co')+`
                                      </span></p>
                                  </td>
                                  <td width=267 colspan=3 valign=top style='width:200.05pt;padding:0in 0in 0in 0in;  height:6.0pt'>
                                      <p class=ContactInfo align=right style='margin-top:0in;text-align:right;  line-height:105%'><span lang=AR-SA dir=RTL style='font-size:10.0pt;  line-height:105%;color:#7F7F7F'>
                                        
                                        </span></p>
                                  </td>
                              </tr>
                              <tr height=0>
                                  <td width=36 style='border:none'></td>
                                  <td width=48 style='border:none'></td>
                                  <td width=54 style='border:none'></td>
                                  <td width=90 style='border:none'></td>
                                  <td width=83 style='border:none'></td>
                                  <td width=67 style='border:none'></td>
                                  <td width=3 style='border:none'></td>
                                  <td width=42 style='border:none'></td>
                                  <td width=84 style='border:none'></td>
                                  <td width=84 style='border:none'></td>
                                  <td width=93 style='border:none'></td>
                              </tr>
                          </table>

                      </div>


                  </div>

              </body>

              </html>


                  
                     `+print_attach+`
                    </html>`;

                      

                     
                },
                complete: function() {
                       //  me.data('requestRunning', false);
                       HTML_VIEW = table_invoice + headers + customer_details + attach + attach_other + footers;
                       //  me.data('requestRunning', false);
                        window.open().document.write(HTML_VIEW);
                }

          }); // submit ajax


    }







