[
{
"operation": "modify-overwrite-beta",
"spec": {
"items": {
"*": {
"codigoNcm_": "=split('\\.', @(1,codigoNcm))",
"codigo_Ncm": "=join('', @(1,codigoNcm_))",
"codigo_Ncm2": "=substring(@(1,codigo_Ncm),0,8)",
"idExterno": "=concat('pdvsync-ncm-', @(1,id),'-', @(1,dataUltimaAtualizacao))",
"chave": null,
"fonte": null,
"situacao": 1,
/*Nacional*/
"aliquotaNacional_str": "=toString(@(1,aliquotaNacional))",
"aliquotaNacional_arr": "=split('\\.',@(1,aliquotaNacional_str))",
"aliquotaNacional": "=join(',',@(1,aliquotaNacional_arr))",
/*Estadual*/
"aliquotaEstadual_str": "=toString(@(1,aliquotaEstadual))",
"aliquotaEstadual_arr": "=split('\\.',@(1,aliquotaEstadual_str))",
"aliquotaEstadual": "=join(',',@(1,aliquotaEstadual_arr))",
/*Importada*/
"aliquotaImportada_str": "=toString(@(1,aliquotaImportada))",
"aliquotaMunicipalaliquotaImportada_arr": "=split('\\.',@(1,aliquotaImportada_str))",
"aliquotaImportada": "=join(',',@(1,aliquotaImportada_arr))",
"chave": null/*Municipal*/
"aliquotaMunicipal_str": "=toString(@(1,aliquotaMunicipal))",
"fontealiquotaMunicipal_arr": null"=split('\\.',@(1,aliquotaMunicipal_str))",
"situacaoaliquotaMunicipal": "=join(',',@(1,aliquotaMunicipal_arr))"
}
}
}
},
{
"operation": "shift",
"spec": {
"items": {
"*": {
"idExterno": "idExterno[&1]",
"id": "items[&1].[0].idRetaguarda",
"codigo_NcmNcm2": "items[&1].[0].codigoNcm",
"codigoExcecao": "items[&1].[0].codigoExcecao",
"aliquotaNacional": "items[&1].[0].aliquotaNacional",
"aliquotaEstadual": "items[&1].[0].aliquotaEstadual",
"codigoCest": "items[&1].[0].codigoCest",
"aliquotaImportada": "items[&1].[0].aliquotaImportada",
"aliquotaMunicipal": "items[&1].[0].aliquotaMunicipal",
"chave": "items[&1].[0].chave",
"fonte": "items[&1].[0].fonte",
"situacao": "items[&1].[0].situacao"
}
}
}
},
{
"operation": "default",
"spec": {
"_attr_access": "items",
"items[]": {
"*[]": {
"*": {
"idInquilino": "{{ID_INQUILINO}}",
"idProprietario": "{{MASTER_ID_PROPRIETARIO}}",
"loteOrigem": "{{LOTE_ORIGEM}}",
"situacao": 1
}
}
}
}
] }
}] |