
if((select count(*) from dbo.pal_Template where templateName = 'WholesalerOrderQuoteRequestHeader') = 0)
begin

INSERT INTO [dbo].[pal_Template]
           ([templateTypeId]
           ,[templateName]
           ,[templateContent])
     VALUES
           (8
           ,'WholesalerOrderQuoteRequestHeader'
           ,'<style type="text/css">
   td {
   font-family: Calibri;
   color: #595959;
   }
   .heading {
   font-size: 22pt;
   font-family: Calibri;
   color: #595959;
   }
   .subheading{
   font-size: 14pt;
   color: #595959;
   font-family: Calibri;
   font-weight: bold;
   }
   .full {
   width: 95%;
   }
   .half {
   width: 50%;
   }
   .third {
   width: 33.3%;
   }
   .fourth {
   width: 25%;
   }
   .forty{
   width:40%;
   }
   .twenty{
   width:20%;
   }
   .thirty{
   width:30%;
   }
   .right {
   text-align: right;
   }
   .spacer {
   height: 20px;
   }
   .shim {
   height: 10px;
   }
   div {
   position: relative;
   float: left;
   }
   .mainInfo{
   font-size: 10pt;
   color: #595959;
   font-family: Calibri;
   font-weight: bold;
   }
   .subInfo{
   font-size: 9pt;
   color: #595959;
   font-family: Calibri;
   }
   .contactInfo{
   font-size: 10pt;
   color: #595959;
   font-family: Calibri;
   }
</style>
<table class="full" cellpadding="0" cellspacing="0" border="0">
   <tbody>
      <tr>
         <td class="heading">{logo}</td>
         <td class="forty"><span class="heading">QUOTE REQUEST</span>
            <br />
            <span class="contactInfo"><strong>Enquiries: </strong>{EnquiriesEmail}<br/>
            <br/></span>
         </td>
      </tr>
   </tbody>
</table>
<table>
   <tbody>
      <tr>
         <td class="spacer"></td>
      </tr>
   </tbody>
</table>
<table class="full" cellpadding="0" cellspacing="0" border="0">
   <tbody>
      <tr>
         <td class="forty">
            <table class="full" cellpadding="0" cellspacing="0" border="0">
               <tbody>
                  <tr>
                     <td class="subheading">To</td>
                  </tr>
                  <tr>
                     <td class="mainInfo">{WholesalerName}</td>
                  </tr>
                  <tr>
                     <td class="subInfo">{WholesalerAddress}</td>
                  </tr>
                  <tr>
                     <td><br/></td>
                  </tr>
                 <tr>
                     <td class="mainInfo">VAT Number:</td>
                  </tr>
                  <tr>
                     <td class="subInfo">{WholesalerVATNumber}<br/></td>
                  </tr>
                   <tr>
                     <td></td>
                  </tr>
                   <tr>
                     <td></td>
                  </tr>
               </tbody>
            </table>
         </td>
         <td class="forty">
            <table class="full" cellpadding="0" cellspacing="0" border="0">
               <tbody>
                  <tr>
                     <td class="subheading">From</td>
                  </tr>
                  <tr>
                     <td class="mainInfo">{CustomerName}</td>
                  </tr>
                  <tr>
                     <td class="subInfo">{CustomerAddress}</td>
                  </tr>
                  <tr>
                     <td><br/></td>
                  </tr>
                 <tr>
                     <td class="mainInfo">VAT Number:</td>
                  </tr>
                  <tr>
                     <td class="subInfo">{CustomerVATNumber}<br/></td>
                  </tr>
                   <tr>
                     <td></td>
                  </tr>
                   <tr>
                     <td></td>
                  </tr>
               </tbody>
            </table>
         </td>
         <td class="thirty">
            <table class="full" cellpadding="0" cellspacing="0" border="0">
               <tbody>
                  <tr>
                     <td class="mainInfo">Order Number:</td>
                  </tr>
                  <tr>
                     <td class="subInfo">{PurchaseOrderNumber}<br/></td>
                  </tr>
                  <tr>
                     <td class="mainInfo">Quote Request Date:</td>
                  </tr>
                  <tr>
                     <td class="subInfo">{QuoteRequestDate}<br/></td>
                  </tr>
                  <tr>
                     <td></td>
                  </tr>
                  <tr>
                     <td><br/></td>
                  </tr>
                  <tr>
                     <td class="mainInfo">Quote Request on behalf of:</td>
                  </tr>
                  <tr>
                     <td class="subInfo">{RetailerName}<br/></td>
                  </tr>
               </tbody>
            </table>
         </td>
      </tr>
   </tbody>
</table>');
end;

if((select count(*) from dbo.pal_Template where templateName = 'WholesalerOrderQuoteRequestBody') = 0)
begin

INSERT INTO [dbo].[pal_Template]
           ([templateTypeId]
           ,[templateName]
           ,[templateContent])
     VALUES
           (8
           ,'WholesalerOrderQuoteRequestBody'
           ,'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
   <head>
      <title>PurchaseOrder</title>
      <style type="text/css">
         td, a
         {
         font-family: Calibri;
         font-size: 11px;
         text-decoration: none;
         color: #595959;
         }
         .heading
         {
         font-size: 18px;
         font-weight: bold;
         }
         .title
         {
         font-size: 11px;
         }
         .titleAccount
         {
         font-size: 12px;
         }
         .titleDue
         {
         font-size: 16px;
         font-weight: bold;
         text-transform: uppercase;
         }
         .footer {
         position: absolute;
         bottom: 0;
         width: 100%;
         height: 50px;
         }
         .heading {
         font-size: 22pt;
         font-family: Calibri;
         color: #595959;
         }
         .mainInfo{
         font-size: 10pt;
         color: #595959;
         font-family: Calibri;
         font-weight: bold;
         }
         .subInfo{
         font-size: 9pt;
         color: #595959;
         font-family: Calibri;
         }
         .subheading{
         font-size: 14pt;
         color: #595959;
         font-family: Calibri;
         font-weight: bold;
         }
         .full {
         width: 95%;
         }
         .forty{
         width:40%;
         }
         .thirty{
         width:30%;
         }
         .twenty{
         width:20%;
         }
      </style>
   </head>
   <body class="RadEditorContentStyle">
      {ProductLines}<br />
      <table style="width: 100%;">
         <tbody>
            <tr>
               <td style="width: 60%;">
                  <br/>
                  <table style="width:100%">
                     <tr>
                        <td class="mainInfo">Quote Request Notes:</td>
                     </tr>
                     <tr>
                        <td class="subInfo">{Notes}<br/></td>
                     </tr>
                  </table>
               </td>
               <td style="width: 40%;">
                  <br/>
                  <table style="width:100%">
                     <tr>
                        <td style="width: 10%">&nbsp;</td>
                        <td style="width: 45%; border-top:solid 1px #777; text-align:right;">
                           <b>Subtotal</b>
                        </td>
                        <td style="width: 45%; border-top:solid 1px #777; text-align:right;">
                           <b>{SubtotalAmount}</b>
                        </td>
                     </tr>
                     <tr>
                        <td><br/></td>
                        <td style="border-top:solid 1px #777; text-align:right;">
                           VAT @ {VatRate}%
                        </td>
                        <td style="border-top:solid 1px #777; text-align:right;">
                           {VatAmount}
                        </td>
                     </tr>
                     <tr>
                        <td><br/></td>
                        <td style="border-top:solid 1px #777; text-align:right;">
                           <b>Total Amount ZAR</b>
                        </td>
                        <td style="border-top:solid 1px #777; text-align:right;">
                           <b>{TotalAmount}</b>
                        </td>
                     </tr>
                  </table>
               </td>
            </tr>
         </tbody>
      </table>
      <br/><br/><br/><br/><br/>
   </body>
</html>');
end;