[read]
master.db=csv
master.filename=_produto_loteexpedicao_referencias.sort.codigos.csv
master.select={"keys": ["MD", "REFERENCIA", "REFERENCIA"]}

db=pccon
sql=
  SELECT
    cp.CodItemProd
  , tp.CodTam
  , cp.CodCor
  , ? referencia
  FROM TAB_CorDoItemDeProducao cp
  JOIN TAB_TamanhoDoItemDeProducao tp
    ON tp.coditemprod = cp.coditemprod
  WHERE cp.coditemprod =
  ( SELECT TOP 1
      ipc.CodItemProd
    FROM TAB_ItemDeProducao ipc
    WHERE ipc.CodItemProd = 'PA' + ?
       OR ipc.CodItemProd = 'MD' + ?
     order by
       ipc.CodItemProd
  )

[variables]
nivel_estrutura={"value": "1"}

[functions]
tam={"translate":
  { "select": "NOVO"
  , "type": "t"
  , "field_default": "codtam"
  , "from": "tamanho.translate.csv"
  , "where": [["ORIGINAL", "codtam"]]
  }}
cor={"translate":
  { "select": "COR_SORTIMENTO"
  , "type": "t"
  , "field_default": "codcor"
  , "from": "cor.fixo.csv"
  , "where": [["CODIGO_VELHO", "codcor"]]
  }}

[columns]
nivel_estrutura=t
referencia=t
CodItemProd=t
Tam=t
Cor=t
CodTam=t
CodCor=t

[post_process]
external1={ "id": "tecidos", "script": "uniqtuples.py", "args": ["_insumo_tecido_loteexpedicao_tamanho_cor"] }
external2={ "id": "insumos", "script": "uniqtuples.py", "args": ["_insumo_nao_tecido_loteexpedicao_tamanho_cor"] }

Add all components for code translation
Add all components for code translation
