ISInvoice.Save

Description

This function returns ID of the saved invoice.

Syntax

object.Save()

Part Attribute Type Description
object Required
The object always implements the ISInvoice interface

Return Value

int

Returns ID of the saved invoice.

Example

Create a new invoice and add an invoice line to the created invoice. Display some information about the invoice and its invoice line.

Dim aTr
Dim aPatient, aPatientID
Dim aGuarantorID
Dim aIncomeProviderID
Dim aPOSID
Dim aDate  
Dim aInvoice, aInvoiceLine
Dim aMessage
Dim aService
Dim aServiceCode, aServiceDescription 
Dim aInvoiceId
Dim aTaxRate      

set aTr = Profile.StartMapTransaction
Set aPatient = Profile.SelectPatient
aPatientID = aPatient.ID
aGuarantorID = aPatient.ID
aIncomeProviderID = Profile.LoadProvider("AM").ID
aPOSID = Profile.CurrentPOSId
aDate = Now

set aInvoice = Profile.CreateInvoice(aPatientID, aGuarantorID, aIncomeProviderID,_
  aPOSID, aDate)

aServiceCode = "11"
set aService = Profile.LoadService(aServiceCode)
aServiceDescription = aServiceDescription 
set aTaxRate = Profile.LoadShortCodeByCodeType("S", 15)

set aInvoiceLine = aInvoice.AddInvoiceLine(aDate, aServiceCode, aServiceDescription, aTaxRate, 0)
aTr.SnapShot
aInvoiceId = aInvoice.Save

set aInvoice = Profile.LoadInvoice(aInvoiceId)

aMessage = aMessage & vbNewLine & _
  "Date: " & aInvoice.Date & vbNewLine &_
  "ID: " & aInvoice.ID & vbNewLine &_
  "Pos Code: " & aInvoice.PosCode & vbNewLine &_ 
  "Service Description" & aInvoiceLine.Description & vbNewLine &_
  "Line Amount: " & aInvoiceLine.LineAmount
   
Profile.MsgBox(aMessage)  
Note:

In Profile Client v8 on User Interface Save cannot be found.

Version information

Added in v7.8.0