Last active
December 16, 2016 12:18
-
-
Save suspecie/a2184e146b93571e240b3c52ba63d886 to your computer and use it in GitHub Desktop.
LANCAMENTO CONTABIL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO AccountingBalanceSheet(id_balanco_contabil, id_empresa, tipo_balanco, dt_saldo, stat_fechamento, stat_primeira_abertura, stat_abertura_provisoria, stat) SELECT id_balanco, id_empresa, CASE tipo_balanco WHEN '0' then 'A' WHEN '1' then 'E' WHEN '2' then 'N' END AS tipo_balanco, dt_saldo, IF(status_fechamento = 1, '1', '0'), IF(primeiro_lancamento = 1, '1', '0'), IF(provisoria = 1, '1', '0'), stat FROM con_balanco; | |
INSERT INTO AccountingBalanceSheetAccountBalance(id_balanco_contabil_conta_contabil_saldo, id_balanco_contabil, id_conta_contabil, id_conta_contabil_funcao, conta_saldo, stat) SELECT id_balanco_saldo, id_balanco, id_conta_interno, null, saldo_conta, stat FROM con_balanco_saldo WHERE id_conta_interno > 2078; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment