public function processLanc() { $_lancamentos = new Financeiro_DataView_Lancamento_MapperView(); $_where = new ZendT_Db_Where(); $_where->addFilter('fc_lancamento.dt_lanc', ZendT_Type_Date::nowDate(), '<='); if (Auth_Session_User::getInstance()->getIdEmpresa()) { $_where->addFilter('fc_lancamento.id_empresa', Auth_Session_User::getInstance()->getIdEmpresa()); } $_where->addFilter('fc_lancamento.vlr_saldo', '', '=', '', true); $_lancamentos->findAll($_where); while ($_lancamentos->fetch()) { $_lancamentos->update(); } }
public function cancelar($idPedido = false) { if (!$idPedido) { $idPedido = $this->getIdPedido(); } $_lancamento = new Financeiro_DataView_Lancamento_MapperView(); $_where = new ZendT_Db_Where(); $_where->addFilter('item_pedido.id_pedido', $idPedido); $_itemLanc = new Vendas_DataView_ItemLanc_MapperView(); $_itemLanc->findAll($_where, '*'); while ($_itemLanc->fetch()) { $_lancamento->setId($_itemLanc->getIdLancamento())->retrieve()->cancelar(); } $_where = new ZendT_Db_Where(); $_where->addFilter('pagto_pedido.id_pedido', $idPedido); $_pagtoLanc = new Vendas_DataView_PagtoLanc_MapperView(); $_pagtoLanc->findAll($_where, '*'); while ($_pagtoLanc->fetch()) { $_lancamento->setId($_pagtoLanc->getIdLancamento())->retrieve()->cancelar(); } return true; }