SOrder::InsertInvProp (Interface: SOrder)
 
Inserts an invoicing proposal in the order.
 
SHORT InsertInvProp (
    VARIANT vCode
)
 
Parameters
vCode
[in] A VARIANT stating the code of the invoicing proposal you want to insert. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY If an invoicing proposal code is found in the customer card, this value is used.
If no proposal code is found in the customer card, the invoicing proposal for a blank code is used if it exists, otherwise no details are added.
BSTR (VT_BSTR) The given value is used if it exists, otherwise an exception is thrown.
 
Return value
A SHORT containing the index where the invoicing proposal details are added if an invoicing proposal was found, otherwise -1.
 
See Also
CreateSOrder
Handling invoicing documents using the SDK
PrepareDocument
GetNumDetails
WriteDocument
 
Samples
 
C++
 
// Insert an invoicing proposal with code 'PRP01' in the sales document.
pSOrder->PrepareDocument (paInsert);

// Fill the necessary header data

short sIndex = pSOrder->InsertInvProp ("PRP01");

if (sIndex != -1)
{
    for (short sNew = pSOrder->GetNumDetails (); sNew > sIndex; sNew--)
    {
        // Add necessary data to the details of the proposal
    }
}

pSOrder->WriteDocument (rmFullReport, VARIANT_FALSE, VARIANT_FALSE);

C#
 
// Insert an invoicing proposal with code 'PRP01' in the sales document.
oSOrder.PrepareDocument (ePrepareAction.paInsert);

// Fill the necessary header data

short sIndex = oSOrder.InsertInvProp ("PRP01");

if (sIndex != -1)
{
    for (short sNew = oSOrder.GetNumDetails (); sNew > sIndex; sNew--)
    {
        // Add necessary data to the details of the proposal
    }
}

oSOrder.WriteDocument (eReportMode.rmFullReport, false, false);

VBS
 
' Insert an invoicing proposal with code 'PRP01' in the sales document.
Dim sIndex, sNew

Call oSOrder.PrepareDocument(paInsert)

' Fill the necessary header data

sIndex = oSOrder.InsertInvProp("PRP01")

If sIndex <> -1 Then
    For sNew = oSOrder.GetNumDetails() To sIndex
        ' Add necessary data to the details of the proposal
    Next
End If

Call oSOrder.WriteDocument(rmFullReport, False, False)

VB.NET
 
' Insert an invoicing proposal with code 'PRP01' in the sales document.
Dim sIndex, sNew As Short

oSOrder.PrepareDocument(ePrepareAction.paInsert)

' Fill the necessary header data

sIndex = oSOrder.InsertInvProp("PRP01")

If sIndex <> -1 Then
    For sNew = oSOrder.GetNumDetails() To sIndex
        ' Add necessary data to the details of the proposal
    Next
End If

oSOrder.WriteDocument(eReportMode.rmFullReport, False, False)