Downloading the Excel File from Sales Order

Requirement:

Add a new button for sales order records called “Download excel.” In that button’s action, the excel file must be downloaded in excel format. The file must be named in the format “document number.xls”.

Solution:

/**
 * @NApiVersion 2.1
 * @NScriptType UserEventScript
 */
/**
 * Script Description
 * This User Event script is to create button in Salesorder in view mode
 *
 /*******************************************************************************
 * APC-390 UE JJ Download XML Button APC-390
 * *******************************************************************************
 * $Author: Jobin & Jismi IT Services LLP $
 *
 * Date: 25 - 05 - 2022
 * DESCRIPTION
 * This User Event script is to create button in Salesorder in view mode
 *
 ******************************************************************************/
define(['N/record', 'N/render','N/search'],
    
    (record, render, search) => {

        const beforeLoad = (scriptContext) => {

                if(scriptContext.type=="view" ) {
                        try {
                                var soRecord =  scriptContext.newRecord.id;
                                soRecord = record.load({type: record.Type.SALES_ORDER, id: soRecord, isDynamic: true})
                                var status = soRecord.getValue({fieldId: 'status'});

                                if (status !== 'C' && status !== 'H' ) {

                                        scriptContext.form.addButton({
                                                id: 'custpage_downloadexcel_button',
                                                label: 'Download Excel',
                                                functionName: 'DownloadExcel()'
                                        });
                                        scriptContext.form.clientScriptFileId = 1004151;
                                }
                        }catch (err){
                                log.debug('error',err)
                        }
                }
        }
        return {beforeLoad}

    });
/**
 * @NApiVersion 2.x
 * @NScriptType ClientScript
 * @NModuleScope SameAccount
 */
/**
 * Script Description
 * This Client script executes the button action for downloading excel from sales order
 *
 /*******************************************************************************
 * APC-390 JJ CS Download Excel Button Action APC-390
 * *******************************************************************************
 * $Author: Jobin & Jismi IT Services LLP $
 *
 * Date: 25 - 05 - 2022
 * DESCRIPTION
 * This Client script executes the button action for downloading excel from sales order
 *
 ******************************************************************************/
define(['N/currentRecord', 'N/record', 'N/recordContext', 'N/url'],

function(currentRecord, record, recordContext, url ) {

    /**
     * Function to be executed after page is initialized.
     *
     * @param {Object} scriptContext
     * @param {Record} scriptContext.currentRecord - Current form record
     * @param {string} scriptContext.mode - The mode in which the record is being accessed (create, copy, or edit)
     *
     * @since 2015.2
     */
    function pageInit(scriptContext) {
    }
    function DownloadExcel(){
        try {
            var currentRec = currentRecord.get().id;
            console.log('currentRec',currentRec)

            var createLinkUrl = url.resolveScript({
                scriptId: 'customscript_jj_sl_dwnld_excel_apc390',
                deploymentId: 'customdeploy_jj_sl_dwnld_excel_apc390',
                returnExternalUrl: false,
                params: {
                    currentRec: currentRec,
                }

            });
            window.open(createLinkUrl);
        }catch (e) {
            log.debug("Error@DownloadExcel", e)
        }
    }
    return {
        pageInit: pageInit,
        DownloadExcel: DownloadExcel

    };

});
/**
 * @NApiVersion 2.1
 * @NScriptType Suitelet
 */
/**
 * Script Description
 * This suitelet renders the SO data to excel format
 *
 /*******************************************************************************
 * APC-390 JJ SL Download SO Excel File APC-390
 * *******************************************************************************
 * $Author: Jobin & Jismi IT Services LLP $
 *
 * Date: 25 - 05 - 2022
 *
 ******************************************************************************/
