1. Make sure you have run the compatibility program UPDFIS recently. If you have not, update it according to instructions in Technical Newsletter UPDFIS – Tax Database Update.
  2. Access the Invoicing module with a system administrator password and select option Updates/Invoicing/Municipal NFS-e (SPEDNFSE). Run the routine. This routine tries to access TOTVS Service SPED. A screen displays the Electronic Invoice Configuration Wizard.
  3. Read the text messages carefully and answer all the questions.


Note:

Enter the URL address of TOTVS Service SPED server following the standard used in internet browsers.  You must indicate the address considering the hardware where Application Server – Protheus ERP is. Thus, if you use the local host, it means both ERP Server and TOTVS Service SPED are in the same hardware. 



Main Fields

- Digital certificate slot

Enter the storage slot in digital certificate HSM.

- Digital certificate label

Enter storage label in digital certificate HSM.

- File name of HSM

Enter the file name of communication library (client) of HSM. This library is provided by the manufacturer (SAFENET) and must be below the root path of Application Server.

- Digital certificate password.

Enter the digital certificate password or the access PIN to HSM.

Note:

TOTVS Service SPED is prepared to work with digital certificates type Privacy Enhanced Mail (PEM) due to its compatibility with Windows and Linux systems. However, you may receive from your Certificate Authority or tax authorities, a Personal Information Exchange certificate (pfx or p12). If that occurs, first change the digital certificate type and then enter certificate name and password. After the confirmation of digital certificate acceptance, check the folder certs, below TOTVS Service SPED root path. In this folder, there are two digital certificates which can be used to inform the SSL key mentioned in TOTVS Service SPED installation.

The system is also prepared to use the HSM digital certificate, recommended by the Federal Revenue Service of Brazil due to the security it offers. It is mandatory to issuers with more than 1,000 invoices/day.

ByYou Application Server provides integration with SAFENET HSM. The models tested are:

  • LUNA SA
  • LUNA SP
  • LUNA PCI
  • LUNA PCM
  • External PROTECTSERVER
  • PROTECTSERVER Gold
  • ProtectHost EFT


Note:

For NFS-e to work properly, the digital certificate in HSM must be imported with the following directions:

  • CKA_PRIVATE
  • CKA_VERIFY
  • CKA_SIGN


1. If all steps are followed correctly, the system is able to query the source Municipality.

2. Test it through NFS-e Query. If you do not succeed, review steps mentioned above.

3. Click Parameters and configure them according to instructions below:

- Environment?

Indicate whether it is a Production or Test environment.

- NFS-e Version?

Indicate the version of the Municipal Electronic Service Invoice layout.

4. Configure requested data and confirm.

5. Click Transmission, in the screen footer.

A description screen is displayed for the transfer of Invoices to the Municipality.

In this moment, the system has already performed services in source SEFAZ (the SEFAZ is identified through the company register – SIGAMAT). These services are displayed so you decide to make the transfer to the Source Municipality.


Attention:

In this screen, the Observation description is informed only by some SEFAZ. It provides an estimate on service return in case of downtime.


6. In case of any error in configuration or information of company register (SM0) in item Deployment, a message is displayed with company identification data, considering the invalid information.

7. Click Next.

8. Define ranges of Invoices to be transferred, the same you would do for print.

- NF Series

Enter the series of invoice indicated in parameter MV_ESPECIE.

- Initial Invoice

Enter the initial invoice to be sent.

- Final Invoice

Enter the final invoice to be sent.

9. Check data and click After the transmission range is defined, the system runs the execblock XmlNfeSef (NFESEFAZ.PRW). Proportionally, this execblock is similar to NfExamp. It implements and generates the XML file. Therefore, all message personalization in the Invoice must be replicated, in the tags allowed by tax authorities. The Invoice will be rejected and not sent if the personalization changes the XSD (XML Schema Definition), the file with definitions in XML Schema language defined by TOTVS and/or tax authorities.

10. If the process ends successfully, a message informs the transmission from Protheus to TOTVS Service SPED was finished and that you must check whether invoices were authorized by SEFAZ through routine Monitor. The number of invoices sent and the time are also displayed.

11. Click Finish.


After the transfer, the application of integration with Electronic Service Invoice (TOTVS Service SPED) manages the queue of invoices received and integrates with the Municipality. This transaction can be monitored through the option Monitor, in the routine footer.


This option displays:


After transmission, the following options are displays on the right:

Displays the XML file that has been (or will be) sent to the Municipality. This process is important during customization of Rdmake to generate XML or to check missing information in system registers, as informed in topic Deployment Process – Step 2 – Initial Tests.

If the NFS-e is not signed, a Schema XML validation message is added if any problem occurs in its structure. This is an English message, though.

Displays all attempts of transmission to the Municipality, events occurred and errors returned from the Municipality.

