...
Class /EDGE/CL_EDOC_SII_MAP_FE_L_11
- GET_ESTRUCTURA_XML method: Call to the super->get_estructura_xml and me->get_estructura_xml_1_1 methods with the new parameter iv_canarias = iv_canarias.
- Method GET_ESTRUCTURA_XML_1_1:
1. Parameter iv_canarias is added in the signature of the method.
2. The call to the method get_detalle_exenta is made with the new parameter importing iv_canarias.
Class /EDGE/CL_EDOC_SII_MAP_FE_L
- Method GET_ESTRUCTURA_XML:
1. When the non-exempt breakdown for Delivery, Service and Invoice Breakdown occurs, the following code is entered:
gv_notno_exempt exenta = abap abap_true.
IF iv_canarias EQ abap IF iv_canarias EQ abap_true.
CONTINUE.
ENDIF ENDIF.
With this, when iv_canarias comes informed with X, the non-exempt breakdown will not be made. Thus we reduce the mapping of the AEAT since the labels of this block change with respect to the XML of the Canary Islands and this part of code cannot be reused. With the global variable gv_not_exempt = X we know during the execution that the breakdown is not exempt.
2. In the call to the method get_type_invoice the optional parameter iv_canarias is added.
3. In the call to the get_special_regime method the optional parameter iv_canarias is added.
4. The call to the get_impositive_period_method is made with the new parameter iv_canarias.
5. The accesses to the table of VAT indicators /EDGE/SII_MP_013, are grouped in several methods in the utilities class, /edge/cl_sii_utilities, where according to the value of parameter iv_canarias, the table /EDGE/SII_MP_013 is read for mappings of the AEAT or /edge/sii_ca_003 for mappings of the Canary Islands.
6. When the general BAdI is called to determine whether an invoice is for self-consumption, a division is made. If the mapping comes from a class in the Canary Islands, the badi of the Canary Islands is called to determine if the invoice is for self-consumption, if the mapping is AEAT, the BAdI /edge/badi_sii_mapeos_gen is still called, get_auto_consumption method.
7. For the Real Estate Data mapping, the condition is set that this block is only mapped if the mapping does not come from the Canary Islands. Since in the mapping class of the Canary Islands this block will be mapped with possible values different from those of the AEAT.
8. In the call to the BAdI /edge/badi_sii_mape_tercero_fe method determina_contraparte the parameter iv_canarias is passed to it.
9. The ranges lr_mwskz_not_subject, lr_mwskz and the table lt_mwskz_inv_s_pas become global objects defined in the mapping class /EDGE/CL_EDOC_SII_MAP as attributes to be reused in the classes they inherit from it.
10. Access to the /edge/sii_mp_013 indicator table to retrieve the indicator type is grouped into three different methods in the /edge/cl_sii_utilities class to retrieve them from the AEAT indicator table (/edge/sii_mp_013) or the Canary Islands indicator table (/edge/sii_ca_003).
11. The call to the method get_type_not_subject of the BAdI /edge/badi_sii_mapeos_emi is made with the new importing parameter iv_canarias.
12. In the call to the get_cause_exemption method of the BAdI /edge/badi_sii_mapeos_emi, a new optional importing parameter iv_canarias is added. This parameter is a boolean that will be informed with X when its call is being executed from a Canarian mapping class. When this happens, the exemption cause to be determined by the VAT/IGIC indicator will be taken from the /edge/sii_ca_003 table instead of /edge/sii_mp_013 as is done for the AEAT.
13. In order to determine whether an invoice is for self-consumption, a new BAdI of the Canary Islands is called if the mapping is Canarian. If it is still a peninsular mapping, the call to the BAdI to determine if it is self-consumption does not vary:
Class /EDGE/CL_EDOC_SII_MAP_FE_BL
- Method get_id_invoice: In the call to the method /edge/cl_sii_utilities=>get_id_invoice the new parameter iv_canarias is added.
Class /EDGE/CL_EDOC_SII_MAP_FE_IL
...
- Get_id_invoice method: The call to the get_id_invoice method is made with the new parameter iv_canarias. (Not applicable because the method is not used)
Self-consumption
In the BAdI /EDGE/BADI_SII_MAPEOS_EMI method GET_DESGLOSE_AUTO_CONS, a new export parameter is added to indicate that the mapping goes by exempt breakdown. Within this method, this new parameter will be marked as X if the breakdown is non-exempt. In this way in the breakdown of Canary Islands for self-consumption (/EDGE/CL_SII_MAP_FE_CA_L_11) it will be possible to know that the breakdown is not exempt.
In the mapping class of the Canary Islands, the mapping will be carried out for the breakdown of self-consumption when this is not exempt. The rest of the breakdown is reused from the AEAT mapping.
Adjustments already mapped fields in AEAT for the Canary Islands:
It may be that the client wants to define a different mapping for the AEAT than for the Canary Islands. The mapping of the Canary Islands reuses the mapping defined for the AEAT using inheritance in its methods. In this way, initially, the XML fields of the Canary Islands that exist in the XML of the AEAT take exactly the same mapping as in the AEAT.
If it is the case that the mapping for the Canary Islands is different, new BAdIs (BAdIs for the Canary Islands) have been created to overwrite the AEAT mapping and define a specific one for the Canary Islands. For outgoing invoices, the fields whose mappings can be modified for the Canary Islands are the following:
- Issuer Invoice Serial Number
- Description
- External Ref
- 2_7.3
- Previous Rule GGEE or REDEME or Competition
- Real Estate Data
- Amount Transmission Real Estate
- Issued By Third Parties Or Recipient
- Third and Sixth Additional Disp Billing and Organized Gas Market
- InvoiceWithoutIdentityRecipientArticle6.1.d
- Entity Succeeded
ISU/FICA Issued
Class /EDGE/CL_SII_MAP_FICA_L_11
- GET_ESTRUCTURA_XML method: Call to the super->get_estructura_xml and me->get_estructura_xml_1_1 methods with the new parameter iv_canarias = iv_canarias.
- Method GET_ESTRUCTURA_XML_1_1:
1. Parameter iv_canarias is added in the signature of the method.
2. The call to the method get_detalle_exenta is made with the new parameter importing iv_canarias.
Class /EDGE/CL_EDOC_SII_MAP_FICA_L
- Method GET_ESTRUCTURA_XML:
1. When the non-exempt breakdown for Delivery, Service and Invoice Breakdown occurs, the following code is entered:
gv_not_exempt = abap_true.
IF iv_canarias EQ abap_true.
CONTINUE.
ENDIF.
With this, when iv_canarias comes informed with X, the non-exempt breakdown will not be made. Thus we reduce the mapping of the AEAT since the labels of this block change with respect to the XML of the Canary Islands and this part of code cannot be reused. With the global variable gv_not_exempt = X we know during the execution that the breakdown is not exempt.
2. In the call to the method get_type_invoice the optional parameter iv_canarias is added.
3. In the call to the get_special_regime method the optional parameter iv_canarias is added.
4. For the Real Estate Data mapping, the condition is set that this block is only mapped if the mapping does not come from the Canary Islands.
5. In the call to the BAdI /edge/badi_sii_mapeos_fe_sd method get_datos_contraparte the parameter iv_canarias is passed.
6. The call to the get_cause_exemption method is made with the new parameter iv_canarias reported. (3 calls)
7. For the Real Estate Data mapping, the condition is set that this block is only mapped if the mapping does not come from the Canary Islands. Since in the class of mappings of the Canary Islands this block will be mapped with possible values different from those of the AEAT.
8. In the call to the method es_no_subject of the BAdI /edge/badi_sii_mapeos_fe_sd_cl parameter iv_canarias is added.