define(['N/record', 'N/recordContext', 'N/redirect', 'N/render', 'N/runtime', 'N/url', 'N/search', 'N/encode', 'N/file'],
    /**
     * @param{record} record
     * @param{recordContext} recordContext
     * @param{redirect} redirect
     * @param{render} render
     * @param{runtime} runtime
     * @param{url} url
     * @param{search} search
     */
    (record, recordContext, redirect, render, runtime, url, search, encode, file) => {
        /**
         * Defines the Suitelet script trigger point.
         * @param {Object} scriptContext
         * @param {ServerRequest} scriptContext.request - Incoming request
         * @param {ServerResponse} scriptContext.response - Suitelet response
         * @since 2015.2
         */

        /**
         * Function to download SO in excel format
         */

        function downloadExcel(so_number, date, payTerms, po, shipAddressArray, billAddressArray, shipMethod, shipDate, subTotal, taxTotal, total, itemArray, response) {
            try {
                log.debug("tran id", so_number)
                log.debug("date id", date)
                log.debug("payTerms id", payTerms)
                log.debug("shipMethod id", shipMethod)
                log.debug("shipDate id", shipDate)
                log.debug("subTotal id", subTotal)
                log.debug("taxTotal id", taxTotal)
                log.debug("tran id", so_number)



                var XML = "";

                var myXMLFile = file.load({
                    id: '1004656'
                });
                var myXMLFile_value = myXMLFile.getContents();

                XML= myXMLFile_value.replace('<!-- REPLACEWITHTRANID -->','#'+ so_number);
                XML = XML.replace('<!-- REPLACEWITHDATE -->', date);

                //Shipping and billing addresses
                var shipAddr = '';

                for (let s=0; s<shipAddressArray.length; s++){
                    shipAddr += shipAddressArray[s] + '
';
                }

               //shipAddr += shipAddressArray[0] + '
' + shipAddressArray[1] + '
' + shipAddressArray[2] + '
' + shipAddressArray[3] + '
' + shipAddressArray[4];
                var billAddr = '';
                for (let b=0; b<billAddressArray.length; b++){
                    billAddr += billAddressArray[b] + '
';
                }
               // billAddr += billAddressArray[0] + '
' + billAddressArray[1] + '
' + billAddressArray[2] + '
' + billAddressArray[3] + '
' + billAddressArray[4];
                XML = XML.replace('<!-- REPLACEWITHBILLINGADDRESS -->', billAddr);
                XML = XML.replace('<!-- REPLACEWITHSHIPPINGADDRESS -->', shipAddr);
                //
                XML = XML.replace('<!-- REPLACEWITHTERMS -->', payTerms);
                XML = XML.replace('<!-- REPLACEWITHPO -->', po);
                XML = XML.replace('<!-- REPLACEWITHSHIPMETHOD -->', shipMethod);
                XML = XML.replace('<!-- REPLACEWITHSHIPDATE -->', shipDate);
                XML = XML.replace('<!-- REPLACEWITHSUBTOTAL -->', subTotal);
                XML = XML.replace('<!-- REPLACEWITHTAXTOTAL -->', taxTotal);
                XML = XML.replace('<!-- REPLACEWITHTOTAL -->', total);

                // //item table
                var table = '';
                for (let i = 0; i < itemArray.length; i++) {
                    table += '<Row ss:AutoFitHeight="0"  ss:Height="60">\n' +
                        '    <Cell ss:StyleID="s82"><Data ss:Type="Number">'+(i+1)+'</Data></Cell>\n' +
                        '    <Cell ss:StyleID="s94"><Data ss:Type="String">'+itemArray[i].itemCode+' 
'+itemArray[i].description+'</Data></Cell>\n'
                    if (checkForParameter(itemArray[i].quantity))
                        table+= '    <Cell ss:Index="3" ss:StyleID="s82"><Data ss:Type="Number">'+itemArray[i].quantity+'</Data></Cell>\n'
                    if (checkForParameter(itemArray[i].qtyShipped))
                        table+= '    <Cell ss:Index="4" ss:StyleID="s82"><Data ss:Type="Number">'+itemArray[i].qtyShipped+'</Data></Cell>\n'
                    if (checkForParameter(itemArray[i].qtyBO))
                        table+= '    <Cell ss:Index="5" ss:StyleID="s82"><Data ss:Type="Number">'+itemArray[i].qtyBO+'</Data></Cell>\n'
                    if (checkForParameter(itemArray[i].uom))
                        table += '    <Cell ss:Index="6" ss:StyleID="s82"><Data ss:Type="String">'+itemArray[i].uom+'</Data></Cell>\n'
                    if (checkForParameter(itemArray[i].rate))
                        table += '    <Cell ss:Index="7" ss:StyleID="s88"><Data ss:Type="Number">'+itemArray[i].rate+'</Data></Cell>\n'
                    if (checkForParameter(itemArray[i].amount))
                        table += '    <Cell ss:Index="8" ss:StyleID="s88"><Data ss:Type="Number">'+itemArray[i].amount+'</Data></Cell>\n'
                    table += '   </Row>'
                }
                log.debug("table", table)
                // table = '<Row ss:AutoFitHeight="0" ss:Height="60"> ' +
                //     '<Cell ss:StyleID="s82"><Data ss:Type="Number">1</Data></Cell> ' +
                //     '<Cell ss:StyleID="s94"><Data ss:Type="String">MH38: MH38MH38</Data></Cell> ' +
                //     '<Cell ss:Index="3" ss:StyleID="s82"><Data ss:Type="Number">1</Data></Cell> ' +
                //     '<Cell ss:Index="4" ss:StyleID="s82"><Data ss:Type="Number">0</Data></Cell> ' +
                //     '<Cell ss:Index="5" ss:StyleID="s82"><Data ss:Type="Number">0</Data></Cell> ' +
                //     '<Cell ss:Index="6" ss:StyleID="s82"><Data ss:Type="String">EA</Data></Cell> ' +
                //     '<Cell ss:Index="7" ss:StyleID="s84"><Data ss:Type="Number">30.47</Data></Cell> ' +
                //     '<Cell ss:Index="8" ss:StyleID="s84"><Data ss:Type="Number">30.47</Data></Cell> </Row>' +
                //
                //     '<Row ss:AutoFitHeight="0" ss:Height="60">' +
                //     ' <Cell ss:StyleID="s82"><Data ss:Type="Number">3</Data></Cell> ' +
                //     '<Cell ss:StyleID="s94"><Data ss:Type="String">MH50: SQD: 225A 240V NEMA 1 ENCLOSURE DESIGNATION: IT</Data></Cell> ' +
                //     '<Cell ss:Index="3" ss:StyleID="s82"><Data ss:Type="Number">1</Data></Cell> ' +
                //     '<Cell ss:Index="4" ss:StyleID="s82"><Data ss:Type="Number">0</Data></Cell> ' +
                //     '<Cell ss:Index="5" ss:StyleID="s82"><Data ss:Type="Number">0</Data></Cell> ' +
                //     '<Cell ss:Index="6" ss:StyleID="s82"><Data ss:Type="String">EA</Data></Cell> ' +
                //     '<Cell ss:Index="7" ss:StyleID="s84"><Data ss:Type="Number">30.47</Data></Cell> ' +
                //     '<Cell ss:Index="8" ss:StyleID="s84"><Data ss:Type="Number">30.47</Data></Cell> ' +
                //     '</Row>'

                XML = XML.replace('<!-- REPLACEWITHTABLEBODY -->', table);

                var strXmlEncoded = encode.convert({
                    string : XML,
                    inputEncoding : encode.Encoding.UTF_8,
                    outputEncoding : encode.Encoding.BASE_64
                });

                var xlsFile = file.create({
                    name : so_number+'.xls',
                    fileType : file.Type.EXCEL,
                    contents : strXmlEncoded
                });
                response.writeFile(xlsFile, false);

            } catch (e) {
                log.debug("Error@downloadExcel", e)
            }
        }

        /**
         * @description Check whether the given parameter argument has value on it or is it empty.
         * ie, To check whether a value exists in parameter
         * @author Manu Antony
         * @param {*} parameter parameter which contains/references some values
         * @param {*} parameterName name of the parameter, not mandatory
         * @returns {Boolean} true if there exist a value else false
         */
        function checkForParameter(parameter, parameterName) {
            if (parameter !== "" && parameter !== null && parameter !== undefined && parameter !== false && parameter !== "null" && parameter !== "undefined" && parameter !== " " && parameter !== 'false') {
                return true;
            } else {
                if (parameterName)
                    log.debug('Empty Value found', 'Empty Value for parameter ' + parameterName);
                return false;
            }
        }

        /**
         * @description The function for escape special characters.
         * @param unsafe
         * @return {*}
         */
        function escapeXml(param) {
            try {
                return param.replace(/[<>&'"]/g, function (c) {
                    switch (c) {
                        case '<':
                            return '&lt;';
                        case '>':
                            return '&gt;';
                        case '&':
                            return '&amp;';
                        case '\'':
                            return '&apos;';
                        case '"':
                            return '&quot;';
                    }
                });
            } catch (e) {
                log.debug("Error@escapeXml", e);
            }
        }

        const onRequest = (scriptContext) => {

            try {
                var response = scriptContext.response;
                var recId = scriptContext.request.parameters.currentRec;

                //Load the record
                var soRecord = record.load({
                    type: record.Type.SALES_ORDER,
                    id: recId,
                    isDynamic: true
                });

                //Getting the required details from the loaded record
                var so_number = soRecord.getValue({
                    fieldId: 'tranid'
                });

                //var date = soRecord.getValue({fieldId: 'trandate'});
                var date = soRecord.getText({
                    fieldId : 'custbody_esc_last_modified_date'
                });

                var address = soRecord.getValue({
                    fieldId: 'billingaddress_text'
                });
                var replacedAddress = address.replace(/\r?\n|\r/g,
                    '\\');
                var billAddressArray = replacedAddress.split("\\");
                log.debug("billAddressArray", billAddressArray)

                //var name=addressArray[0];


                var shipAddress = soRecord.getValue({
                    fieldId: 'shippingaddress_text'
                });
                var replacedShipAddress = shipAddress.replace(/\r?\n|\r/g,
                    '\\');
                var shipAddressArray = replacedShipAddress.split("\\");
                log.debug("shipAddress", shipAddressArray)

                var payTerms = soRecord.getText({fieldId: 'terms'})
                var po = soRecord.getValue({fieldId: 'otherrefnum'})
                var shipMethod = soRecord.getText({fieldId: 'shipmethod'})
                var shipDate = soRecord.getText({fieldId: 'shipdate'})
                var subTotal = soRecord.getValue({fieldId: 'subtotal'})
                var taxTotal = soRecord.getValue({fieldId: 'taxtotal'})
                var total = soRecord.getValue({fieldId: 'total'})

                //Getting the item details and insert into a Array
                var count = soRecord.getLineCount({sublistId: 'item'})

                var itemSubTotal = 0.0;
                var itemArray = new Array();
                for (var i = 0; i < count; i++) {
                    var item = new Object;
                    item.line = i
                    item.itemCode = escapeXml(soRecord.getSublistValue({
                        sublistId: 'item',
                        fieldId: 'item_display',
                        line: i
                    }));
                    item.description = escapeXml(soRecord.getSublistValue({
                        sublistId: 'item',
                        fieldId: 'description',
                        line: i
                    }))
                    item.item = escapeXml(soRecord.getSublistValue({
                        sublistId: 'item',
                        fieldId: 'item',
                        line: i
                    }))

                    item.quantity = soRecord.getSublistValue({
                        sublistId: 'item',
                        fieldId: 'quantity',
                        line: i
                    });
                    item.rate = soRecord.getSublistValue({
                        sublistId: 'item',
                        fieldId: 'rate',
                        line: i
                    });

                    item.amount = soRecord.getSublistValue({
                        sublistId: 'item',
                        fieldId: 'amount',
                        line: i
                    });
                    if (checkForParameter(item.amount))
                        item.amount = parseFloat(item.amount)

                    item.qtyShipped = soRecord.getSublistValue({
                        sublistId: 'item',
                        fieldId: 'quantityfulfilled',
                        line: i
                    })
                    item.qtyBO = soRecord.getSublistValue({
                        sublistId: 'item',
                        fieldId: 'quantitybackordered',
                        line: i
                    })
                    item.uom = soRecord.getSublistValue({
                        sublistId: 'item',
                        fieldId: 'units_display',
                        line: i
                    })

                    itemArray.push(item);
                    //itemSubTotal = itemSubTotal + item.amount;

                }
                log.debug("itemArray", itemArray)


                downloadExcel(so_number, date, payTerms, po, shipAddressArray, billAddressArray, shipMethod, shipDate, subTotal, taxTotal, total, itemArray, response);
            } catch (e) {
                log.debug('Error @onRequest', e);
            }

        }

        return {onRequest}

    });
