CyberStore Ecommerce 2023 Documentation
CustomerOrderDisplay.xslt

The following is the default XML transformation file applied to a SORQRY output during Sales Order lookup.

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:TBLART="TBLART"
  xmlns:SALBRN="SALBRN" xmlns:SALARE="SALARE" xmlns:SALSLS="SALSLS">
  <xsl:template match="/">
    <HTML>
      <HEAD>
        <title>Order Lookup</title>
        <script>
          <![CDATA[    
function showvalue(sorder)
{
sor=window.open("salesordervalue.aspx?order=" + sorder + "", "orderwin", "top=100,left=100,height=" + window.screen.availHeight*0.4 + ",width=" + window.screen.availWidth * .5 + ",resizable,scrollbars")
sor.window.focus()
}
]]>
        </script>
      </HEAD>
      <BODY>
    <div class="divTable">
      <div class="divTableBody">  

        <div class="logoWrapper">
          <div class="divTableCell logo"></div>
          <div class="divTableCell title">Sales Order</div>
        </div>
        <div class="divTableRow invoiceDetails">
    <div class="divTableCell"> 
        <div class="detailRow">
            <div class="orderdisplayLabel">Order Number: </div>
            <div class="orderdisplaydetailField"> <xsl:value-of select="/SorDetail/SalesOrder" /></div>
        </div>
        <div class="detailRow">
            <div class="orderdisplayLabel">Invoice Terms: </div>
            <div class="orderdisplaydetailField"><xsl:value-of select="//TBLART:Description" /></div>
        </div>
        <div class="detailRow">
            <div class="orderdisplayLabel">Order Date: </div>
            <div class="orderdisplaydetailField"><xsl:variable name="LenCheck" select="substring(/SorDetail/OrderDate, 6, 2)" />
              <xsl:choose>
                <xsl:when test="string-length($LenCheck) = 0">
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of
                    select="concat(substring(/SorDetail/OrderDate, 6, 2), '/',substring(/SorDetail/OrderDate, 9, 2), '/',substring(/SorDetail/OrderDate, 1, 4))" />
                </xsl:otherwise>
              </xsl:choose>
            </div>
        </div>
        <div class="detailRow">
            <div class="orderdisplayLabel">Special
              Instructions: </div>
            <div class="orderdisplaydetailField"><xsl:value-of select="/SorDetail/SpecialInstrs" /></div>
        </div>
        <div class="detailRow">
            <div class="orderdisplayLabel">Customer PO: </div>
            <div class="orderdisplaydetailField"><xsl:value-of select="/SorDetail/CustomerPoNumber" /></div>
        </div>
        <div class="detailRow">
            <div class="orderdisplayLabel">Order Status: </div>
            <div class="orderdisplaydetailField"><xsl:choose>
                <xsl:when test="/SorDetail/OrderStatus[. ='0']">
                  Open Order
                </xsl:when>
                <xsl:when test="/SorDetail/OrderStatus[. ='*']">
                  Cancelled
                </xsl:when>
                <xsl:when test="/SorDetail/OrderStatus[. ='\']">
                  Cancelled
                </xsl:when>
                <xsl:when test="/SorDetail/OrderStatus[. ='1']">
                  Open order
                </xsl:when>
                <xsl:when test="/SorDetail/OrderStatus[. ='2']">
                  Open order
                </xsl:when>
                <xsl:when test="/SorDetail/OrderStatus[. ='3']">
                  Open order
                </xsl:when>
                <xsl:when test="/SorDetail/OrderStatus[. ='4']">
                  Open order
                </xsl:when>
                <xsl:when test="/SorDetail/OrderStatus[. ='8']">
                  Open order
                </xsl:when>
                <xsl:when test="/SorDetail/OrderStatus[. ='9']">
                  Complete
                </xsl:when>
                <xsl:when test="/SorDetail/OrderStatus[. ='S']">
                  Open order
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="/SorDetail/OrderStatus" />
                </xsl:otherwise>
              </xsl:choose>
          </div>
        </div>

    </div>
        <div class="divTableRow customerDetails">
          <div class="divTableCell divTableRight">
        <div class="detailRow">
            <div class="orderdisplayLabel shipToLabel"> Ship To: </div>
            <div class="orderdisplaydetailField"><xsl:value-of select="/SorDetail/CustomerName" /></div>
        </div> 
        <div class="detailRow">
            <div class="orderdisplayLabel">   </div>
            <div class="orderdisplaydetailField"><xsl:value-of select="/SorDetail/ShipAddress1" /></div>
        </div>
        <div class="detailRow">
            <div class="orderdisplayLabel">   </div>
            <div class="orderdisplaydetailField"><xsl:value-of select="/SorDetail/ShipAddress2" /></div>
        </div>
        <div class="detailRow">
            <div class="orderdisplayLabel">   </div>
            <div class="orderdisplaydetailField"><xsl:value-of select="/SorDetail/ShipAddress3" /></div>
        </div>
        <div class="detailRow">
            <div class="orderdisplayLabel">   </div>
            <div class="orderdisplaydetailField"><xsl:value-of select="/SorDetail/ShipAddress4" /></div>
        </div>
        <div class="detailRow">
            <div class="orderdisplayLabel">   </div>
            <div class="orderdisplaydetailField"><xsl:value-of select="/SorDetail/ShipAddress5" /></div>
        </div>
        <div class="detailRow">
            <div class="orderdisplayLabel">   </div>
            <div class="orderdisplaydetailField"><xsl:value-of select="/SorDetail/ShipPostalCode" /></div>
        </div>
    </div>
  </div>
  </div>
