Error executing template "/Designs/TWG/nolayout/Paragraph/ViewPdf.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_8ee7b4dbdfc846ff9e11de74e427c4a8.Execute() in W:\Websites-9.6\Solutions\files\Templates\Designs\TWG\nolayout\Paragraph\ViewPdf.cshtml:line 165
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 <html> 2 @using System.Web 3 @using Apac.Twg 4 @using Apac.Twg.DTO 5 @using System.Globalization 6 7 8 <head> 9 <title>@Translate("Order Detail PDF", "Order Detail PDF") </title> 10 <meta charset="utf-8"> 11 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> 12 <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous"> 13 14 <style type="text/css"> 15 16 .pdfWdith { 17 word-break: break-word; 18 } 19 20 body { 21 margin: auto; 22 padding: auto; 23 font-family: AGaramondProRegular; 24 } 25 26 table { 27 border: none; 28 } 29 30 th { 31 font-family: FuturaMedium; 32 text-align: left; 33 font-weight: 100; 34 font-size: 13px; 35 } 36 37 th, td { 38 min-height: 18px; 39 } 40 41 p { 42 font-size: 14px; 43 min-height: 18px; 44 line-height: 18px; 45 margin: 1px 0; 46 } 47 48 label { 49 font-family: FuturaMedium; 50 font-size: 14px; 51 } 52 53 @@media print { 54 #pdf-button { 55 display: none; 56 } 57 } 58 59 @@page { 60 size: A4 potrait 61 } 62 63 #pdf-button:hover { 64 color: #FEE356 !important; 65 text-shadow: 0px 0px 15px #fff; 66 } 67 68 .tdright { 69 float: right; 70 } 71 72 .unitPriceTH { 73 text-align: left; 74 } 75 76 .order-view-detail table tr td:nth-child(4) { 77 text-align: left; 78 } 79 </style> 80 81 </head> 82 83 @{ 84 85 86 string languageIDSQL = "SELECT AREAITEMID FROM Area where AreaID=" + GetGlobalValue("Global:Area.ID"); 87 string id = System.Web.HttpContext.Current.Request["orderid"]; 88 string pdfname = id + ".pdf"; 89 var order = Dynamicweb.Ecommerce.Orders.Order.GetOrderById(id); 90 string areaItemID = "1"; 91 using (System.Data.IDataReader SqlReader = Dynamicweb.Data.Database.CreateDataReader(languageIDSQL)) 92 { 93 while (SqlReader.Read()) 94 { 95 96 areaItemID = SqlReader["AREAITEMID"].ToString(); 97 } 98 } 99 100 101 string sqlString2 = "SELECT Company_Name, Address_1, Address_2, Country, Postal_Code, Phone_Number, Fax, CoRegNo, GSTRegNo FROM ItemType_TWGWebsiteSetting Where ID=" + areaItemID; 102 string Company_Name = ""; 103 string Address_1 = ""; 104 string Address_2 = ""; 105 string Country = ""; 106 string Postal_Code = ""; 107 string Phone_Number = ""; 108 string Fax = ""; 109 string CoRegNo = ""; 110 string GSTRegNo = ""; 111 using (System.Data.IDataReader myImageReader = Dynamicweb.Data.Database.CreateDataReader(sqlString2)) 112 { 113 while (myImageReader.Read()) 114 { 115 116 Company_Name = myImageReader["Company_Name"].ToString(); 117 Address_1 = myImageReader["Address_1"].ToString(); 118 Address_2 = myImageReader["Address_2"].ToString(); 119 Country = myImageReader["Country"].ToString(); 120 Postal_Code = myImageReader["Postal_Code"].ToString(); 121 Phone_Number = myImageReader["Phone_Number"].ToString(); 122 Fax = myImageReader["Fax"].ToString(); 123 CoRegNo = myImageReader["CoRegNo"].ToString(); 124 GSTRegNo = myImageReader["GSTRegNo"].ToString(); 125 } 126 } 127 128 string currentDomain = HttpContext.Current.Request.Url.Host; 129 130 string logoimage = ""; 131 132 logoimage = "https://" + currentDomain + "/Files/Images/TWG-Tea/Logo-for-DW-(Tax-Invoice).png"; 133 134 135 //OrderFields 136 var deliverydate = ""; 137 var invoiceDate = ""; 138 var invoiceNumber = ""; 139 var shippingRefNum = ""; 140 var SelfCollectionLocation = ""; 141 var SelfCollectionDate = ""; 142 var SelfCollectionTime = ""; 143 var DeliveryTime = ""; 144 var DeliveryInstructions = ""; 145 var ParcelSize = ""; 146 var ParcelVolume = ""; 147 var ParcelWeight = ""; 148 var PersonalisedMessage = ""; 149 var ToPersonalisedMessage = ""; 150 var FromPersonalisedMessage = ""; 151 152 var UnitPrice = ""; 153 var Price = ""; 154 155 string url = "https://" + HttpContext.Current.Request.Url.Host; 156 string giftimg = "Files/Images/TWG-Tea/gift-icon.png"; 157 158 159 var ShippingCountry = ""; 160 var ShippingRef = ""; 161 162 var RefFlag = "false"; 163 var isPickup = "false"; 164 var showFlag = "true"; 165 foreach (var olsc in order.OrderLines) 166 { 167 foreach (var pfv in olsc.Product.ProductFieldValues) 168 { 169 if (pfv.ProductField.SystemName.Equals("ItemClassification")) 170 { 171 if (pfv.Value != DBNull.Value) 172 { 173 var self = (string)pfv.Value; 174 if (!string.IsNullOrEmpty(self) && self.Contains("self collection")) 175 { 176 isPickup = "true"; 177 } 178 } 179 180 } 181 } 182 } 183 184 185 ShippingCountry = order.DeliveryCountry; 186 if (!string.IsNullOrEmpty(order.TrackTraceParameters)) 187 { 188 shippingRefNum = order.TrackTraceParameters.Split(',')[0]; 189 } 190 191 foreach (var ofv in order.OrderFieldValues) 192 { 193 if (ofv.OrderField.SystemName.Equals("DHLTrackNumber")) 194 { 195 if (!string.IsNullOrEmpty(ofv.Value.ToString())) 196 { 197 shippingRefNum = ofv.Value.ToString(); 198 } 199 } 200 201 if (ofv.OrderField.SystemName.Equals("DeliveryDate")) 202 { 203 if (!string.IsNullOrEmpty(ofv.Value.ToString()) && ofv.Value.ToString() != ",") 204 { 205 deliverydate = Convert.ToDateTime(ofv.Value.ToString()).ToString("yyyy/MM/dd"); 206 } 207 } 208 209 if (ofv.OrderField.SystemName.Equals("InvoiceDate")) 210 { 211 if (!string.IsNullOrEmpty(ofv.Value.ToString())) 212 { 213 invoiceDate = ofv.Value.ToString(); 214 } 215 } 216 217 if (ofv.OrderField.SystemName.Equals("InvoiceNumber")) 218 { 219 if (!string.IsNullOrEmpty(ofv.Value.ToString())) 220 { 221 invoiceNumber = ofv.Value.ToString(); 222 } 223 } 224 225 if (ofv.OrderField.SystemName.Equals("SelfCollectionLocation")) 226 { 227 if (!string.IsNullOrEmpty(ofv.Value.ToString())) 228 { 229 SelfCollectionLocation = ofv.Value.ToString(); 230 } 231 } 232 233 if (ofv.OrderField.SystemName.Equals("SelfCollectionDate")) 234 { 235 if (!string.IsNullOrEmpty(ofv.Value.ToString()) && ofv.Value.ToString() != ",") 236 { 237 SelfCollectionDate = Convert.ToDateTime(ofv.Value.ToString()).ToString("yyyy-MM-dd"); 238 } 239 } 240 241 @*if(ofv.OrderField.SystemName.Equals("SelfCollectionTime")) 242 { 243 if(!string.IsNullOrEmpty(ofv.Value.ToString())) 244 { 245 SelfCollectionTime = ofv.Value.ToString(); 246 } 247 } 248 *@ 249 if (ofv.OrderField.SystemName.Equals("DeliveryTime")) 250 { 251 if (!string.IsNullOrEmpty(ofv.Value.ToString())) 252 { 253 DeliveryTime = ofv.Value.ToString(); 254 } 255 } 256 257 if (ofv.OrderField.SystemName.Equals("DeliveryInstructions")) 258 { 259 if (!string.IsNullOrEmpty(ofv.Value.ToString())) 260 { 261 DeliveryInstructions = ofv.Value.ToString(); 262 } 263 } 264 265 if (ofv.OrderField.SystemName.Equals("ParcelSize")) 266 { 267 if (!string.IsNullOrEmpty(ofv.Value.ToString())) 268 { 269 ParcelSize = ofv.Value.ToString(); 270 } 271 } 272 273 if (ofv.OrderField.SystemName.Equals("ParcelVolume")) 274 { 275 if (!string.IsNullOrEmpty(ofv.Value.ToString())) 276 { 277 ParcelVolume = ofv.Value.ToString(); 278 } 279 } 280 281 if (ofv.OrderField.SystemName.Equals("ParcelWeight")) 282 { 283 if (!string.IsNullOrEmpty(ofv.Value.ToString())) 284 { 285 ParcelWeight = ofv.Value.ToString(); 286 } 287 } 288 289 if (ofv.OrderField.SystemName.Equals("PersonalisedMessage")) 290 { 291 if (!string.IsNullOrEmpty(ofv.Value.ToString())) 292 { 293 PersonalisedMessage = ofv.Value.ToString(); 294 } 295 } 296 297 if (ofv.OrderField.SystemName.Equals("ToPersonalisedMessage")) 298 { 299 if (!string.IsNullOrEmpty(ofv.Value.ToString())) 300 { 301 ToPersonalisedMessage = ofv.Value.ToString(); 302 } 303 } 304 305 if (ofv.OrderField.SystemName.Equals("FromPersonalisedMessage")) 306 { 307 if (!string.IsNullOrEmpty(ofv.Value.ToString())) 308 { 309 FromPersonalisedMessage = ofv.Value.ToString(); 310 } 311 } 312 } 313 314 if (!string.IsNullOrWhiteSpace(shippingRefNum) && ShippingCountry.ToUpper() != "SINGAPORE") 315 { 316 RefFlag = "true"; 317 showFlag = "false"; 318 } 319 var selfCollectionOutletName = ""; 320 var selfCollectionOutletAddress = ""; 321 var selfCollectionOutletOpeningHour = ""; 322 var selfCollectionOutletPhone = ""; 323 ////////////////////////////////////start outletLocation information//////////////////////////////////////// 324 if (!String.IsNullOrEmpty(SelfCollectionLocation) && SelfCollectionLocation != ",") 325 { 326 //var sqlOutLetInfo="SELECT AccessUserName,AccessUserAddress,AccessUser_Opening_Hour,AccessUserPhone FROM Accessuser WHERE AccessUserGroups='@1037@@1053@' AND AccessUserName='"+SelfCollectionLocation+"'"; 327 var sqlOutLetInfo = "SELECT AccessUserName,AccessUserAddress,AccessUser_Opening_Hour,AccessUserPhone FROM Accessuser WHERE AccessUserGroups LIKE '%@1037@%' AND AccessUserName='" + SelfCollectionLocation + "'"; 328 System.Data.IDataReader myReader4 = Dynamicweb.Data.Database.CreateDataReader(sqlOutLetInfo); 329 while (myReader4.Read()) 330 { 331 332 selfCollectionOutletName = myReader4["AccessUserName"].ToString(); 333 selfCollectionOutletAddress = myReader4["AccessUserAddress"].ToString(); 334 selfCollectionOutletOpeningHour = myReader4["AccessUser_Opening_Hour"].ToString(); 335 selfCollectionOutletPhone = myReader4["AccessUserPhone"].ToString(); 336 337 } 338 } 339 //////////////////////////////////////end outletLocation information/////////////////////////////////////////// 340 } 341 342 <style> 343 344 @@font-face { 345 font-family: 'FuturaMedium'; 346 src: url('/Files/Templates/Designs/TWG/fonts/FuturaMedium.eot'); 347 src: url('/Files/Templates/Designs/TWG/fonts/FuturaMedium.eot') format('embedded-opentype'), url('/Files/Templates/Designs/TWG/fonts/FuturaMedium.woff2') format('woff2'), url('/Files/Templates/Designs/TWG/fonts/FuturaMedium.woff') format('woff'), url('/Files/Templates/Designs/TWG/fonts/FuturaMedium.ttf') format('truetype'), url('/Files/Templates/Designs/TWG/fonts/FuturaMedium.svg#FuturaMedium') format('svg'); 348 } 349 350 @@font-face { 351 font-family: 'AGaramondProRegular'; 352 src: url('/Files/Templates/Designs/TWG/fonts/agaramondpro-regular-webfont.eot?#iefix') format('embedded-opentype'), url('/Files/Templates/Designs/TWG/fonts/agaramondpro-regular-webfont.woff') format('woff'), url('/Files/Templates/Designs/TWG/fonts/agaramondpro-regular-webfont.ttf') format('truetype'), url('/Files/Templates/Designs/TWG/fonts/agaramondpro-regular-webfont.svg#agaramondpro-regular') format('svg'); 353 font-weight: normal; 354 font-style: normal; 355 } 356 357 @@font-face { 358 font-family: 'FM'; 359 src: url('/Files/Templates/Designs/TWG/fonts/FuturaMedium.eot'); 360 src: url('/Files/Templates/Designs/TWG/fonts/FuturaMedium.eot') format('embedded-opentype'), url('/Files/Templates/Designs/TWG/fonts/FuturaMedium.woff2') format('woff2'), url('/Files/Templates/Designs/TWG/fonts/FuturaMedium.woff') format('woff'), url('/Files/Templates/Designs/TWG/fonts/FuturaMedium.ttf') format('truetype'), url('/Files/Templates/Designs/TWG/fonts/FuturaMedium.svg#FuturaMedium') format('svg'); 361 } 362 363 @@font-face { 364 font-family: agp-r; 365 src: url('/Files/Templates/Designs/TWG/fonts/agaramondpro-regular-webfont.eot?#iefix') format('embedded-opentype'), url('/Files/Templates/Designs/TWG/fonts/agaramondpro-regular-webfont.woff') format('woff'), url('/Files/Templates/Designs/TWG/fonts/agaramondpro-regular-webfont.ttf') format('truetype'), url('/Files/Templates/Designs/TWG/fonts/agaramondpro-regular-webfont.svg#agaramondpro-regular') format('svg'); 366 font-weight: normal; 367 font-style: normal; 368 } 369 </style> 370 371 <body> 372 <script> 373 // print 374 $('[data-print]').click(function () { 375 var $target = $($(this).data('print')) 376 var title = $target.data('print-title') 377 378 $target.printThis({ 379 //pageTitle: false, 380 header: '<div class="text-center">' + title + '</div><br><br>' 381 }) 382 }) 383 </script> 384 <!-- //////////////////////////////////////////////////////////////////// --> 385 <div style="position: fixed; top:0; width:100%; background:rgba(0,0,0,0.5);"> 386 <a href='/default.aspx?id=@GetGlobalValue("Global:Page.ID")&orderid=@id&pdf=true&filename=@pdfname'><i id="pdf-button" class="fa fa-download" type="button" @*onclick="window.print()"*@ tool-tip="Download PDF" style="float:right; padding: 10px 10px; color: #fff; font-size: 20px; cursor:pointer; margin-right: 30px;"></i></a> 387 </div> 388 389 <table id='printarea' width="100%"> 390 <tr> 391 <td align="center" style="background: #00000040;"> 392 <div style="width: 900px; background: #fff; box-shadow: 0px 0px 30px 20px #00000060; margin-top: 30px; margin-bottom: 30px; "> 393 <table width="800px" align="center" style="padding-top: 20px; font-family: initial !important;"> 394 <tr> 395 <td> 396 <table width="100%"> 397 <tr> 398 <td> 399 <table width="100%"> 400 <colgroup> 401 <col width="20%"> 402 <col width="30%"> 403 <col width="50%"> 404 </colgroup> 405 <tr> 406 <td> 407 <img src="@logoimage" alt="TWG Tea Logo" align="center" width="80%" style="padding: 20px 10px 20px 0px;"> 408 </td> 409 <td align="center" valign="top" style="padding: 15px 10px 0 10px;"> 410 @if (Dynamicweb.Ecommerce.Orders.Order.GetOrderById(System.Web.HttpContext.Current.Request["orderid"]).DeliveryCountry.ToUpper() == "Singapore".ToUpper()) 411 { 412 <p style="font-family: FuturaMedium; font-size: 1.17em; font-weight: bold;">RECEIPT</p> 413 } 414 else 415 { 416 <p style="font-family: FuturaMedium; font-size: 1.17em; font-weight: bold;">TAX INVOICE</p> 417 418 } 419 </td> 420 <td style="padding: 10px 0 0 2px; font-family: AGaramondProRegular !important; font-weight: 500 !important;"> 421 <p>@Company_Name</p> 422 <p>@Address_1, @Address_2</p> 423 <p>@Country @Postal_Code</p> 424 <p>Tel: @Phone_Number | Fax: @Fax</p> 425 <p>Co. Reg. No: @CoRegNo</p> 426 <p>GST Reg. No: @GSTRegNo</p> 427 </td> 428 </tr> 429 </table> 430 </td> 431 </tr> 432 </table> 433 </td> 434 </tr> 435 <tr> 436 <td style="padding: 0 8px;"><hr style="border: 1px solid #000;"></td> 437 </tr> 438 <tr> 439 <td align="center" valign="top"> 440 <table style="width: 100%;"> 441 <colgroup> 442 <col width="50%"> 443 <col width="50%"> 444 </colgroup> 445 <tr> 446 <td> 447 <table width="100%"> 448 <colgroup> 449 <col width="60%"> 450 <col width="40%"> 451 </colgroup> 452 <tr> 453 <td> 454 <label>@Translate("DATE OF ORDER:", "DATE OF ORDER:")</label> 455 </td> 456 <td> 457 <!--<p>@order.CompletedDate</p>--> 458 @if (!string.IsNullOrEmpty(order.CompletedDate.ToString()) && order.CompletedDate.ToString() != ",") 459 { 460 <p>@Convert.ToDateTime(order.CompletedDate).ToString("yyyy/MM/dd")</p> 461 } 462 463 </td> 464 </tr> 465 <tr> 466 <td> 467 <label>@Translate("INVOICE DATE:", "INVOICE DATE:")</label> 468 </td> 469 <td> 470 <p>@invoiceDate</p> 471 </td> 472 </tr> 473 <tr> 474 <td> 475 <label>@Translate("INVOICE", "INVOICE") #</label> 476 </td> 477 <td> 478 <p>@invoiceNumber</p> 479 </td> 480 </tr> 481 <tr> 482 <td> 483 <label>@Translate("PAYPAL TRANSACTION ID", "PAYPAL TRANSACTION ID")</label> 484 </td> 485 <td> 486 <p>@order.TransactionNumber</p> 487 </td> 488 </tr> 489 </table> 490 </td> 491 <td valign="top"> 492 <table width="100%"> 493 <colgroup> 494 <col width="50%"> 495 <col width="50%"> 496 </colgroup> 497 <tr> 498 <td> 499 <label>@Translate("TWG TEA ORDER", "TWG TEA ORDER") #</label> 500 </td> 501 <td> 502 <p>@id</p> 503 </td> 504 </tr> 505 @if (RefFlag == "true") 506 { 507 <tr> 508 <td> 509 <label>@Translate("SHIPPING", "SHIPPING") REF. #</label> 510 </td> 511 <td> 512 <p>@shippingRefNum</p> 513 </td> 514 </tr> 515 <tr><td style="height: 20px;"></td><td></td></tr> 516 <tr><td style="height: 20px;"></td><td></td></tr> 517 } 518 else if (isPickup == "true") 519 { 520 <tr> 521 <td valign="top"> 522 <label>@Translate("PICKUP LOCATION", "PICKUP LOCATION")</label> 523 </td> 524 <td> 525 <p>@SelfCollectionLocation</p> 526 </td> 527 </tr> 528 <tr> 529 <td> 530 <label>@Translate("PICKUP DATE", "PICKUP DATE")</label> 531 </td> 532 <td> 533 <p>@SelfCollectionDate</p> 534 </td> 535 </tr> 536 <!--<tr> 537 <td> 538 <label>PICKUP TIME</label> 539 </td> 540 <td> 541 <p>@SelfCollectionTime</p> 542 </td> 543 </tr>--> 544 <tr><td style="height: 20px;"></td><td></td></tr> 545 } 546 else 547 { 548 <tr><td style="height: 20px;"></td><td></td></tr> 549 <tr><td style="height: 20px;"></td><td></td></tr> 550 <tr><td style="height: 20px;"></td><td></td></tr> 551 } 552 </table> 553 </td> 554 </tr> 555 </table> 556 </td> 557 </tr> 558 <tr> 559 <td style="padding: 0 8px;"><hr style="border: 1px solid #000;"></td> 560 </tr> 561 <tr> 562 <td valign="top"> 563 <table width="100%"> 564 <tr> 565 <td valign="top"> 566 <table width="100%"> 567 <colgroup> 568 <col width="50%"> 569 <col width="50%"> 570 </colgroup> 571 <tr> 572 <td> 573 <table> 574 <tr> 575 <td style="padding: 10px 0;"> 576 <label>@Translate("Billing Address", "Billing Address")</label> 577 </td> 578 </tr> 579 <tr> 580 <td> 581 <p style="text-transform: capitalize;">@order.CustomerTitle.ToLower(). @order.CustomerName.ToLower()</p> 582 </td> 583 </tr> 584 <tr> 585 <td> 586 <p style="text-transform: capitalize;">@order.CustomerAddress.ToLower() @order.CustomerAddress2.ToLower()</p> 587 </td> 588 </tr> 589 <tr> 590 <td> 591 <p style="text-transform: capitalize;">@order.CustomerCity.ToLower(),@order.CustomerRegion.ToLower() @order.CustomerZip</p> 592 </td> 593 </tr> 594 <tr> 595 <td> 596 <p style="text-transform: capitalize;">@order.CustomerCountry.ToLower()</p> 597 </td> 598 </tr> 599 <tr> 600 <td> 601 <p>@order.CustomerCell</p> 602 </td> 603 </tr> 604 </table> 605 </td> 606 <td> 607 @if (isPickup == "true") 608 { 609 <table> 610 <tr> 611 <td style="padding: 10px 0;"> 612 <label>@Translate("Self Collection Location", "Self Collection Location")</label> 613 </td> 614 </tr> 615 <tr> 616 <td> 617 <p style="text-transform: capitalize;">@selfCollectionOutletName</p> 618 </td> 619 </tr> 620 <tr> 621 <td> 622 <p style="text-transform: capitalize;">@selfCollectionOutletAddress</p> 623 </td> 624 </tr> 625 <tr> 626 <td> 627 <p style="text-transform: capitalize;">@selfCollectionOutletOpeningHour</p> 628 </td> 629 </tr> 630 631 <tr> 632 <td> 633 <p>@selfCollectionOutletPhone</p> 634 </td> 635 </tr> 636 637 </table> 638 } 639 else 640 { 641 <table> 642 <tr> 643 <td style="padding: 10px 0;"> 644 <label>@Translate("Shipping Address", "Shipping Address")</label> 645 </td> 646 </tr> 647 <tr> 648 <td> 649 <p style="text-transform: capitalize;">@order.DeliveryTitle.ToLower() @order.DeliveryFirstName.ToLower() @order.DeliverySurname.ToLower()</p> 650 </td> 651 </tr> 652 <tr> 653 <td> 654 <p style="text-transform: capitalize;">@order.DeliveryAddress.ToLower() @order.DeliveryAddress2.ToLower()</p> 655 </td> 656 </tr> 657 <tr> 658 <td> 659 <p style="text-transform: capitalize;">@order.DeliveryCity.ToLower(),@order.DeliveryRegion.ToLower() @order.DeliveryZip</p> 660 </td> 661 </tr> 662 <tr> 663 <td> 664 <p style="text-transform: capitalize;">@order.DeliveryCountry.ToLower()</p> 665 </td> 666 </tr> 667 <tr> 668 <td> 669 <p>@order.DeliveryCell</p> 670 </td> 671 </tr> 672 </table> 673 } 674 </td> 675 </tr> 676 </table> 677 </td> 678 </tr> 679 </table> 680 </td> 681 </tr> 682 <tr> 683 <td style="padding: 0 8px;"><hr style="border: 1px solid #000;"></td> 684 </tr> 685 <tr> 686 <td valign="top"> 687 <table width="100%"> 688 <colgroup> 689 <col width="50%"> 690 <col width="50%"> 691 </colgroup> 692 <tr> 693 @if (ShippingCountry.ToUpper() == "SINGAPORE") 694 { 695 <td valign="top"> 696 <table width="100%"> 697 <tr> 698 <td style="padding: 10px 3px;"> 699 <label>@Translate("RECIPIENT INFO", "RECIPIENT INFO")</label> 700 </td> 701 </tr> 702 <tr> 703 <td style="padding: 0;"> 704 <table width="100%"> 705 <colgroup> 706 <col width="50%"> 707 <col width="50%"> 708 </colgroup> 709 <tr> 710 <td> 711 @Translate("Date", "Date"): @deliverydate 712 </td> 713 <td> 714 @Translate("Parcel Size", "Parcel Size"): @ParcelSize 715 </td> 716 </tr> 717 <tr> 718 <td> 719 @Translate("Time", "Time"): @DeliveryTime 720 </td> 721 <td> 722 @Translate("Parcel Volume", "Parcel Volume") (cm<sup>3</sup>): @ParcelVolume 723 </td> 724 </tr> 725 <tr> 726 <td> 727 Instruction:<br /><p> @DeliveryInstructions </p> 728 </td> 729 <td valign="top"> 730 @Translate("Parcel Weight", "Parcel Weight") (kg): @ParcelWeight 731 </td> 732 </tr> 733 </table> 734 </td> 735 </tr> 736 </table> 737 </td> 738 } 739 <td valign="top"> 740 <table> 741 <tr> 742 <td style="padding: 0;"> 743 <table style="padding-left: 0 !important;"> 744 <tr><td colspan="2" style="padding: 10px 0;"><label>@Translate("GIFT MESSAGE", "GIFT MESSAGE")</label></td></tr> 745 <tr> 746 <td width="20%">@Translate("To:", "To:")</td> 747 <td width="80%" class="pdfWdith">@ToPersonalisedMessage</td> 748 </tr> 749 <tr> 750 <td valign="top">@Translate("Message:", "Message:")</td> 751 <td class="pdfWdith"><p>@PersonalisedMessage</p></td> 752 </tr> 753 <tr> 754 <td>@Translate("From:", "From:")</td> 755 <td class="pdfWidth">@FromPersonalisedMessage</td> 756 </tr> 757 </table> 758 </td> 759 </tr> 760 </table> 761 </td> 762 </tr> 763 </table> 764 </td> 765 </tr> 766 <tr> 767 <td style="padding: 0 8px;"><hr style="border: 2px solid #000;"></td> 768 </tr> 769 <tr> 770 <td> 771 <table width="100%"> 772 <tr> 773 <td> 774 <table class="order-view-detail" width="100%"> 775 <colgroup> 776 <col width="17%"> 777 <col width="3%"> 778 <col width="30%"> 779 <col width="13%"> 780 <col width="20%"> 781 <col width="20%"> 782 </colgroup> 783 <tr> 784 <th>@Translate("PRODUCT CODE", "PRODUCT CODE")</th> 785 <th class="gift_left"></th> 786 <th class="gift_right">@Translate("PRODUCT DESCRIPTION", "PRODUCT DESCRIPTION")</th> 787 <th>QUANTITY</th> 788 <th class="unitPriceTH">@Translate("UNIT PRICE", "UNIT PRICE") @order.Currency.Symbol (@order.Currency.Code)</th> 789 <th class="gift_right" style="text-align: right;">@Translate("AMOUNT", "AMOUNT") @order.Currency.Symbol (@order.Currency.Code)</th> 790 </tr> 791 <tr> 792 <td colspan="6"><hr style="border: 1px solid #000;"></td> 793 </tr> 794 @{ 795 var list = new List<String>(); 796 } 797 @foreach (var ol1 in order.OrderLines) 798 { 799 string sqlImage = "SELECT * FROM EcomOrderLines WHERE OrderLineParentLineId='" + ol1.Id + "'"; 800 using (System.Data.IDataReader myImageReader = Dynamicweb.Data.Database.CreateDataReader(sqlImage.ToString())) 801 { 802 while (myImageReader.Read()) 803 { 804 var string1 = myImageReader["OrderLineParentLineId"].ToString() + "|" + myImageReader["OrderLinePriceWithoutVAT"].ToString(); 805 806 list.Add(string1); 807 808 } 809 } 810 811 } 812 @foreach (var ol in order.OrderLines) 813 { 814 815 var gift = ""; 816 var ParentProductId = ""; 817 var Quantity = ""; 818 string mixmatch = ""; 819 string looseTeaProduct = ""; 820 foreach (var olfv in ol.OrderLineFieldValues) 821 { 822 if (olfv.OrderLineFieldSystemName.Equals("Gift")) 823 { 824 //if(!string.IsNullOrEmpty(olfv.Value)) 825 if (olfv.Value == "checked") 826 { 827 gift = "true"; 828 } 829 } 830 } 831 832 var rewardOrDiscount = ""; 833 if (ol.Type == "1") 834 { 835 if (!ol.DiscountId.Contains("SALESDISCNT")) 836 { 837 var sqlString = "SELECT DiscountDescription FROM EcomDiscount WHERE DiscountId='" + ol.DiscountId + "'"; 838 using (System.Data.IDataReader myImageReader = Dynamicweb.Data.Database.CreateDataReader(sqlString)) 839 { 840 while (myImageReader.Read()) 841 { 842 843 rewardOrDiscount = myImageReader["DiscountDescription"].ToString(); 844 } 845 } 846 } 847 } 848 849 if (!string.IsNullOrWhiteSpace(ol.ProductId.ToString())) 850 { 851 852 UnitPrice = string.Format("{0:#.00}", ol.UnitPrice.Price); 853 Price = string.Format("{0:#.00}", ol.Price.Price); 854 Quantity = ol.Quantity + "x"; 855 856 ParentProductId = "false"; 857 double relatedPriceSum = 0; 858 859 foreach (var Olf in ol.OrderLineFieldValues) 860 { 861 if (Olf.OrderLineFieldSystemName.Equals("ParentProductId")) 862 { 863 if (!string.IsNullOrEmpty(Olf.Value)) 864 { 865 ParentProductId = "true"; 866 } 867 } 868 else if (Olf.OrderLineFieldSystemName == "BoxNumber" && !string.IsNullOrWhiteSpace(Olf.Value)) 869 { 870 mixmatch = "M"; 871 foreach (var oll in order.OrderLines) 872 { 873 foreach (var relOlf in oll.OrderLineFieldValues) 874 { 875 if (relOlf.OrderLineFieldSystemName == "ParentProductId") 876 { 877 if (relOlf.Value == ol.ProductId + ol.ProductVariantId + "_" + Olf.Value) 878 { 879 880 relatedPriceSum += oll.Price.Price; 881 } 882 } 883 } 884 } 885 886 } 887 else if (Olf.OrderLineFieldSystemName == "LooseTeaParentNo" && !string.IsNullOrWhiteSpace(Olf.Value)) 888 { 889 looseTeaProduct = Olf.Value; 890 foreach (var oll in order.OrderLines) 891 { 892 foreach (var relOlf in oll.OrderLineFieldValues) 893 { 894 if (relOlf.OrderLineFieldSystemName == "ParentProductId") 895 { 896 if (relOlf.Value == ol.ProductId + ol.ProductVariantId + "_" + Olf.Value) 897 { 898 899 relatedPriceSum += oll.Price.Price; 900 } 901 } 902 } 903 } 904 } 905 } 906 if (ParentProductId != "true") 907 { 908 if (looseTeaProduct != "") 909 { 910 var totprice = ol.Price.Price + relatedPriceSum; 911 <tr> 912 913 <td valign="top">@ol.ProductNumber</td> 914 <td class="gift_left" valign="top"> 915 @if (gift == "true") 916 { 917 918 <img src="@url/@giftimg" style="width: 14px;" alt="(Gifted)"> 919 } 920 </td> 921 @if (totprice.ToString() != "0") 922 { 923 <td class="gift_right" valign="top">@ol.ProductName @ol.ProductVariantText</td> 924 <td valign="top"> 925 <table> 926 <tr> 927 <td valign="top">@Quantity</td> 928 <td style="text-align: right;width: 30px;" valign="top"> @ol.ProductVariantText</td> @if (relatedPriceSum == 0) { } 929 </tr> 930 </table> 931 </td> 932 <td valign="top"> 933 <table width="100%"> 934 <tr> 935 936 @if (relatedPriceSum == 0 && mixmatch != "M") 937 { 938 <td style="text-align: left;width: auto;" valign="top">@order.Currency.Symbol @UnitPrice</td> 939 if (!String.IsNullOrEmpty(ol.ProductVariantText)) 940 { 941 <td style="text-align: left; width: auto;" valign="top">per @ol.ProductVariantText</td> 942 } 943 else 944 { 945 <td style="width: 47%;"> 946 </td> 947 } 948 } 949 </tr> 950 951 </table> 952 </td> 953 954 <td style="text-align: right;" valign="top"> 955 @if (totprice.ToString() != "0") 956 {<text>@order.Currency.Symbol @string.Format("{0:#.00}", totprice) </text>} 957 958 </td> 959 } 960 else 961 { 962 <td class="gift_right" valign="top">@ol.ProductName @Translate("Gift with Purchase", " Gift with Purchase")</td> 963 <td valign="top"> 964 <table> 965 <tr> 966 <td valign="top"></td> 967 <td style="text-align: right;width: 30px;" valign="top"></td> 968 </tr> 969 </table> 970 </td> 971 <td valign="top"> 972 </td> 973 <td style="text-align: right;" valign="top"> 974 </td> 975 } 976 977 978 </tr> 979 } 980 else 981 { 982 983 var totprice = ol.Price.Price + relatedPriceSum; 984 <tr> 985 986 <td valign="top">@ol.ProductNumber</td> 987 <td class="gift_left" valign="top"> 988 @if (gift == "true") 989 { 990 991 <img src="@url/@giftimg" style="width: 14px;" alt="(Gifted)"> 992 } 993 </td> 994 @if (totprice.ToString() != "0") 995 { 996 <td class="gift_right" valign="top">@ol.ProductName @ol.ProductVariantText</td> 997 <td valign="top"> 998 <table> 999 <tr> 1000 <td valign="top">@Quantity</td> 1001 <td style="text-align: right;width: 30px;" valign="top"> @ol.ProductVariantText</td> @if (relatedPriceSum == 0) { } 1002 </tr> 1003 </table> 1004 </td> 1005 <td valign="top"> 1006 <table width="100%"> 1007 <tr> 1008 1009 @if (relatedPriceSum == 0 && mixmatch != "M") 1010 { 1011 <td style="text-align: left;width: auto;" valign="top">@order.Currency.Symbol @UnitPrice</td> 1012 if (!String.IsNullOrEmpty(ol.ProductVariantText)) 1013 { 1014 <td style="text-align: left; width: auto;" valign="top">per @ol.ProductVariantText</td> 1015 } 1016 else 1017 { 1018 <td style="width: 47%;"> 1019 </td> 1020 } 1021 } 1022 </tr> 1023 1024 </table> 1025 </td> 1026 1027 <td style="text-align: right;" valign="top"> 1028 @if (totprice.ToString() != "0") 1029 {<text>@order.Currency.Symbol @string.Format("{0:#.00}", totprice) </text>} 1030 1031 </td> 1032 } 1033 else 1034 { 1035 <td class="gift_right" valign="top">@ol.ProductName @Translate("Gift with Purchase", " Gift with Purchase")</td> 1036 <td valign="top"> 1037 <table> 1038 <tr> 1039 <td valign="top"></td> 1040 <td style="text-align: right;width: 30px;" valign="top"></td> 1041 </tr> 1042 </table> 1043 </td> 1044 <td valign="top"> 1045 </td> 1046 <td style="text-align: right;" valign="top"> 1047 </td> 1048 } 1049 1050 1051 </tr> 1052 1053 } 1054 1055 1056 } 1057 else if (ParentProductId == "true") 1058 { 1059 <tr> 1060 <td></td> 1061 <td class="gift_left"></td> 1062 <td class="gift_right"> 1063 <table width="100%"> 1064 <tr> 1065 <td style="padding: 0;" width="10%" valign="top"> 1066 @Quantity 1067 </td> 1068 <td width="90%"> 1069 @ol.ProductName 1070 <br /> 1071 @ol.ProductVariantText 1072 </td> 1073 </tr> 1074 </table> 1075 </td> 1076 <td></td> 1077 <td style="text-align: right; padding-right: 67px;" valign="top"> @*@UnitPrice*@ </td> 1078 <td style="text-align: right;" valign="top">@*@Price*@</td> 1079 </tr> 1080 1081 } 1082 else if (ParentProductId == "") 1083 { 1084 <tr> 1085 <td></td> 1086 <td class="gift_left"></td> 1087 <td class="gift_right"> 1088 <table width="100%"> 1089 <tr> 1090 <td style="padding: 0;" width="10%" valign="top"> 1091 @ol.ProductName 1092 </td> 1093 <td width="90%"> 1094 @ol.ProductName 1095 <br /> 1096 @ol.ProductVariantText 1097 </td> 1098 </tr> 1099 </table> 1100 </td> 1101 <td></td> 1102 <td style="text-align: right; padding-right: 67px;" valign="top"> @*@UnitPrice*@ </td> 1103 <td style="text-align: right;" valign="top">@order.Currency.Symbol @Price </td> 1104 </tr> 1105 1106 } 1107 1108 ////////////////////Organize orderline and discount line///////////////////////// 1109 foreach (var ol1 in order.OrderLines) 1110 { 1111 if (ol1.ParentLineId == ol.Id && ol1.Price.ToString() == "0.00") 1112 { 1113 <tr> 1114 <td></td> 1115 <td class="gift_left"></td> 1116 <td class="gift_right">@ol1.ProductName </td> 1117 <td> </td> 1118 <td style="text-align: right;"> </td> 1119 <td style="text-align: right;"></td> 1120 </tr> 1121 } 1122 1123 } 1124 ///////////////////Organize orderline and discount line///////////////////////// 1125 } 1126 else if (!(ol.ProductName.Contains("Shipping Discount")) && rewardOrDiscount == "" && ol.Type != "3" && ol.Type != "1") 1127 { 1128 1129 UnitPrice = string.Format("{0:#.00}", ol.UnitPrice.Price); 1130 Price = string.Format("{0:#.00}", ol.Price.Price); 1131 <tr> 1132 <td></td> 1133 <td class="gift_left"></td> 1134 <td class="gift_right">@ol.ProductName</td> 1135 <td> </td> 1136 <td style="text-align: right;"> </td> 1137 <td style="text-align: right;">@order.Currency.Symbol @Price</td> 1138 </tr> 1139 } 1140 else 1141 { 1142 Price = string.Format("{0:#.00}", ol.Price.Price); 1143 <tr style="display:none"> 1144 <td></td> 1145 <td class="gift_left"></td> 1146 <td class="gift_right">@ol.ProductName Promotion</td> 1147 <td> </td> 1148 <td style="text-align: right;"> </td> 1149 <td style="text-align: right;">@order.Currency.Symbol @Price</td> 1150 </tr> 1151 } 1152 } 1153 </table> 1154 </td> 1155 </tr> 1156 </table> 1157 </td> 1158 </tr> 1159 <tr> 1160 <td style="padding: 10px 0 40px 0;"> 1161 <table width="100%"> 1162 <tr> 1163 <td> 1164 @RenderOrderSummary() 1165 <!--<table width="50%" align="right"> 1166 <tr> 1167 <td> 1168 <p>Delivery Charges</p> 1169 </td> 1170 <td style="text-align: right"> 1171 <p>0.00</p> 1172 </td> 1173 </tr> 1174 <tr> 1175 <td> 1176 <p>Sub Total</p> 1177 </td> 1178 <td style="text-align: right"> 1179 <p>828.75</p> 1180 </td> 1181 </tr> 1182 <tr> 1183 <td> 1184 <p>Voucher Code</p> 1185 </td> 1186 <td style="text-align: right"> 1187 <p>- 10.00</p> 1188 </td> 1189 </tr> 1190 <tr> 1191 <td> 1192 <p></p> 1193 </td> 1194 <td> 1195 <p></p> 1196 </td> 1197 </tr> 1198 <tr> 1199 <td> 1200 <p>GST %</p> 1201 </td> 1202 <td style="text-align: right"> 1203 <p>7.00</p> 1204 </td> 1205 </tr> 1206 <tr> 1207 <td> 1208 <p><b>Total(Inclusive taxes)</b></p> 1209 </td> 1210 <td style="text-align: right"> 1211 <p><b>819.75</b></p> 1212 </td> 1213 </tr> 1214 </table>--> 1215 </td> 1216 </tr> 1217 </table> 1218 </td> 1219 </tr> 1220 <tr> 1221 <td style="padding: 0 8px;"><hr style="border: 2px solid #000;"></td> 1222 </tr> 1223 <tr> 1224 <td style="padding: 0 8px 20px 0;" align="center"> 1225 <p style="font-family: FuturaMedium; font-size: 12px;">@Translate("THIS IS A COMPUTER GENERATED PRINTOUT. NO SINGATURE IS REQUIRED", "THIS IS A COMPUTER GENERATED PRINTOUT. NO SINGATURE IS REQUIRED")</p> 1226 </td> 1227 </tr> 1228 </table> 1229 </div> 1230 </td> 1231 </tr> 1232 </table> 1233 1234 </body> 1235 </html> 1236 1237 @helper RenderOrderSummary() 1238 { 1239 ///////////////////////////////////////////////////////Order Summary////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1240 1241 var shippingDiscount = 0.00; 1242 double totaldiscount = 0.00; 1243 var productDiscount = 0.00; 1244 var rewardDiscount = 0.00; 1245 var promotion = 0.00; 1246 var rewardName = ""; 1247 var isPromoFlag = "false"; 1248 var OTCPromotionName = ""; 1249 string id = System.Web.HttpContext.Current.Request["orderid"]; 1250 var order2 = Dynamicweb.Ecommerce.Orders.Order.GetOrderById(id); 1251 1252 foreach (var orderline1 in order2.OrderLines) 1253 { 1254 ////////////////////////////////////////shipping discount////////////////////////////////////////////////// 1255 if (orderline1.ProductName.Contains("Shipping Discount")) 1256 { 1257 shippingDiscount = orderline1.Price.Price; 1258 1259 } 1260 //////////////////////product discount////////////////////////////////////////////////// 1261 if (orderline1.Type == "3") 1262 { 1263 1264 if (!(orderline1.ProductName.Contains("Shipping Discount"))) 1265 { 1266 isPromoFlag = "true"; 1267 productDiscount += orderline1.Price.PriceWithVAT; 1268 } 1269 } 1270 //////////////////////order discount, reward and promotion////////////////////// 1271 if (orderline1.Type == "1") 1272 { 1273 var rewardOrDiscount = ""; 1274 1275 if (!orderline1.DiscountId.Contains("SALESDISCNT")) 1276 { 1277 var sqlString = "SELECT DiscountDescription,DiscountName FROM EcomDiscount WHERE DiscountId='" + orderline1.DiscountId + "'"; 1278 using (System.Data.IDataReader myImageReader = Dynamicweb.Data.Database.CreateDataReader(sqlString)) 1279 { 1280 while (myImageReader.Read()) 1281 { 1282 rewardOrDiscount = myImageReader["DiscountDescription"].ToString(); 1283 if (rewardOrDiscount == "OTC") 1284 { 1285 OTCPromotionName = myImageReader["DiscountName"].ToString(); 1286 } 1287 } 1288 } 1289 } 1290 1291 if (!(orderline1.ProductName.Contains("Shipping Discount"))) 1292 { 1293 1294 totaldiscount += orderline1.Price.Price; 1295 } 1296 if (rewardOrDiscount == "Reward") 1297 { 1298 isPromoFlag = "true"; 1299 rewardDiscount = orderline1.Price.PriceWithoutVAT; 1300 rewardName = orderline1.ProductName; 1301 } 1302 if (rewardOrDiscount == "Promotion") 1303 { 1304 isPromoFlag = "true"; 1305 promotion = orderline1.Price.PriceWithVAT; 1306 } 1307 if (rewardOrDiscount == "OTC") 1308 { 1309 isPromoFlag = "true"; 1310 promotion = orderline1.Price.PriceWithVAT; 1311 } 1312 1313 1314 } 1315 //////////////////////order discount, reward and promotion////////////////////////////////////////////////// 1316 } 1317 1318 1319 double otherDiscount = 0.00; 1320 otherDiscount = rewardDiscount + promotion + shippingDiscount; 1321 double totalDis = 0.00; 1322 /*if (order2.DeliveryCountry.ToUpper() == "SINGAPORE") 1323 { 1324 totalDis =order2.TotalDiscount.PriceWithoutVAT/ 1.07; 1325 } 1326 else 1327 { 1328 totalDis = order2.TotalDiscount.PriceWithVAT; 1329 } 1330 */ 1331 totalDis = order2.TotalDiscount.PriceWithVAT; 1332 totaldiscount = totalDis - otherDiscount; 1333 1334 1335 var totalOrderValue = 0.00; 1336 1337 /* if (order2.DeliveryCountry == "Singapore") 1338 { 1339 totalOrderValue = (order2.TotalPriceWithoutDiscounts.Price / 1.07) - order2.ShippingFee.PriceWithoutVAT; 1340 } 1341 else 1342 { 1343 totalOrderValue = order2.TotalPriceWithoutDiscounts.Price -order2.ShippingFee.PriceWithVAT; 1344 } 1345 1346 */ 1347 totalOrderValue = order2.TotalPriceWithoutDiscounts.Price - order2.ShippingFee.PriceWithVAT; 1348 var subtotalPrice = 0.00; 1349 subtotalPrice = totalOrderValue + totaldiscount + rewardDiscount + promotion; 1350 1351 1352 var showGST = subtotalPrice * 0.07; 1353 1354 ///////////////////////////////////////////////////////Order Summary////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1355 1356 <table id="total_table" align="right" width="50%" style="padding-left: 3px;"> 1357 <colgroup> 1358 <col width="51%"> 1359 <col width="49%"> 1360 </colgroup> 1361 1362 <tr> 1363 <td> 1364 @Translate("Total Order Value", "Total Order Value") 1365 </td> 1366 <td> 1367 1368 <span class="tdleft"></span><span class="tdright">@order2.Currency.Symbol @string.Format("{0:#.00}", totalOrderValue)</span> 1369 </td> 1370 </tr> 1371 1372 1373 @if (totaldiscount != 0.00) 1374 { 1375 <tr> 1376 <td> 1377 @Translate("Discount", "Discount") 1378 </td> 1379 <td> 1380 <span class="tdleft"></span><span class="tdright">(@order2.Currency.Symbol @string.Format("{0:#.00}", totaldiscount).Replace("-", ""))</span> 1381 </td> 1382 </tr> 1383 } 1384 @if (!String.IsNullOrWhiteSpace(rewardName)) 1385 { 1386 <tr> 1387 <td> 1388 @rewardName 1389 </td> 1390 <td> 1391 1392 <span class="tdleft"></span><span class="tdright">(@order2.Currency.Symbol @string.Format("{0:#.00}", rewardDiscount).Replace("-", ""))</span> 1393 1394 </td> 1395 </tr> 1396 } 1397 @if (promotion != 0.00 && String.IsNullOrWhiteSpace(rewardName) && isPromoFlag == "true") 1398 { 1399 <tr> 1400 <td> 1401 @Translate("Promotion Code", "Promotion Code") 1402 </td> 1403 <td><span class="tdleft"></span> <span class="tdright">(@order2.Currency.Symbol @string.Format("{0:#.00}", promotion).Replace("-", ""))</span></td> 1404 </tr> 1405 } 1406 @if (promotion == 0.00 && String.IsNullOrWhiteSpace(rewardName)) 1407 { 1408 if (String.IsNullOrWhiteSpace(rewardName) && !String.IsNullOrWhiteSpace(@order2.VoucherCode) && isPromoFlag == "true") 1409 { 1410 <tr> 1411 <td> 1412 @Translate("Promotion Code", "Promotion Code") 1413 </td> 1414 <td> 1415 <span class="tdleft"></span> <span class="tdright"> 1416 @if (!String.IsNullOrWhiteSpace(OTCPromotionName)) 1417 {<text>(@OTCPromotionName)</text>} 1418 else 1419 {<text>(@order2.VoucherCode)</text>} 1420 </span> 1421 </td> 1422 </tr> 1423 } 1424 } 1425 @if (totalOrderValue != subtotalPrice) 1426 { 1427 <tr> 1428 <td> 1429 @Translate("Sub Total After Discount", "Sub Total After Discount") 1430 1431 </td> 1432 <td> 1433 1434 <span class="tdleft"></span><span class="tdright">@order2.Currency.Symbol @string.Format("{0:0.00}", subtotalPrice)</span> 1435 </td> 1436 </tr> 1437 } 1438 1439 @if (order2.ShippingFee.PriceWithVAT != 0.00) 1440 { 1441 <tr> 1442 <td> 1443 @Translate("Shipping Charges", "Shipping Charges") 1444 </td> 1445 <td> 1446 <span class="tdleft"></span><span class="tdright">@order2.Currency.Symbol @string.Format("{0:#.00}", order2.ShippingFee.PriceWithVAT) </span> 1447 </td> 1448 </tr> 1449 } 1450 1451 @if (shippingDiscount != 0.00) 1452 { 1453 <tr> 1454 <td> 1455 @Translate("Shipping Discount", "Shipping Discount") 1456 </td> 1457 1458 1459 <td> 1460 <span class="tdleft"></span><span class="tdright">@order2.Currency.Symbol @string.Format("{0:#.00}", shippingDiscount)</span> 1461 </td> 1462 1463 1464 </tr> 1465 } 1466 @if (order2.DeliveryCountry.ToUpper() == "Singapore".ToUpper()) 1467 { 1468 <tr> 1469 <td style="width: 70%;"> 1470 @Translate("Grand Total", "Grand Total") (Inclusive of 7% GST) 1471 </td> 1472 1473 <td style="width:30%"> 1474 <span class="tdleft"></span><span class="tdright">@order2.Currency.Symbol @string.Format("{0:#.00}", order2.Price.Price)</span> 1475 </td> 1476 </tr> 1477 1478 1479 } 1480 else 1481 { 1482 1483 @*<tr> 1484 <td> 1485 @Translate("GST % (Inc)") 1486 </td> 1487 1488 <td> 1489 <span class="tdleft"> </span><span class="tdright">7%</span> 1490 </td> 1491 </tr>*@ 1492 <tr> 1493 <td style="width: 70%;"> 1494 @Translate("Grand Total", "Grand Total") 1495 </td> 1496 1497 <td style="width:30%"> 1498 <span class="tdleft"></span><span class="tdright">@order2.Currency.Symbol @string.Format("{0:#.00}", order2.Price.Price)</span> 1499 </td> 1500 </tr> 1501 } 1502 1503 </table> 1504 }