SAT.Report.ISR (sat_mexico v0.2.0)
View SourceGet a summarized
report for withholdings ISR taxes.
Summary
Functions
Round according to SAT: fractional part > 0.50 → up; else (≤ 0.50) → down.
Apply SAT rounding to each {tax_id, gross_amount, tax_withheld} tuple, returning {tax_id, rounded_gross, rounded_withheld} with integer values.
Apply SAT rounding to each {tax_id, gross_amount, tax_withheld} tuple, returning {tax_id, rounded_gross, rounded_withheld} with integer values. The output is a list of maps with the following keys
Expects a directory with the XML
invoices to build the a grouped list.
Supports both individual XML files and ZIP files containing XML files.
Expects the output obtained via withholdings/1
to return the summarized result.
Expects the output obtained via withholdings/1
to return the summarized result.
This helps to get the right values to do the details for withheld tax by a moral person.
Functions
Round according to SAT: fractional part > 0.50 → up; else (≤ 0.50) → down.
Apply SAT rounding to each {tax_id, gross_amount, tax_withheld} tuple, returning {tax_id, rounded_gross, rounded_withheld} with integer values.
@spec round_withholdings_detailed(withholdings :: map()) :: []
Apply SAT rounding to each {tax_id, gross_amount, tax_withheld} tuple, returning {tax_id, rounded_gross, rounded_withheld} with integer values. The output is a list of maps with the following keys:
tax_id
: The tax ID of the person who is withholding the tax.incoming
: The total amount of the invoice.withheld
: The total amount of the tax withheld.
@spec withholdings(path_dir :: String.t(), nested_lookup :: boolean()) :: withholdings :: map() | {:error, message :: String.t()}
Expects a directory with the XML
invoices to build the a grouped list.
Supports both individual XML files and ZIP files containing XML files.
@spec withholdings_summarize(data :: map()) :: withholdings :: []
Expects the output obtained via withholdings/1
to return the summarized result.
This helps to get the right values to do the details for withheld tax by a moral person.
Expects the output obtained via withholdings/1
to return the summarized result.
This helps to get the right values to do the details for withheld tax by a moral person.
The output is a list of maps with the following keys:
tax_id
: The tax ID of the person who is withholding the tax.incoming
: The total amount of the invoice.withheld
: The total amount of the tax withheld.