<!--XML code -->

<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:o="urn:schemas-microsoft-com:office:office"
 xmlns:x="urn:schemas-microsoft-com:office:excel"
 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:html="http://www.w3.org/TR/REC-html40">
 <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
  <Author>JJ0152</Author>
  <LastAuthor>JJ0152</LastAuthor>
  <Created>2022-05-13T06:31:29Z</Created>
  <LastSaved>2022-05-27T09:50:45Z</LastSaved>
  <Version>16.00</Version>
 </DocumentProperties>
 <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
  <AllowPNG/>
 </OfficeDocumentSettings>
 <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
  <WindowHeight>8976</WindowHeight>
  <WindowWidth>23040</WindowWidth>
  <WindowTopX>32767</WindowTopX>
  <WindowTopY>32767</WindowTopY>
  <ProtectStructure>False</ProtectStructure>
  <ProtectWindows>False</ProtectWindows>
 </ExcelWorkbook>
 <Styles>
  <Style ss:ID="Default" ss:Name="Normal">
   <Alignment ss:Vertical="Bottom"/>
   <Borders/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/>
   <Interior/>
   <NumberFormat/>
   <Protection/>
  </Style>
  
  <Style ss:ID="s65">
   <Alignment ss:Horizontal="Right" ss:Vertical="Top" ss:WrapText="1"/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="20" ss:Color="#FF0000"/>
  </Style>
  <Style ss:ID="s66">
   <Alignment ss:Horizontal="Left" ss:Vertical="Center"/>
  </Style>
  <Style ss:ID="s73">
   <Alignment ss:Horizontal="Center" ss:Vertical="Bottom" ss:WrapText="1"/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"
    ss:Bold="1"/>
  </Style>
  <Style ss:ID="s75">
   <Alignment ss:Horizontal="Left" ss:Vertical="Center" ss:WrapText="1"/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"
    ss:Bold="1"/>
   <Interior ss:Color="#9BC2E6" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s76">
   <Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"
    ss:Bold="1"/>
   <Interior ss:Color="#9BC2E6" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s77">
   <Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"
    ss:Bold="1"/>
   <Interior ss:Color="#9BC2E6" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s79">
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"
    ss:Bold="1"/>
   <Interior ss:Color="#9BC2E6" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s80">
   <Alignment ss:Vertical="Bottom"/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"
    ss:Bold="1"/>
   <Interior ss:Color="#9BC2E6" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s81">
   <Alignment ss:Horizontal="Center" ss:Vertical="Bottom" ss:WrapText="1"/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"
    ss:Bold="1"/>
   <Interior ss:Color="#9BC2E6" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s82">
   <Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
  </Style>
  <Style ss:ID="s84">
   <Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
   <NumberFormat ss:Format="Currency"/>
  </Style>
  <Style ss:ID="s85">
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/>
   </Borders>
  </Style>
  <Style ss:ID="s87">
   <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/>
   <Borders>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/>
   </Borders>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"
    ss:Bold="1"/>
  </Style>
  <Style ss:ID="s88">
   <Alignment ss:Horizontal="Left" ss:Vertical="Center"/>
   <NumberFormat ss:Format="&quot;$&quot;#,##0.00_);[Red]\(&quot;$&quot;#,##0.00\)"/>
   <!-- <NumberFormat ss:Format="Currency"/> -->
  </Style>
  <Style ss:ID="s90">
   <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
   <Interior ss:Color="#9BC2E6" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s91">
   <Interior ss:Color="#9BC2E6" ss:Pattern="Solid"/>
   <Alignment ss:Horizontal="Right" ss:Vertical="Center"/>
   <NumberFormat ss:Format="&quot;$&quot;#,##0.00_);[Red]\(&quot;$&quot;#,##0.00\)"/>
  </Style>
  <Style ss:ID="s94">
   <Alignment ss:Vertical="Top" ss:WrapText="1"/>
  </Style>
  <Style ss:ID="s99">
   <Alignment ss:Vertical="Bottom"/>
   <Borders>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/>
   </Borders>
  </Style>
  <Style ss:ID="s100">
   <Alignment ss:Vertical="Bottom"/>
  </Style>
  <Style ss:ID="s103">
   <Alignment ss:Vertical="Top" ss:WrapText="1"/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="20" ss:Color="#000000"/>
  </Style>
  <Style ss:ID="s104">
   <Alignment ss:Horizontal="Left" ss:Vertical="Top" ss:WrapText="1"/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/>
  </Style>
  <Style ss:ID="s105">
   <Alignment ss:Horizontal="Left" ss:Vertical="Top" ss:WrapText="1"/>
   <Borders/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/>
  </Style>
  <Style ss:ID="s107">
   <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"
    ss:Bold="1"/>
  </Style>
  <Style ss:ID="s108">
   <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"
    ss:Bold="1"/>
   <Interior ss:Color="#9BC2E6" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s109">
   <Alignment ss:Horizontal="Right" ss:Vertical="Center"/>
   <NumberFormat ss:Format="&quot;$&quot;#,##0.00_);[Red]\(&quot;$&quot;#,##0.00\)"/>
   <!-- <NumberFormat ss:Format="Currency"/> -->
  </Style>
 </Styles>
 <Worksheet ss:Name="Sheet1">
  <Table ss:ExpandedColumnCount="12" ss:ExpandedRowCount="10000" x:FullColumns="1"
   x:FullRows="1" ss:DefaultRowHeight="14.55">
   <Column ss:AutoFitWidth="0" ss:Width="37.200000000000003"/>
   <Column ss:AutoFitWidth="0" ss:Width="124.80000000000001"/>
   <Column ss:AutoFitWidth="0" ss:Width="86.399999999999991"/>
   <Column ss:AutoFitWidth="0" ss:Width="79.2"/>
   <Column ss:AutoFitWidth="0" ss:Width="76.8"/>
   <Column ss:AutoFitWidth="0" ss:Width="81"/>
   <Column ss:AutoFitWidth="0" ss:Width="72.599999999999994"/>
   <Column ss:AutoFitWidth="0" ss:Width="94.2"/>
   <Row ss:AutoFitHeight="0" ss:Height="79.2">
    <Cell ss:MergeAcross="3" ss:MergeDown="1" ss:StyleID="s103"><ss:Data
      ss:Type="String" xmlns="http://www.w3.org/TR/REC-html40"><Font
       html:Color="#000000">Allied Power and Control</Font><Font html:Size="28"
       html:Color="#000000"> 
