Sub WriteCSVfile(WriteFolder As String)
Dim CSVlist As List
CSVlist.Initialize
For I = 0 To lstorders.Size - 1
Dim row(4) As String
Dim t As orderline
t = lstorders.Get(I)
row(0) = t.Item
row(1) = t.qty
row(2) = t.desc
row(3) = t.note
If gbsubmissionfile = True Then
If manager.GetBoolean("PRincludedesc") = True AND manager.GetBoolean("PRnotes") = True Then
CSVlist.Add(Array As String(row(0), row(1), row(2), row(3)))
Else
If manager.GetBoolean("PRincludedesc") Then
CSVlist.Add(Array As String(row(0), row(1), row(2)))
Else
If manager.GetBoolean("PRnotes") Then
CSVlist.Add(Array As String(row(0), row(1), row(3)))
Else
CSVlist.Add(Array As String(row(0), row(1)))
End If
End If
End If
Else
CSVlist.Add(Array As String(row(0), row(1), row(2), row(3)))
End If
Next
Dim su As StringUtils
Log("save dir: " & File.DirInternal & " file: " & filename)
su.SaveCSV(WriteFolder, filename, ",", CSVlist)
gbsubmissionfile = False
End Sub