Return-path: <>
Envelope-to: miguel@ssf.com.mx
Delivery-date: Thu, 09 Jun 2016 12:36:15 -0500
Received: from mx26-02.smtp.antispamcloud.com ([148.251.71.2]:37961)
	by vishnu.hosting-mexico.net with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256)
	(Exim 4.87)
	id 1bB3s7-001961-14
	for miguel@ssf.com.mx; Thu, 09 Jun 2016 12:36:15 -0500
Received: from Debian-exim by mx26.antispamcloud.com with local (Exim 4.85)
	id 1bB3rS-0006oc-Jy
	for miguel@ssf.com.mx; Thu, 09 Jun 2016 19:35:18 +0200
X-Failed-Recipients: oavargas@globalgas.com.mx
Auto-Submitted: auto-replied
From: Mail Delivery System <Mailer-Daemon@mx26.antispamcloud.com>
To: miguel@ssf.com.mx
Subject: Mail delivery failed: returning message to sender
Message-Id: <E1bB3rS-0006oc-Jy@mx26.antispamcloud.com>
Date: Thu, 09 Jun 2016 19:35:18 +0200
X-Spam-Status: No, score=-0.7
X-Spam-Score: -6
X-Spam-Bar: /
X-Ham-Report: Spam detection software, running on the system "vishnu.hosting-mexico.net",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 root\@localhost for details.
 
 Content preview:  This message was created automatically by mail delivery software.
    A message that you sent could not be delivered to one or more of its recipients.
    This is a permanent error. The following address(es) failed: [...] 
 
 Content analysis details:   (-0.7 points, 5.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was blocked.
                             See
                             http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
                              for more information.
                             [URIs: antispamcloud.com]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at http://www.dnswl.org/, low
                             trust
                             [148.251.71.2 listed in list.dnswl.org]
X-Spam-Flag: NO

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  oavargas@globalgas.com.mx
    Unrouteable address

------ This is a copy of the message, including all the headers. ------

Return-path: <miguel@ssf.com.mx>
Received: from vishnu.hosting-mexico.net ([69.162.77.130])
	by mx26.antispamcloud.com with esmtps (TLSv1.2:DHE-RSA-AES256-SHA:256)
	(Exim 4.85)
	(envelope-from <miguel@ssf.com.mx>)
	id 1bB3rM-0006T9-VY
	for oavargas@globalgas.com.mx; Thu, 09 Jun 2016 19:35:18 +0200
Received: from [::1] (port=58526 helo=webmail.ssf.com.mx)
	by vishnu.hosting-mexico.net with esmtpa (Exim 4.87)
	(envelope-from <miguel@ssf.com.mx>)
	id 1bB3qp-0018sh-RX
	for oavargas@globalgas.com.mx; Thu, 09 Jun 2016 12:34:40 -0500
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Date: Thu, 09 Jun 2016 12:34:39 -0500
From: miguel@ssf.com.mx
To: oavargas@globalgas.com.mx
Subject: Queries de reportes de cargos y abonos
Message-ID: <a20228858e4c425a3a67f7a1e6f62ab0@ssf.com.mx>
X-Sender: miguel@ssf.com.mx
User-Agent: Roundcube Webmail/1.1.4
X-Filter-ID: s0sct1PQhAABKnZB5plbIY3Mdabc8zwflw6vUuIntBpvfl6SjJJ3CqYGbLlpJHuevGJXiiPkZQjd
 F3kjsKiXhWEAkFGnXHBL7EdCbcGlfJOzGPfml56UE70w6QbZ5q7Q+etI3X3TkjWXy6S3OYl6FIIw
 z6siUV12GKoXB/7lgaSvYlyAVmoRRCCY9MpQhi5WTdiSp628SHG21ZADbORyGkbTrab+01rvOfQH
 ergVBkM+kE1nASStG1j8PEjEoR49l5yM4mc60BfzX8mEAgXT6fK9DsJsg0gNxLnClbL4jlggQQyf
 AVpLeF7cAKtDhgMMXMMD9D8Ghsb5p03b047IMf7YEaf6E5gt05h6p3pPiBeBofCPJ4OUs0/Mo47T
 aRcYghYI4BiUXWnKQs1CxQqzNmRZ30uGOC/SmHauEkPZDIC3Z81HuBNTYU/s1w7hk/RqdthOjDud
 F3w+OsL+L/x61vAFMvX7q8M4x6bP/gjzw0OZ2OlHcEwFHTocLCunxi6JSJl2usRTyGICE+YeMhiG
 N55Yzay7fbLDMmG4pesgZMUG3KDVm49wozUUAA6lF6OKXRbY+u/cy5kCEPWvfFW1ZRPcpGyeyPXK
 NTABBN67jV774O4hBSz/kkmPgL+fgIguodCdi9PCFsUPpzrb8z4Jfac3AjgDIcmNDYZkvZ3iV5F5
 CMo0l3DZagPC08Y4NssVDKAhiR+ILJpiKHyhi49K3w==
X-Report-Abuse-To: spam@mx99.antispamcloud.com
X-Originating-IP: 69.162.77.130
X-SpamExperts-Domain: vishnu.hosting-mexico.net
X-SpamExperts-Username: 69.162.77.130
Authentication-Results: antispamcloud.com; auth=pass smtp.auth=69.162.77.130@vishnu.hosting-mexico.net
X-SpamExperts-Outgoing-Class: unsure
X-SpamExperts-Outgoing-Evidence: Combined (0.23)
X-Recommended-Action: accept

Cargos y Abonos

select c.id_cliente,c.numero_cliente,c.nombre_cliente, case  when 
tp.tipo = 'CARGO' THEN mc.importe END CARGO,
case  when tp.tipo =  'ABONO' THEN mc.importe END 
ABONO,tp.nombre_tipo_pago concepto,mc.fecha
from movimiento_contable mc  join cliente c on mc.id_cliente = 
c.id_cliente
inner join tipo_pago tp on tp.id_tipo_pago = mc.id_tipo_pago
where date(mc.fecha) between $P{INITDATE} and $P{ENDDATE}
AND tp.aplica_mayorista=0
AND (c.numero_cliente= $P{CUSTOMER_NUMBER} OR $P{ALL_CUSTOMERS})
and mc.estado<>'CANCELADO' and mc.estado<>'RECHAZADO'
order by c.numero_cliente

Cargos y Abonos mayoristas

select
	c.id_cliente,
	c.numero_cliente,
	c.nombre_cliente,
	case  when tp.tipo = 'CARGO' THEN mc.importe END CARGO,
      case  when tp.tipo =  'ABONO' THEN mc.importe END ABONO,
      tp.nombre_tipo_pago concepto,
      mc.referencia ,
      mc.fecha
from movimiento_contable mc
  join cliente c on mc.id_cliente = c.id_cliente
inner join tipo_pago tp on tp.id_tipo_pago = mc.id_tipo_pago
where date(mc.fecha) between $P{INITDATE} and $P{ENDDATE}
and mc.estado<>'CANCELADO'
AND c.mayorista = '1'
ORDER BY c.numero_cliente