</Font><Font html:Size="12" html:Color="#000000">7235 Standard Drive
Hanover, MD 21076
USA</Font></ss:Data></Cell>
    <Cell ss:MergeAcross="3" ss:MergeDown="1" ss:StyleID="s65"><ss:Data
      ss:Type="String" xmlns="http://www.w3.org/TR/REC-html40"><Font html:Size="28"
       html:Color="#000000"> Invoice </Font><Font html:Color="#FF0000">
</Font><Font
       html:Size="16" html:Color="#000000">  <!-- REPLACEWITHTRANID --> 
 </Font><Font html:Size="11"
       html:Color="#000000"><!-- REPLACEWITHDATE --></Font></ss:Data></Cell>
    <Cell ss:MergeDown="1" ss:StyleID="s66"/>
    <Cell ss:MergeDown="1" ss:StyleID="s66"/>
    <Cell ss:MergeDown="1" ss:StyleID="s66"/>
    <Cell ss:MergeDown="1" ss:StyleID="s66"/>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="22.799999999999997"/>
   <Row ss:AutoFitHeight="0" ss:Height="110.55">
    <Cell ss:MergeAcross="3" ss:StyleID="s105"><ss:Data ss:Type="String"
      xmlns="http://www.w3.org/TR/REC-html40"><B><Font html:Color="#000000">Bill To</Font></B><Font
       html:Color="#000000">
