| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| 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 |
![]() |
| Thread Tools | |
| Display Modes | |