home *** CD-ROM | disk | FTP | other *** search
/ PC & Mediji 2001 June / PCM_0106.iso / MEDIA / demo / M9USWEB.EXE / money.cab / nvcscrpt.vbs < prev    next >
Encoding:
Text File  |  2000-07-19  |  3.0 KB  |  139 lines

  1. '    Copyright (c) 1996 Microsoft Corporation.  All Rights Reserved.
  2. '    File:        nvcscrpt.vbs
  3. '    Owner:        stefanba
  4. '    Purpose:    Script for invoices.
  5.  
  6. Dim sstraShipMethods(12)
  7. Dim sstraBillingTerms(7)
  8.  
  9. sstraShipMethods(0) = "Airborne"
  10. sstraShipMethods(1) = "FedEx"
  11. sstraShipMethods(2) = "USPS"
  12. sstraShipMethods(3) = "UPS"
  13. sstraShipMethods(4) = "DHL"
  14. sstraShipMethods(5) = "Other"
  15. sstraShipMethods(6) = ""
  16. sstraShipMethods(7) = ""
  17. sstraShipMethods(8) = ""
  18. sstraShipMethods(9) = ""
  19. sstraShipMethods(10) = ""
  20. sstraShipMethods(11) = ""
  21. sstraShipMethods(12) = ""
  22.  
  23. sstraBillingTerms(0) = "None"
  24. sstraBillingTerms(1) = "On Receipt"
  25. sstraBillingTerms(2) = "Net 15"
  26. sstraBillingTerms(3) = "Net 30"
  27. sstraBillingTerms(4) = "Net 60"
  28. sstraBillingTerms(5) = "1% 10 Net 30"
  29. sstraBillingTerms(6) = "2% 10 Net 30"
  30. sstraBillingTerms(7) = "Net 10"
  31.  
  32. Sub document_onreadystatechange
  33.     If document.readyState = "complete" Then
  34.         Data.RefreshLinked
  35.     End If
  36. End Sub
  37.  
  38. Sub Data_NotifyListChanged(ByVal list)
  39.     If Not IsEmpty(list) Then
  40.         If Not list.EOL Then
  41.             If IsObject(StaticShipMethod) Then
  42.                 Dim lShipMethod
  43.                     
  44.                 lShipMethod = list.Field(-264437853)
  45.  
  46.                 If Not IsNull(lShipMethod) And lShipMethod >= 0 Then
  47.                     StaticShipMethod.Text = sstraShipMethods(lShipMethod)
  48.                 Else
  49.                     StaticShipMethod.Text = ""
  50.                 End If
  51.             End If
  52.  
  53.             If IsObject(StaticBillTerms) Then
  54.                 Dim lBillingTerm
  55.  
  56.                 lBillingTerm = list.Field(-264437827)
  57.  
  58.                 If Not IsNull(lBillingTerm) And lBillingTerm >= 0 And IsObject(StaticBillTerms) Then
  59.                     StaticBillTerms.Text = sstraBillingTerms(lBillingTerm)
  60.                 Else
  61.                     StaticBillTerms.Text = ""
  62.                 End If
  63.             End If
  64.         End If
  65.     End If
  66. End Sub
  67.  
  68. Sub UpdateCounter(ByRef pageinfo)
  69.     Dim str
  70.  
  71.     If Not IsObject(Counter) Then
  72.         Exit Sub
  73.     End If
  74.  
  75.     str = CStr(pageinfo.PageCur) + " of " + CStr(pageinfo.PageLast)
  76.     Counter.innerHTML = str
  77. End Sub
  78.  
  79. Sub Data_OnMovePageFirst(ByRef pageinfo)
  80.     UpdateCounter(pageinfo)
  81. End Sub
  82.  
  83. Sub Data_OnMovePageNext(ByRef pageinfo)
  84.     UpdateCounter(pageinfo)
  85. End Sub
  86.  
  87. Sub Data_OnMovePageLast(ByRef pageinfo)
  88.     UpdateCounter(pageinfo)
  89. End Sub
  90.  
  91. Sub Data_OnMovePagePrev(ByRef pageinfo)
  92.     UpdateCounter(pageinfo)
  93. End Sub
  94.  
  95. Sub ListItems_NotifyPreView(ByVal view)
  96.     view.PushFilterField -264437782, 13, CLng(4)
  97.     view.PushFilterOper 0
  98. End Sub
  99.  
  100. Sub ListItems_NotifyListChanged(ByVal list)
  101.     Dim total
  102.     Dim tax
  103.     Dim taxT
  104.  
  105.     list.MoveFirst
  106.     while not list.EOL
  107.         total = total + list.Field(-264437771)
  108.         taxT = list.Field(-264437832)
  109.         If Not IsNull(taxT) Then
  110.             tax = tax + taxT
  111.         End If
  112.         list.MoveNext
  113.     wend
  114.  
  115.     If IsNull(tax) Then
  116.         tax = CCur(0)
  117.     Else
  118.         tax = CCur(tax)
  119.     End If
  120.  
  121.     If IsNull(total) Then
  122.         total = CCur(0)
  123.     Else
  124.         total = CCur(total)
  125.     End If
  126.  
  127.     If IsObject(StaticBizSubTotal) Then
  128.         StaticBizSubTotal.Value = total
  129.     End If
  130.  
  131.     If IsObject(StaticBizTax) Then
  132.         StaticBizTax.Value = tax
  133.     End If
  134.  
  135.     If IsObject(StaticBizTotal) Then
  136.         StaticBizTotal.Value = total + tax
  137.     End If
  138. End Sub
  139.