<!-- REPLACEWITHBILLINGADDRESS --></Font></ss:Data></Cell>
    <Cell ss:MergeAcross="3" ss:StyleID="s104"><ss:Data ss:Type="String"
      xmlns="http://www.w3.org/TR/REC-html40"><B><Font html:Color="#000000">Ship To</Font></B><Font
       html:Color="#000000">
<!-- REPLACEWITHSHIPPINGADDRESS --></Font></ss:Data></Cell>
    <Cell ss:Index="12" ss:StyleID="s66"/>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="16.8">
    <Cell ss:MergeAcross="7" ss:StyleID="s73"/>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="22.200000000000003">
    <Cell ss:MergeAcross="1" ss:StyleID="s75"><Data ss:Type="String">Payment Terms</Data></Cell>
    <Cell ss:MergeAcross="1" ss:StyleID="s75"><Data ss:Type="String">Customer PO #</Data></Cell>
    <Cell ss:MergeAcross="1" ss:StyleID="s75"><Data ss:Type="String">Shipping Method </Data></Cell>
    <!-- <Cell ss:StyleID="s76"/> -->
    <Cell ss:MergeAcross="1" ss:StyleID="s75"><Data ss:Type="String">Ship Date</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="25">
    <Cell ss:MergeAcross="1" ss:StyleID="s66"><Data ss:Type="String"><!-- REPLACEWITHTERMS --></Data></Cell>
    <Cell ss:MergeAcross="1" ss:StyleID="s66"><Data ss:Type="String"><!-- REPLACEWITHPO --></Data></Cell>
    <Cell ss:MergeAcross="1" ss:StyleID="s66"><Data ss:Type="String"><!-- REPLACEWITHSHIPMETHOD --></Data></Cell>
    <Cell ss:MergeAcross="1" ss:StyleID="s66"><Data ss:Type="String"><!-- REPLACEWITHSHIPDATE --></Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0">
    <Cell ss:MergeAcross="7" ss:StyleID="s66"/>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="28.8">
    <Cell ss:StyleID="s77"><Data ss:Type="String">Line #</Data></Cell>
    <Cell ss:StyleID="s77"><Data ss:Type="String">Item/Description</Data></Cell>
    <Cell ss:StyleID="s77"><Data ss:Type="String">Qty Ordered</Data></Cell>
    <Cell ss:StyleID="s77"><Data ss:Type="String">Qty Shipped</Data></Cell>
    <Cell ss:StyleID="s77"><Data ss:Type="String">Qty BO</Data></Cell>
    <Cell ss:StyleID="s77"><Data ss:Type="String">UOM</Data></Cell>
    <Cell ss:StyleID="s77"><Data ss:Type="String">Rate</Data></Cell>
    <Cell ss:StyleID="s77"><Data ss:Type="String">Amount</Data></Cell>
   </Row>
   <!-- <Row ss:AutoFitHeight="0" ss:Height="57.45">
    <Cell ss:StyleID="s82"><Data ss:Type="Number">1</Data></Cell>
    <Cell ss:StyleID="s94"><Data ss:Type="String">H1200SNE4
