[
{
"operation": "modify-overwrite-beta",
"spec": {
"items": {
"*": {
"idExternoidExternoIcms": "=concat('pdvsync-icms-', @(1,id),'-', @(1,dataUltimaAlteracao))",
"idExternoSt": "=concat('pdvsync-st-', @(1,id),'-', @(1,dataUltimaAlteracao))",
"idRetaguardaIcms": "=concat(@(1,id),'-ICMS')",
"idRetaguardaSt": "=concat(@(1,id),'-ST')",
"aliquota_check_modalidate": "=concat(@(1,aliquota),'')",
"aliquota_str": "=concat(@(1,aliquota), '')",
"aliquota_arr": "=split('\\.',@(1,aliquota_str))",
"aliquota": "=join(',', @(1,aliquota_arr))",
"reducaoBaseCalculo_str": "=concat(@(1,reducaoBaseCalculo), '')",
"reducaoBaseCalculo_arr": "=split('\\.',@(1,reducaoBaseCalculo_str))",
"reducaoBaseCalculo": "=join(',', @(1,reducaoBaseCalculo_arr))",
"substituicaoTributaria": {
"icmsInterno_str": "=concat(@(1,icmsInterno), '')",
"icmsInterno_arr": "=split('\\.',@(1,icmsInterno_str))",
"icmsInterno": "=join(',', @(1,icmsInterno_arr))",
"ireducaoBaseCalculo_str": "=concat(@(1,reducaoBaseCalculo), '')",
"reducaoBaseCalculo_arr": "=split('\\.',@(1,ireducaoBaseCalculo_str))",
"reducaoBaseCalculo": "=join(',', @(1,reducaoBaseCalculo_arr))"
}
}
}
}
},
{
"operation": "shift",
"spec": {
"items": {
"*": {
//ICMS
"idExternoIcms": "items.[&1].[0].idExterno",
"idExternoSt": "items.[&1].[1].idExterno",
"idRetaguardaIcms": "items.[&1].[0].idRetaguarda",
"aliquota": "items.[&1].[0].aliquotaTributo",
"reducaoBaseCalculo": "items.[&1].[0].reducaoBaseCalculo",
//COMPARTILHADO COM ICMS E ST
"modalidadeVarejo": ["items.[&1].[0].modalidade", "items.[&1].[1].modalidade"],
"simboloVarejo": ["items.[&1].[0].simbolo", "items.[&1].[1].simbolo"],
/*ST*/
"idRetaguardaSt": "items.[&1].[1].idRetaguarda",
"substituicaoTributaria": {
"icmsInterno": "items.[&2].[1].aliquotaTributo",
"reducaoBaseCalculo": "items.[&2].[1].reducaoBaseCalculo"
}
}
}
}
},
{
"operation": "defaultshift",
"spec": {
"items": {
"*": {
"*": {
"_attr_access "@": "items",
"items[]" "idExterno": "idExterno[]"
}
}
}
}
},
{
"operation": "default",
"spec": {
"_attr_access": "items",
"*items[]": {
"*": {
"idInquilino": "{{ID_INQUILINO}}",
"idProprietario": "{{MASTER_ID_PROPRIETARIO}}",
"loteOrigem": "{{LOTE_ORIGEM}}",
"indiceTributoImpressora": "",
"tipo": 0,
"situacao": 1
}
}
}
}
}
] |