function setEliminarRecibosDuplicados() { $msg = "============= PURGANDO FOLIOS DUPLICADOS AL " . date("Y-m-d") . "\r\n"; $sql = "SELECT idoperaciones_recibos,\r\n\t\t\t\tCOUNT(idoperaciones_recibos) AS 'repetidos' FROM operaciones_recibos\r\n\t\t\t\tGROUP BY idoperaciones_recibos\r\n\t\t\t\tHAVING repetidos>1 "; $rs = mysql_query($sql, cnnGeneral()); while ($rw = mysql_fetch_array($rs)) { $SQLoD = "SELECT idoperaciones_recibos, numero_socio, fecha_operacion FROM operaciones_recibos\r\n\t\t\t\t\tWHERE idoperaciones_recibos = " . $rw["idoperaciones_recibos"] . "\r\n\t\t\t\t\tORDER BY fecha_operacion ASC\r\n\t\t\t\t\tLIMIT 0,1"; $DFol = obten_filas($SQLoD); $xRec = new cReciboDeOperacion(false, false, $DFol["idoperaciones_recibos"]); $msg .= $xRec->setCambiarCodigo(); unset($DFol); } return $msg; }