SAFT
This class contains functions related to SAFT.
Description
Sends monthly SAFT by e-mail.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
month |
Month, expressed as a value between 1 and 12 |
Int32 |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
emailFrom |
The email account for sending email |
String |
emailTo |
The email account for email receiver |
String |
emailCc |
The email accounts for email cc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBcc |
The email accounts for email bcc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBody |
The email body. This parameter is optional and the default value is Nothing. |
String |
Example
Dim result as PHCResult = SDK.SAFT.SendMonthSAFT(2021,1,"12345",Portarias.Cod_302_2016,"from@phcsoftware.com", "to@phcsoftware.com")
If Not PHCResult.hasMsgErrors(result.messages)
Return New MsgInfo("Mail has been sent")
Else
Return New MsgInfo(result.messages(0).messageCodeLocale)
End If
Description
Sends partial monthly SAFT by e-mail.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
dateIni |
Start date |
DateTime |
dateEnd |
End date |
DateTime |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
emailFrom |
The email account for sending email |
String |
emailTo |
The email account for email receiver |
String |
emailCc |
The email accounts for email cc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBcc |
The email accounts for email bcc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBody |
The email body. This parameter is optional and the default value is Nothing. |
String |
Example
Dim result as PHCResult = SDK.SAFT.SendPartialMonthSAFT(New Date(2021,1,1),New Date(2021,1,15),"12345",Portarias.Cod_302_2016,"from@phcsoftware.com", "to@phcsoftware.com")
If Not PHCResult.hasMsgErrors(result.messages)
Return New MsgInfo("Mail has been sent")
Else
Return New MsgInfo(result.messages(0).messageCodeLocale)
End If
Description
Sends annual SAFT by e-mail.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateIni |
Start date |
DateTime |
dateEnd |
End date |
DateTime |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
emailFrom |
The email account for sending email |
String |
emailTo |
The email account for email receiver |
String |
emailCc |
The email accounts for email cc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBcc |
The email accounts for email bcc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBody |
The email body. This parameter is optional and the default value is Nothing. |
String |
Example
Dim result as PHCResult = SDK.SAFT.SendAnnualSAFT(2021,new Date(2021,1,1),new Date(2021,12,31),"12345",Portarias.Cod_302_2016,"from@phcsoftware.com", "to@phcsoftware.com")
If Not PHCResult.hasMsgErrors(result.messages)
Return New MsgInfo("Mail has been sent")
Else
Return New MsgInfo(result.messages(0).messageCodeLocale)
End If
Description
Sends partial annual SAFT by e-mail.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateIni |
Start date |
DateTime |
dateEnd |
End date |
DateTime |
monthIni |
Start month, expressed as a value between 1 and 12 |
Int32 |
monthEnd |
End month, expressed as a value between 1 and 12 |
Int32 |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
emailFrom |
The email account for sending email |
String |
emailTo |
The email account for email receiver |
String |
emailCc |
The email accounts for email cc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBcc |
The email accounts for email bcc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBody |
The email body. This parameter is optional and the default value is Nothing. |
String |
Example
Dim result as PHCResult = SDK.SAFT.SendPartialAnnualSAFT(2021,new Date(2021,1,1),new Date(2021,12,31),1,3,"12345",Portarias.Cod_302_2016,"from@phcsoftware.com", "to@phcsoftware.com")
If Not PHCResult.hasMsgErrors(result.messages)
Return New MsgInfo("Mail has been sent")
Else
Return New MsgInfo(result.messages(0).messageCodeLocale)
End If
Description
Sends accounting SAFT by e-mail.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateIni |
Start date |
DateTime |
dateEnd |
End date |
DateTime |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_302_2016) |
emailFrom |
The email account for sending email |
String |
emailTo |
The email account for email receiver |
String |
emailCc |
The email accounts for email cc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBcc |
The email accounts for email bcc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBody |
The email body. This parameter is optional and the default value is Nothing. |
String |
Example
Dim result as PHCResult = SDK.SAFT.SendAccountingSAFT(2021,new Date(2021,1,1),new Date(2021,12,31),"12345",Portarias.Cod_302_2016,"from@phcsoftware.com", "to@phcsoftware.com")
If Not PHCResult.hasMsgErrors(result.messages)
Return New MsgInfo("Mail has been sent")
Else
Return New MsgInfo(result.messages(0).messageCodeLocale)
End If
Description
Sends integrated SAFT by e-mail.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateIni |
Start date |
DateTime |
dateEnd |
End date |
DateTime |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_302_2016) |
emailFrom |
The email account for sending email |
String |
emailTo |
The email account for email receiver |
String |
emailCc |
The email accounts for email cc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBcc |
The email accounts for email bcc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBody |
The email body. This parameter is optional and the default value is Nothing. |
String |
Example
Dim result as PHCResult = SDK.SAFT.SendIntegratedSAFT(2021,new Date(2021,1,1),new Date(2021,12,31),"12345",Portarias.Cod_302_2016,"from@phcsoftware.com", "to@phcsoftware.com")
If Not PHCResult.hasMsgErrors(result.messages)
Return New MsgInfo("Mail has been sent")
Else
Return New MsgInfo(result.messages(0).messageCodeLocale)
End If
Description
Sends auto-billing SAFT by e-mail.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateIni |
Start date |
DateTime |
dateEnd |
End date |
DateTime |
supplierStamp |
Supplier stamp |
String |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
emailFrom |
The email account for sending email |
String |
emailTo |
The email account for email receiver |
String |
emailCc |
The email accounts for email cc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBcc |
The email accounts for email bcc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBody |
The email body. This parameter is optional and the default value is Nothing. |
String |
Example
Dim result as PHCResult = SDK.SAFT.SendAutoInvoiceSAFT(2021,new Date(2021,1,1),new Date(2021,12,31),"e55-4818-83a7-2378310250f","12345",Portarias.Cod_302_2016,"from@phcsoftware.com", "to@phcsoftware.com")
If Not PHCResult.hasMsgErrors(result.messages)
Return New MsgInfo("Mail has been sent")
Else
Return New MsgInfo(result.messages(0).messageCodeLocale)
End If
SendPartialAutoInvoiceSAFT
Description
Sends partial auto-billing SAFT by e-mail.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateIni |
Start date |
DateTime |
dateEnd |
End date |
DateTime |
monthIni |
Start month, expressed as a value between 1 and 12 |
Int32 |
monthEnd |
End month, expressed as a value between 1 and 12 |
Int32 |
supplierStamp |
Supplier stamp |
String |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
emailFrom |
The email account for sending email |
String |
emailTo |
The email account for email receiver |
String |
emailCc |
The email accounts for email cc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBcc |
The email accounts for email bcc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBody |
The email body. This parameter is optional and the default value is Nothing. |
String |
Example
Dim result as PHCResult = SDK.SAFT.SendPartialAutoInvoiceSAFT(2021,new Date(2021,1,1),new Date(2021,12,31),1,4,"e55-4818-83a7-2378310250f","12345",Portarias.Cod_302_2016,"from@phcsoftware.com", "to@phcsoftware.com")
If Not PHCResult.hasMsgErrors(result.messages)
Return New MsgInfo("Mail has been sent")
Else
Return New MsgInfo(result.messages(0).messageCodeLocale)
End If
Description
Sends inventories by e-mail.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateEnd |
End date |
DateTime |
excludedWareHouses |
List of warehouses to exclude.
The intention is only to include warehouses that reflect sales stock, thus being able to exclude merchandise repair warehouses. |
List(Of Integer) |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
emailFrom |
The email account for sending email |
String |
emailTo |
The email account for email receiver |
String |
emailCc |
The email accounts for email cc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBcc |
The email accounts for email bcc receiver (semicolon-delimited). This parameter is optional and the default value is Nothing. |
String |
emailBody |
The email body. This parameter is optional and the default value is Nothing. |
String |
Example
Dim result as PHCResult = SDK.SAFT.SendInventories(2021,Date.Now,New List(Of Integer)({1}),InventarioPortarias.Cod_028_2019,"from@phcsoftware.com", "to@phcsoftware.com")
If Not PHCResult.hasMsgErrors(result.messages)
Return New MsgInfo("Mail has been sent")
Else
Return New MsgInfo(result.messages(0).messageCodeLocale)
End If
Description
Checks monthly SAFT integrity.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
month |
Month, expressed as a value between 1 and 12 |
Int32 |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
Example
Dim saftIntegrity as PHCResult = SDK.SAFT.ValidateMonthSAFT(2021,8,"12345",Portarias.Cod_302_2016)
For each entity as KeyValueVO in saftIntegrity.Result
For Each message as MessageVO in entity.value.messages
msgList.Add(New MsgInfo(message.messageCodeLocale))
Next
Next
If isVoid(msgList) then
msgList.Add(New MsgInfo("SAFT integrity is correct"))
end if
Return MsgList
Description
Checks partial monthly SAFT integrity.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
dateIni |
Start date |
DateTime |
dateEnd |
End date |
DateTime |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
Example
Dim saftIntegrity as PHCResult = SDK.SAFT.ValidatePartialMonthSAFT(New Date(2021,1,1),New Date(2021,1,15),"12345",Portarias.Cod_302_2016)
For each entity as KeyValueVO in saftIntegrity.Result
For Each message as MessageVO in entity.value.messages
msgList.Add(New MsgInfo(message.messageCodeLocale))
Next
Next
If isVoid(msgList) then
msgList.Add(New MsgInfo("SAFT integrity is correct"))
end if
Return MsgList
Description
Checks annual SAFT integrity.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateIni |
Start date |
DateTime |
dateEnd |
End date |
DateTime |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
Example
Dim saftIntegrity as PHCResult = SDK.SAFT.ValidateAnnualSAFT(2021,new Date(2021,1,1),new Date(2021,12,31),"12345",Portarias.Cod_302_2016)
For each entity as KeyValueVO in saftIntegrity.Result
For Each message as MessageVO in entity.value.messages
msgList.Add(New MsgInfo(message.messageCodeLocale))
Next
Next
If isVoid(msgList) then
msgList.Add(New MsgInfo("SAFT integrity is correct"))
end if
Return MsgList
ValidatePartialAnnualSAFT
Description
Checks partial annual SAFT integrity.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateIni |
Start date |
DateTime |
dateEnd |
End date |
DateTime |
monthIni |
Start month, expressed as a value between 1 and 12 |
Int32 |
monthEnd |
End month, expressed as a value between 1 and 12 |
Int32 |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
Example
Dim saftIntegrity as PHCResult = SDK.SAFT.ValidatePartialAnnualSAFT(2021,new Date(2021,1,1),new Date(2021,12,31),1,3,"12345",Portarias.Cod_302_2016)
For each entity as KeyValueVO in saftIntegrity.Result
For Each message as MessageVO in entity.value.messages
msgList.Add(New MsgInfo(message.messageCodeLocale))
Next
Next
If isVoid(msgList) then
msgList.Add(New MsgInfo("SAFT integrity is correct"))
end if
Return MsgList
Description
Checks accounting SAFT integrity.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateEnd |
Exercise end date |
DateTime |
cae |
Nace Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_302_2016) |
Example
Dim saftIntegrity as PHCResult = SDK.SAFT.ValidateAccountingSAFT(2021,new Date(2021,1,1),new Date(2021,12,31),"12345",Portarias.Cod_302_2016)
For each entity as KeyValueVO in saftIntegrity.Result
For Each message as MessageVO in entity.value.messages
msgList.Add(New MsgInfo(message.messageCodeLocale))
Next
Next
Return MsgList
Description
Checks integrated SAFT integrity.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateEnd |
Exercise end date |
DateTime |
cae |
Nace Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_302_2016) |
Example
Dim saftIntegrity as PHCResult = SDK.SAFT.ValidateIntegratedSAFT(2021,new Date(2021,1,1),new Date(2021,12,31),"12345",Portarias.Cod_302_2016)
For each entity as KeyValueVO in saftIntegrity.Result
For Each message as MessageVO in entity.value.messages
msgList.Add(New MsgInfo(message.messageCodeLocale))
Next
Next
Return MsgList
Description
Checks auto-billing SAFT integrity.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateIni |
Start date |
DateTime |
dateEnd |
End date |
DateTime |
supplierStamp |
Supplier stamp |
String |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
Example
Dim saftIntegrity as PHCResult = SDK.SAFT.ValidateAutoInvoiceSAFT(2021,new Date(2021,1,1),new Date(2021,12,31),"e55-4818-83a7-2378310250f","12345",Portarias.Cod_302_2016)
For each entity as KeyValueVO in saftIntegrity.Result
For Each message as MessageVO in entity.value.messages
msgList.Add(New MsgInfo(message.messageCodeLocale))
Next
Next
If isVoid(msgList) then
msgList.Add(New MsgInfo("SAFT integrity is correct"))
end if
Return MsgList
ValidatePartialAutoInvoiceSAFT
Description
Checks partial auto-billing SAFT integrity.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateIni |
Start date |
DateTime |
dateEnd |
End date |
DateTime |
monthIni |
Start month, expressed as a value between 1 and 12 |
Int32 |
monthEnd |
End month, expressed as a value between 1 and 12 |
Int32 |
supplierStamp |
Supplier stamp |
String |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
Example
Dim saftIntegrity as PHCResult = SDK.SAFT.ValidatePartialAutoInvoiceSAFT(2021,new Date(2021,1,1),new Date(2021,12,31),1,4,"e55-4818-83a7-2378310250f","12345",Portarias.Cod_302_2016)
For each entity as KeyValueVO in saftIntegrity.Result
For Each message as MessageVO in entity.value.messages
msgList.Add(New MsgInfo(message.messageCodeLocale))
Next
Next
If isVoid(msgList) then
msgList.Add(New MsgInfo("SAFT integrity is correct"))
end if
Return MsgList
Description
Generates monthly SAFT into application's export directory.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
month |
Month, expressed as a value between 1 and 12 |
Int32 |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
Example
'Sends SAFT file by e-mail
'First creates SAFT file
Dim result as PHCResult = SDK.SAFT.GenerateMonthSAFT(2021,1,"12345",Portarias.Cod_302_2016)
If Not result.HasMsgErrors
'Then sends the e-mail
Dim filename as string = result.scalarResult.stringResult
Dim emailAttachments as New List(Of FileAttachment)
emailAttachments.Add(sdk.FileUtil.getFile(filename))
if sdk.email.send("from@phcsoftware.com", "to@phcsoftware.com", "SAFT file", "Month SAFT attached", false, emailAttachments)
Return New MsgInfo("Mail has been sent")
end if
Else
Return New MsgInfo(result.messages(0).messageCodeLocale)
End If
Description
Generates partial monthly SAFT into application's export directory.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
dateIni |
Start date |
DateTime |
dateEnd |
End date |
DateTime |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
Example
'Sends SAFT file by e-mail
'First creates SAFT file
Dim result as PHCResult = SDK.SAFT.GeneratePartialMonthSAFT(New Date(2021,1,1),New Date(2021,1,15),"12345",Portarias.Cod_302_2016)
If Not result.HasMsgErrors
'Then sends the e-mail
Dim filename as string = result.scalarResult.stringResult
Dim emailAttachments as New List(Of FileAttachment)
emailAttachments.Add(sdk.FileUtil.getFile(filename))
if sdk.email.send("from@phcsoftware.com", "to@phcsoftware.com", "SAFT file", "Partial Month SAFT attached", false, emailAttachments)
Return New MsgInfo("Mail has been sent")
end if
Else
Return New MsgInfo(result.messages(0).messageCodeLocale)
End If
Description
Generates annual SAFT into application's export directory.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateIni |
Exercise start date |
DateTime |
dateEnd |
Exercise end date |
DateTime |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
Example
'Sends SAFT file by e-mail
'First creates SAFT file
Dim result as PHCResult = SDK.SAFT.GenerateAnnualSAFT(2021,new Date(2021,1,1),new Date(2021,12,31),"12345",Portarias.Cod_302_2016)
If Not result.HasMsgErrors
'Then sends the e-mail
Dim filename as string = result.scalarResult.stringResult
Dim emailAttachments as New List(Of FileAttachment)
emailAttachments.Add(sdk.FileUtil.getFile(filename))
if sdk.email.send("from@phcsoftware.com", "to@phcsoftware.com", "SAFT file", "Annual SAFT attached", false, emailAttachments)
Return New MsgInfo("Mail has been sent")
end if
Else
Return New MsgInfo(result.messages(0).messageCodeLocale)
End If
GeneratePartialAnnualSAFT
Description
Generates partial annual SAFT into application's export directory.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateIni |
Exercise start date |
DateTime |
dateEnd |
Exercise end date |
DateTime |
monthIni |
Start month, expressed as a value between 1 and 12 |
Int32 |
monthEnd |
End month, expressed as a value between 1 and 12 |
Int32 |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
Example
'Sends SAFT file by e-mail
'First creates SAFT file
Dim result as PHCResult = SDK.SAFT.GeneratePartialAnnualSAFT(2021,new Date(2021,1,1),new Date(2021,12,31),1,3,"12345",Portarias.Cod_302_2016)
If Not result.HasMsgErrors
'Then sends the e-mail
Dim filename as string = result.scalarResult.stringResult
Dim emailAttachments as New List(Of FileAttachment)
emailAttachments.Add(sdk.FileUtil.getFile(filename))
if sdk.email.send("from@phcsoftware.com", "to@phcsoftware.com", "SAFT file", "Partial annual SAFT attached", false, emailAttachments)
Return New MsgInfo("Mail has been sent")
end if
Else
Return New MsgInfo(result.messages(0).messageCodeLocale)
End If
Description
Generates auto-billing SAFT into application's export directory .
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateIni |
Exercise start date |
DateTime |
dateEnd |
Exercise end date |
DateTime |
supplierStamp |
Supplier stamp |
String |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
Example
'Sends SAFT file by e-mail
'First creates SAFT file
Dim result as PHCResult = SDK.SAFT.GenerateAutoInvoiceSAFT(2021,new Date(2021,1,1),new Date(2021,12,31),"e55-4818-83a7-2378310250f","12345",Portarias.Cod_302_2016)
If Not result.HasMsgErrors
'Then sends the e-mail
Dim filename as string = result.scalarResult.stringResult
Dim emailAttachments as New List(Of FileAttachment)
emailAttachments.Add(sdk.FileUtil.getFile(filename))
if sdk.email.send("from@phcsoftware.com", "to@phcsoftware.com", "SAFT file", "Autoinvoice SAFT attached", false, emailAttachments)
Return New MsgInfo("Mail has been sent")
end if
Else
Return New MsgInfo(result.messages(0).messageCodeLocale)
End If
GeneratePartialAutoInvoiceSAFT
Description
Generate partial auto-billing SAFT into application's export directory .
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateIni |
Exercise start date |
DateTime |
dateEnd |
Exercise end date |
DateTime |
monthIni |
Start month, expressed as a value between 1 and 12 |
Int32 |
monthEnd |
End month, expressed as a value between 1 and 12 |
Int32 |
supplierStamp |
Supplier stamp |
String |
cae |
NACE Code |
String |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
Example
'Sends SAFT file by e-mail
'First creates SAFT file
Dim result as PHCResult = SDK.SAFT.GeneratePartialAutoInvoiceSAFT(2021,new Date(2021,1,1),new Date(2021,12,31),1,4,"e55-4818-83a7-2378310250f","12345",Portarias.Cod_302_2016)
If Not result.HasMsgErrors
'Then sends the e-mail
Dim filename as string = result.scalarResult.stringResult
Dim emailAttachments as New List(Of FileAttachment)
emailAttachments.Add(sdk.FileUtil.getFile(filename))
if sdk.email.send("from@phcsoftware.com", "to@phcsoftware.com", "SAFT file", "Partial Autoinvoice SAFT attached", false, emailAttachments)
Return New MsgInfo("Mail has been sent")
end if
Else
Return New MsgInfo(result.messages(0).messageCodeLocale)
End If
Description
Generates inventories into application's export directory.
Return Function
PHCResult
Parameters
Name |
Description |
Type |
year |
Fiscal Year |
Int32 |
dateEnd |
Exercise end date |
DateTime |
excludedWareHouses |
List of warehouses to exclude.
The intention is only to include warehouses that reflect sales stock, thus being able to exclude merchandise repair warehouses. |
List(Of Integer) |
ordinance |
Ordinance |
Int32
or
ENUM PHCBusinessLayer. Portarias (Cod_274_2013, Cod_302_2016) |
Example
'Sends SAFT file by e-mail
'First creates SAFT file
Dim result as PHCResult = SDK.SAFT.GenerateInventories(2021,Date.Now,New List(Of Integer)({1}),InventarioPortarias.Cod_028_2019)
If Not result.HasMsgErrors
'Then sends the e-mail
Dim filename as string = result.scalarResult.stringResult
Dim emailAttachments as New List(Of FileAttachment)
emailAttachments.Add(sdk.FileUtil.getFile(filename))
if sdk.email.send("from@phcsoftware.com", "to@phcsoftware.com", "Inventories file", "Inventories file attached", false, emailAttachments)
Return New MsgInfo("Mail has been sent")
end if
Else
Return New MsgInfo(result.messages(0).messageCodeLocale)
End If