1200A Series E2-E4 Solid Neutral 
Assembly MFR: SQD</Data></Cell>
    <Cell ss:StyleID="s82"><Data ss:Type="Number">1</Data></Cell>
    <Cell ss:StyleID="s82"><Data ss:Type="Number">1</Data></Cell>
    <Cell ss:StyleID="s82"><Data ss:Type="Number">0</Data></Cell>
    <Cell ss:StyleID="s82"><Data ss:Type="String">EA</Data></Cell>
    <Cell ss:StyleID="s84"><Data ss:Type="Number">684</Data></Cell>
    <Cell ss:StyleID="s84"><Data ss:Type="Number">684</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="72">
    <Cell ss:StyleID="s82"><Data ss:Type="Number">2</Data></Cell>
    <Cell ss:StyleID="s94"><Data ss:Type="String">Notes
TAG PAUL CAVANAUGH
JOB NUMBER 21-1092</Data></Cell>
   </Row> -->
   <!-- REPLACEWITHTABLEBODY -->
   <Row ss:AutoFitHeight="0" ss:Height="15">
    <Cell ss:StyleID="s85"/>
    <Cell ss:StyleID="s85"/>
    <Cell ss:StyleID="s85"/>
    <Cell ss:StyleID="s85"/>
    <Cell ss:StyleID="s85"/>
    <Cell ss:StyleID="s85"/>
    <Cell ss:StyleID="s85"/>
    <Cell ss:StyleID="s85"/>
   </Row>
   <Row ss:AutoFitHeight="0">
    <Cell ss:Index="5" ss:StyleID="s99"/>
    <Cell ss:MergeAcross="1" ss:StyleID="s87"><Data ss:Type="String">Subtotal</Data></Cell>
    <Cell ss:StyleID="s109"><Data ss:Type="Number"><!-- REPLACEWITHSUBTOTAL --></Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0">
    <Cell ss:Index="5" ss:StyleID="s100"/>
    <Cell ss:MergeAcross="1" ss:StyleID="s107"><Data ss:Type="String">Tax Total</Data></Cell>
    <Cell ss:StyleID="s109"><Data ss:Type="Number"><!-- REPLACEWITHTAXTOTAL --></Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0">
    <Cell ss:Index="6" ss:MergeAcross="1" ss:StyleID="s108"><Data ss:Type="String">Total</Data></Cell>
    <Cell ss:StyleID="s91"><Data ss:Type="Number"><!-- REPLACEWITHTOTAL --></Data></Cell>
   </Row>
  </Table>
  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>
    <Header x:Margin="0.3"/>
    <Footer x:Margin="0.3"/>
    <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
   </PageSetup>
   <Unsynced/>
   <Print>
    <ValidPrinterInfo/>
    <HorizontalResolution>600</HorizontalResolution>
    <VerticalResolution>600</VerticalResolution>
   </Print>
   <Selected/>
   <Panes>
    <Pane>
     <Number>3</Number>
     <ActiveRow>2</ActiveRow>
     <ActiveCol>10</ActiveCol>
    </Pane>
   </Panes>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
</Workbook>

Leave a comment

Your email address will not be published. Required fields are marked *