Validates the XML file that has been (or will be) sent to the Municipality. This process validates all schemas. If there is any incomplete information in the XML, it is displayed in the Schema validation message.


Attention:

According to taxpayer integration manual for NFS-e, an electronic invoice can be rejected even after it was sent to the source Municipality. The user-company must be prepared for that.



NFS-e Print - Municipality

An electronic invoice can only be printed after it is sent and the Municipality authorizes its issue.

You can print it in the Municipality website – City Finance Department.



Temporary Service Receipt (RPS) Print - Microsiga Protheus®

After you issue RPS and the Municipality authorizes it, you can print it two ways: integration with MS-Word® or graphic print routine.



Integration with MS-Word®

The routine provides a default model to print RPS, through a .DOT file. This layout can be changed as you see fit. Just open the .DOT file in MS-Word® and make the necessary changes.

This routine does not run in Linux environments because MS-Word® cannot be used. If you are in a Linux environment, use the graphic print routine.

Access the routine RPS Print for more information.

1. In Reports/Document Print/RPS Print, configure routine parameters:

- .DOT Directory?

Enter the directory where default print file (.DOT) is saved. Example: C:\MP8\SYSTEM\.

- .DOT File?

Enter the default print file name, including the .DOT extension. Ex.: RPS.DOT

- Initial Issue?

Select in the calendar or enter the initial issue date of RPS to be selected for print.

- Final Issue?

Select in the calendar or enter the final issue date of RPS to be selected for print.

- Initial Client?

Enter the code of initial client of RPS to be selected for print. If you want to select all RPS of the period, regardless of clients, leave this parameter blank.

- Final Client?

Enter the code of final client of RPS to be selected for print. If you want to select all RPS of the period, regardless of clients, enter ZZZZZZ.

- Concerning Automatic Option?

If the automatic option is selected in the next screen, enter:

Print: to automatically send the selected RPS to the printer.

Save: to save the selected RPS for future print.

- Destination Directory?

If the option Save was selected in the previous parameter, you must define a directory to save RPS generated. Example: C:\RPS\.

- Initial RPS?

Enter the number of initial RPS to select documents to print. If you want to process all RPS of previous selections, leave this parameter blank.

- Final RPS?

Enter the number of final RPS to select documents to print. If you want to process all RPS of previous selections, enter ZZZZZZ.

- Print Cancelled Documents?

Indicate whether cancelled documents must be considered when selecting RPS to print.

2. Click Confirm.

A new window displays all RPS selected through routine parameters. The left browser displays two print options:

- Manual

All RPS selected are processed and sent to the template file in MS-Word®, which can be edited.

- Automatic

All RPS displayed in the window are directly printed or saved for future print, as defined in report parameters.

Either in manual or automatic option, RPS is generated according to the model defined by the .DOT file.



Print by graphic routine

This routine offers graphic print of RPS, in a predefined layout  which cannot be changed.

For more information, access routine RPS Graphic Print.

1. In Reports/Document Print/RPS Graphic Print, a routine description window is displayed.

2. Click Parameters and configure them according to instructions below:

- Initial Date?

Select in the calendar or enter the initial issue date of RPS to be selected for print.

- Final date?

Select in the calendar or enter the final issue date of RPS to be selected for print.

- Initial Client?

Enter the code of initial client of RPS to be selected for print. If you want to select all RPS of the period, regardless of clients, leave this parameter blank.

- Final Client?

Enter the code of final client of RPS to be selected for print. If you want to select all RPS of the period, regardless of clients, enter ZZZZZZ.

- Initial RPS?

Enter the initial RPS number to select documents to print. If you want to process all RPS of previous selections, leave this parameter blank.

- Final RPS?

Enter the final RPS number to select documents to print. If you want to process all RPS of previous selections, enter ZZZZZZ.

- Number of Copies?

Enter the number of copies you want to generate for each RPS selected by the routine.

- Print Cancelled Documents?

Indicate whether cancelled documents must be considered when selecting RPS to print.

3. Click Confirm. The routine returns to the description window. Click Confirm again to start printing. RPS is generated in the number of copies defined in routine parameters.


Attention:

The logo used in RPS print is the same one used in Microsiga Protheus® reports. It must be in \SYSTEM directory and must have the following name:

LGRLXXZZ.BMP, where:

LGRL indicates the logo file name;

XX indicates the logo file company;

ZZ indicates the logo file branch;

If the logo file is the same for all branches, you just need the LGRLXX.BMP file, that is, only the company file.


Notes on the caption

Caption colors are changed at each interaction of the system with TOTVS Service SPED, and also in the following situations:

  1. When the NFS-e is sent to TOTVS Service Sped – NF sent;
  2. When the NFS-e sent has data integrity problems - NF not authorized;
  3. After NFS-e query - NF authorized.


Notes on some options

Enables you to change the filter without having to quit the routine and enter it again.

Displays the selected invoice. This option views the Outflow Invoice.