</div>




<!-- BEGIN ORDER DETAIL LIST -->

            <!-- <td colspan="5"> -->
      <div class="divTableBody"> 
              <table class="orderDisplaySubTable">

                <tr>
                  <td class="orderDisplayDetailLabel">
                    Stock Code
                  </td>
                  <td class="orderDisplayDetailLabel">
                    Description
                  </td>

                  <td class="orderDisplayDetailLabel">Qty</td>
                  <td class="orderDisplayDetailLabel"></td>

                  <td class="orderDisplayDetailLabel">
                    Ship Qty
                  </td>
                  <td class="orderDisplayDetailLabel" Title="Back order quantity">
                    B/O Qty
                  </td>
                  <td class="orderDisplayDetailLabel">
                    Price
                  </td>
                  <td class="orderDisplayDetailLabel" Title="Unit of Measure"></td>
                  <td class="orderDisplayDetailLabel">
                    Value
                  </td>
                  <td class="orderDisplayDetailLabel center" >
                    Est. Ship Date
                  </td>
                </tr>
                <xsl:for-each select="SorDetail/SalesOrderLine">
                  <tr>
                    <xsl:choose>
                      <xsl:when test="position() mod 2 = 1">
                        <xsl:attribute name="class">
                          oddRow</xsl:attribute>
                      </xsl:when>
                      <xsl:otherwise>
                        <xsl:attribute name="class">evenRow</xsl:attribute>
                      </xsl:otherwise>
                    </xsl:choose>
                    <!--   
                                            MERCHANDISE LINES
                                        -->
                    <xsl:if test="Merchandise[. !=' ']">
                      <td class="orderDisplayDetailField">
                        <xsl:if test="Merchandise/MWarehouse[. !='**']">
                          <xsl:value-of select="Merchandise/MStockCode" />
                        </xsl:if>
                        <xsl:if test="Merchandise/MWarehouse[. ='**']">
                          <xsl:value-of select="Merchandise/MStockCode" />
                        </xsl:if>
                      </td>
                      <td class="orderDisplayDetailField">
                        <xsl:value-of select="Merchandise/MStockDes" />
                      </td>

                      <td class="orderDisplayDetailField">
                        <xsl:value-of select="format-number(Merchandise/MOrderQty,'###,###,##0')" />
                      </td>
                      <td class="orderDisplayDetailField">
                        <xsl:value-of select="Merchandise/MOrderUom" />
                      </td>

                      <td class="orderDisplayDetailField">
                        <xsl:value-of select="format-number(Merchandise/MShipQty,'###,###,##0')" />
                      </td>
                      <td class="orderDisplayDetailField">
                        <xsl:value-of
                          select="format-number(Merchandise/MBackOrderQty,'###,###,##0')" />
                      </td>
                      <td class="orderDisplayDetailField">
                        <xsl:value-of select="format-number(Merchandise/MPrice,'###,###,###.00')" />
                      </td>
                      <td class="orderDisplayDetailField">
                        <xsl:value-of select="Merchandise/MPriceUom" />
                      </td>
                      <td class="orderDisplayDetailField">
                        <xsl:value-of
                          select="format-number(Merchandise/OrderLineValue,'###,###,###.00')" />
                      </td>
                      <td class="orderdisplaydetailField center" nowrap="on">
                        <!---->
                        <xsl:variable name="LenCheck3"
                          select="substring(Merchandise/MLineShipDate, 6, 2)" />
                        <xsl:choose>
                          <xsl:when test="string-length($LenCheck3) = 0">
                          </xsl:when>
                          <xsl:otherwise>
                            <xsl:value-of
                              select="concat(substring(Merchandise/MLineShipDate, 6, 2), '/',substring(Merchandise/MLineShipDate, 9, 2), '/',substring(Merchandise/MLineShipDate, 1, 4))" />
                          </xsl:otherwise>
                        </xsl:choose>
                        <!---->
                        <!--<xsl:value-of
                        select="Merchandise/MLineShipDate" />-->
                      </td>
                      <!--
                                                        SERIALS
                                            -->
                      <xsl:if test="Merchandise/Serial[. !='']">
                        <tr style="display:none" id="ser_{generate-id()}">
                          <td colspan="2" />
                          <td colspan="5">
                            <table>
                              <tr>
                                <td class="orderDisplayDetailLabel">
                                  Serial
                                </td>
                                <td class="orderDisplayDetailLabel">
                                  Lot
                                </td>
                                <td class="orderDisplayDetailLabel">
                                  Qty
                                </td>
                                <td class="orderDisplayDetailLabel">
                                  Expiry date
                                </td>
                              </tr>
                              <xsl:for-each select="Merchandise/Serial">
                                <tr>
                                  <td>
                                    <xsl:value-of select="Serial" />
                                  </td>
                                  <td>
                                    <xsl:value-of select="Lot" />
                                  </td>
                                  <td>
                                    <xsl:value-of select="StockQtyToShip" />
                                  </td>
                                  <td>
                                    <xsl:value-of select="NewExpiryDate" />
                                  </td>
                                </tr>
                              </xsl:for-each>
                            </table>
                          </td>
                        </tr>
                      </xsl:if>
                      <!--
                                                        LOTS
                                            -->
                      <xsl:if test="Merchandise/Lot[. !='']">
                        <tr style="display:none" id="lot_{generate-id()}">
                          <td colspan="2" />
                          <td colspan="5">
                            <table>
                              <tr>
                                <td>
                                  Lot number
                                </td>
                                <td>
                                  Qty
                                </td>
                                <td>
                                  Certificate
                                </td>
                                <td>
                                  Expiry date
                                </td>
                              </tr>
                              <xsl:for-each select="Merchandise/Lot">
                                <tr>
                                  <td>
                                    <xsl:value-of select="Lot" />
                                  </td>
                                  <td>
                                    <xsl:value-of select="StockQtyToShip" />
                                  </td>
                                  <td>
                                    <xsl:value-of select="Certificate" />
                                  </td>
                                  <td>
                                    <xsl:value-of select="LotExpiryDate" />
                                  </td>
                                </tr>
                              </xsl:for-each>
                            </table>
                          </td>
                        </tr>
                      </xsl:if>
                      <!--
                                                        BINS
                                            -->
                      <xsl:if test="Merchandise/Bin[. !='']">
                        <tr style="display:none" id="bin_{generate-id()}">
                          <td colspan="2" />
                          <td colspan="5">
                            <table>
                              <tr>
                                <td>
                                  bin
                                </td>
                                <td>
                                  Lot number
                                </td>
                                <td>
                                  Quantity
                                </td>
                              </tr>
                              <xsl:for-each select="Merchandise/Bin">
                                <tr>
                                  <td>
                                    <xsl:value-of select="Bin" />
                                  </td>
                                  <td>
                                    <xsl:value-of select="Lot" />
                                  </td>
                                  <td>
                                    <xsl:value-of select="StockQtyToShip" />
                                  </td>
                                </tr>
                              </xsl:for-each>
                            </table>
                          </td>
                        </tr>
                      </xsl:if>
                    </xsl:if>
                    <!-- 
                                                FREIGHT LINES 
                                        -->
                    <xsl:if test="Freight[. !=' ']">
                      <td class="orderDisplayDetailField">
                        {Freight}
                      </td>
                      <td class="orderDisplayDetailField" colspan="7">
                        <xsl:value-of select="Freight/NComment" />
                      </td>
                      <td class="orderDisplayDetailField">
                        <xsl:value-of select="Freight/NMscChargeValue" />
                      </td>
                      <td>
                      </td>


                    </xsl:if>
                    <!-- 
                                                MISC CHARGE LINES
                                        -->
                    <xsl:if test="MiscCharge[. !=' ']">
                      <td class="orderDisplayDetailField">
                        {Misc charge}
                      </td>
                      <td class="orderDisplayDetailField" colspan="7">
                        <xsl:value-of select="MiscCharge/NComment" />
                      </td>
                      <td class="orderDisplayDetailField">
                        <xsl:value-of select="MiscCharge/NMscChargeValue" />
                      </td>

                    </xsl:if>
                    <!-- 
                                                COMMENT LINES 
                                        -->
                    <xsl:if test="CommentLine[. !=' ']">
                      <td class="orderDisplayDetailField" colspan="10">
                        <xsl:value-of select="CommentLine/NComment" />
                      </td>
                    </xsl:if>
                  </tr>
                </xsl:for-each>
              </table>
            </div>
<!--             </td>
          </tr>
        </table> -->

</div>
      </BODY>
    </HTML>
  </xsl:template>
</xsl:stylesheet>