cant find duplicate doc

This is a discussion on cant find duplicate doc within the lotus-notes-programmer forums in Other Technologies category; Why i cant find the duplicate documents at the view? while the duplicate documents did show at the web. Is the getNthDocument cause this problem? Function getOutStandingAmt(paymentDb As notesDatabase, invoiceNo As String, invoiceAmt As Double, invoiceExchangeRate As Double, invFee As Double, invTax As Double, invOPE As Double) As Double Const CONST_PAYVW = ($ByInvoiceNo) Dim paymentVw As notesView Dim paymentDoc As notesDocument Dim paymentCol As notesDocumentCollection Dim paidFee As Double Dim paidTax As Double Dim paidOPE As Double Dim convertedFee As Double Dim convertedTax As Double Dim convertedOPE As Double Dim paymentAmt As Double Dim convertedPaymentAmt As Double Dim i As ...

Go Back   Database Forum > Other Technologies > lotus-notes-programmer

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-22-2005, 12:40 AM
Default cant find duplicate doc

Why i cant find the duplicate documents at the view? while the
duplicate documents did show at the web.
Is the getNthDocument cause this problem?


Function getOutStandingAmt(paymentDb As notesDatabase, invoiceNo As
String, invoiceAmt As Double, invoiceExchangeRate As Double, invFee As
Double, invTax As Double, invOPE As Double) As Double
Const CONST_PAYVW = "($ByInvoiceNo)"

Dim paymentVw As notesView
Dim paymentDoc As notesDocument
Dim paymentCol As notesDocumentCollection

Dim paidFee As Double
Dim paidTax As Double
Dim paidOPE As Double

Dim convertedFee As Double
Dim convertedTax As Double
Dim convertedOPE As Double

Dim paymentAmt As Double
Dim convertedPaymentAmt As Double
Dim i As Integer

If Not GetView(paymentDb , CONST_PAYVW, paymentVw ) Then
getOutStandingAmt = Cdbl(invoiceAmt)
Exit Function
End If

Set paymentCol = paymentVw.getAllDocumentsByKey(invoiceNo, True)
If paymentCol.count = 0 Then
getOutStandingAmt = Cdbl(invoiceAmt)
feeAmt = invFee
opeAmt = invOPE
taxAmt = invTax
paidAmt = 0
Exit Function
End If

paymentAmt = 0
paidOPE = 0
paidFee = 0
paidTax = 0

For i = 1 To paymentCol.count
Set paymentDoc = paymentCol.getNthDocument(i)
convertedPaymentAmt = 0
convertedPaymentAmt = Cdbl(paymentDoc.PaymentAmount_tx(0)) *
Cdbl(invoiceExchangeRate)
Select Case paymentDoc.PaymentType_kw(0)
Case "OPE":
paidOPE = Cdbl(paidOPE) + (Cdbl(paymentDoc.PaymentAmount_tx(0)) *
Cdbl(invoiceExchangeRate))
Case "Fee":
paidFee = Cdbl(paidFee) + (Cdbl(paymentDoc.PaymentAmount_tx(0)) *
Cdbl(invoiceExchangeRate))
Case "Service Tax":
paidTax = Cdbl(paidTax) + (Cdbl(paymentDoc.PaymentAmount_tx(0)) *
Cdbl(invoiceExchangeRate))
End Select
paymentAmt = paymentAmt + convertedPaymentAmt
Next
paidAmt = Cdbl(paymentAmt)
feeAmt = Cdbl(invFee) - Cdbl(paidFee)
taxAmt = Cdbl(invTax) - Cdbl(paidTax)
OPEAmt = Cdbl(invOPE) - Cdbl(paidOPE)

getOutStandingAmt = Cdbl(invoiceAmt) - Cdbl(paymentAmt)
End Function

Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 09:56 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Integrated by bbpixel2009 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.