Ok first customizations done:
Added 3 fields to suppliers Table becouse of the needs of our country tax authority
legalcode (id of the supplier in the records of tax authority)
legalname (name of the supplier in the records of tax authority, not equal to fantasy/common name)
legalactivity (authorized business sector by the tax authority, example "sale of computer parts")
Added 2 fields to supptrans table
legaltype (type of the supplier document, needed for the mensual report to the tax authority, examples "Electronic invoice", "Paper Invoice", "Debit note")
sequence (numeric sequence used in the mensual report to record the purchases of the month. Foreing purchases are excluded of this report so the sequence can be null)
Added Table legaldocumenttype to record the document types valid in the country
typeid (code of the document)
legalname (name of the document type examples {"Electronic invoice","Electronic Credit Note"})
generictype (can be Purchase, Reverse-Purchase, Sale, Reverse-Sale)
legalcode (code in the records of tax authority of the document type. Needed in the mensual report to the tax authority)
Added LegalDocumentTypes.php script to maintain legaldocumenttype table
modified SupplierInvoice.php script, now you can choose the period in which the invoice will be registered or use the invoice date to determine the period (current method)
is allowed to manually enter the sequence of purchases
You can select the type of document based on the records in the table legaldocumenttype the generic type "Purchase"
The same modifications were added to the script SupplierCredit.php except that searches for generic type "Reverse-Purchase"
Now im working on the required purchase reports
Here some images