<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.ecibemet.com/index.php?action=history&amp;feed=atom&amp;title=PdcStatusManagement.CalcLiveInvoiceStatus</id>
	<title>PdcStatusManagement.CalcLiveInvoiceStatus - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.ecibemet.com/index.php?action=history&amp;feed=atom&amp;title=PdcStatusManagement.CalcLiveInvoiceStatus"/>
	<link rel="alternate" type="text/html" href="http://wiki.ecibemet.com/index.php?title=PdcStatusManagement.CalcLiveInvoiceStatus&amp;action=history"/>
	<updated>2026-05-06T18:14:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://wiki.ecibemet.com/index.php?title=PdcStatusManagement.CalcLiveInvoiceStatus&amp;diff=3233&amp;oldid=prev</id>
		<title>TC: Created page with &quot;== Declaration == CalcLiveInvoiceStatus(strCalcNr As String, strTFRIDList As IStrings, strDelNrList As IStrings, strDelPosList As IStrings) As String  == Description == This f...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.ecibemet.com/index.php?title=PdcStatusManagement.CalcLiveInvoiceStatus&amp;diff=3233&amp;oldid=prev"/>
		<updated>2020-07-07T11:42:27Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Declaration == CalcLiveInvoiceStatus(strCalcNr As String, strTFRIDList As IStrings, strDelNrList As IStrings, strDelPosList As IStrings) As String  == Description == This f...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Declaration ==&lt;br /&gt;
CalcLiveInvoiceStatus(strCalcNr As String, strTFRIDList As IStrings, strDelNrList As IStrings, strDelPosList As IStrings) As String&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
This function is used before saving a sales invoice. It requires a calculation number, and lists with all the TFR_IDs, delivery note numbers, and delivery note positions of all the lines in the invoice. It will use those to calculate what the status of that calculation would become after saving the invoice. It will return the status identifier of that status as a result.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
The stringlists that you pass as parameters all need to have the same length. They are a replacement of a list of objects where every object contains 3 string properties.&lt;br /&gt;
&lt;br /&gt;
== Code example ==&lt;br /&gt;
This code example is from the CanSave function of the SalesInvoice.vb class. It calculates the future status of a calculation and checks if this status is allowed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039;collect IDs&lt;br /&gt;
		Dim aTFRIDList As List(Of Integer) = New List(Of Integer)&lt;br /&gt;
		Dim aDeliveryNoteNrList As List(Of String) = New List(Of String)&lt;br /&gt;
		Dim aCalcNrList As List(Of String) = New List(Of String)&lt;br /&gt;
		For Each aLine As SalesInvoiceLine In _InvoiceLineList&lt;br /&gt;
			aTFRIDList.Add(aLine.TermInvoiceLineID) &amp;#039;Collect all TFR_IDs &lt;br /&gt;
			If Not aDeliveryNoteNrList.Contains(aLine.DlvryNoteNr) Then &amp;#039;Collect unique delivery note numbers&lt;br /&gt;
				aDeliveryNoteNrList.Add(aLine.DlvryNoteNr)&lt;br /&gt;
			End If&lt;br /&gt;
			If Not aCalcNrList.Contains(aLine.CalcNr) Then&lt;br /&gt;
				aCalcNrList.Add(aLine.CalcNr)&lt;br /&gt;
			End If&lt;br /&gt;
		Next&lt;br /&gt;
&amp;#039;Calculate and try statuses&lt;br /&gt;
			For Each aCalcNr In aCalcNrList&lt;br /&gt;
			&amp;#039;check calcstatus, use CalcLiveInvoiceStatus to see what the status would become if all selected tfr lines are invoiced&lt;br /&gt;
			Dim strFutureStatus As String = PDC.App.Calculations.StatusManagement.CalcLiveInvoiceStatus(aCalcNr, aTFRIDStringList, aDelNoteNrStringList, aDelNotePosStringList)&lt;br /&gt;
			Dim strError As String = &amp;quot;&amp;quot;&lt;br /&gt;
			If Not PDC.App.Calculations.StatusManagement.TryStatus(aCalcNr, strFutureStatus) Then&lt;br /&gt;
				strError = PDC.App.LastError&lt;br /&gt;
				_ErrMsg.Append(strError)&lt;br /&gt;
				Return False&lt;br /&gt;
			End If&lt;br /&gt;
		Next&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
== Availability ==&lt;br /&gt;
Available since August 2020 (From version 5.6)&lt;/div&gt;</summary>
		<author><name>TC</name></author>
	</entry>
</feed>