home *** CD-ROM | disk | FTP | other *** search
- ' Copyright (c) 1996 Microsoft Corporation. All Rights Reserved.
- ' File: nvcscrpt.vbs
- ' Owner: stefanba
- ' Purpose: Script for invoices.
-
- Dim sstraShipMethods(12)
- Dim sstraBillingTerms(7)
-
- sstraShipMethods(0) = "Airborne"
- sstraShipMethods(1) = "FedEx"
- sstraShipMethods(2) = "USPS"
- sstraShipMethods(3) = "UPS"
- sstraShipMethods(4) = "DHL"
- sstraShipMethods(5) = "Other"
- sstraShipMethods(6) = ""
- sstraShipMethods(7) = ""
- sstraShipMethods(8) = ""
- sstraShipMethods(9) = ""
- sstraShipMethods(10) = ""
- sstraShipMethods(11) = ""
- sstraShipMethods(12) = ""
-
- sstraBillingTerms(0) = "None"
- sstraBillingTerms(1) = "On Receipt"
- sstraBillingTerms(2) = "Net 15"
- sstraBillingTerms(3) = "Net 30"
- sstraBillingTerms(4) = "Net 60"
- sstraBillingTerms(5) = "1% 10 Net 30"
- sstraBillingTerms(6) = "2% 10 Net 30"
- sstraBillingTerms(7) = "Net 10"
-
- Sub document_onreadystatechange
- If document.readyState = "complete" Then
- Data.RefreshLinked
- End If
- End Sub
-
- Sub Data_NotifyListChanged(ByVal list)
- If Not IsEmpty(list) Then
- If Not list.EOL Then
- If IsObject(StaticShipMethod) Then
- Dim lShipMethod
-
- lShipMethod = list.Field(-264437853)
-
- If Not IsNull(lShipMethod) And lShipMethod >= 0 Then
- StaticShipMethod.Text = sstraShipMethods(lShipMethod)
- Else
- StaticShipMethod.Text = ""
- End If
- End If
-
- If IsObject(StaticBillTerms) Then
- Dim lBillingTerm
-
- lBillingTerm = list.Field(-264437827)
-
- If Not IsNull(lBillingTerm) And lBillingTerm >= 0 And IsObject(StaticBillTerms) Then
- StaticBillTerms.Text = sstraBillingTerms(lBillingTerm)
- Else
- StaticBillTerms.Text = ""
- End If
- End If
- End If
- End If
- End Sub
-
- Sub UpdateCounter(ByRef pageinfo)
- Dim str
-
- If Not IsObject(Counter) Then
- Exit Sub
- End If
-
- str = CStr(pageinfo.PageCur) + " of " + CStr(pageinfo.PageLast)
- Counter.innerHTML = str
- End Sub
-
- Sub Data_OnMovePageFirst(ByRef pageinfo)
- UpdateCounter(pageinfo)
- End Sub
-
- Sub Data_OnMovePageNext(ByRef pageinfo)
- UpdateCounter(pageinfo)
- End Sub
-
- Sub Data_OnMovePageLast(ByRef pageinfo)
- UpdateCounter(pageinfo)
- End Sub
-
- Sub Data_OnMovePagePrev(ByRef pageinfo)
- UpdateCounter(pageinfo)
- End Sub
-
- Sub ListItems_NotifyPreView(ByVal view)
- view.PushFilterField -264437782, 13, CLng(4)
- view.PushFilterOper 0
- End Sub
-
- Sub ListItems_NotifyListChanged(ByVal list)
- Dim total
- Dim tax
- Dim taxT
-
- list.MoveFirst
- while not list.EOL
- total = total + list.Field(-264437771)
- taxT = list.Field(-264437832)
- If Not IsNull(taxT) Then
- tax = tax + taxT
- End If
- list.MoveNext
- wend
-
- If IsNull(tax) Then
- tax = CCur(0)
- Else
- tax = CCur(tax)
- End If
-
- If IsNull(total) Then
- total = CCur(0)
- Else
- total = CCur(total)
- End If
-
- If IsObject(StaticBizSubTotal) Then
- StaticBizSubTotal.Value = total
- End If
-
- If IsObject(StaticBizTax) Then
- StaticBizTax.Value = tax
- End If
-
- If IsObject(StaticBizTotal) Then
- StaticBizTotal.Value = total + tax
- End If
- End Sub
-