Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Impresión (https://www.clubdelphi.com/foros/forumdisplay.php?f=4)
-   -   Facturas B >$1000 en Hasar 320 (https://www.clubdelphi.com/foros/showthread.php?t=39554)

pborges36 23-01-2007 23:48:53

Facturas B >$1000 en Hasar 320
 
Hola a todos. Tengo un problema. Estoy programando en Delphi6 y utilizo el ocx para acceder a la impresora Hasar 320. Tengo un procedure con el cual imprimo tanto factura A como B. Todo sale bien excepto las B superiores a $1000. Solo imprime los items hasta que el total de la factura llega a 1000.
Aqui le dejo el codigo, espero puedan ayudarme. Saludos.

Código Delphi [-]
procedure TImpresoraFiscal.ImprimeFiscal;
var
tc:longint;
Descri:string;
cant,monto,iva,impint:real;
imprime:boolean;
tpodoc,resiva:longint;
nombre,numdoc,domi:string;
begin
//Abrir Puerto
   hasar1.Modelo:=8;
   hasar1.Puerto:=1;
    if tipoiva='Consumidor Final' then resiva:=CONSUMIDOR_FINAL;
    if tipoiva='Monotributo' then resiva:=MONOTRIBUTO;
    if tipoiva='Responsable inscripto' then resiva:=RESPONSABLE_INSCRIPTO;
    if tipoiva='Responsable No Inscripto' then resiva:=RESPONSABLE_NO_INSCRIPTO;
    if tipoiva='No Responsable' then resiva:=NO_RESPONSABLE;
    if tipoiva='Bienes de Uso' then resiva:=BIENES_DE_USO;
    if tipoiva='Exento' then resiva:=RESPONSABLE_EXENTO;
    tc:=0;
    hasar1.Comenzar;
    hasar1.ConfigurarControlador(REIMPRESION_CANCELADOS,'false');
    hasar1.ConfigurarControlador(IMPRESION_LEYENDAS,'true');
    hasar1.Enviar(chr(93)+chr(28)+'12'+chr(28)+chr(46));
    hasar1.Enviar(chr(93)+chr(28)+'12'+chr(28)+'Vendedor: '+ven_nomb);
    if facven_tipo='A' then
        begin
           tc:=FACTURA_A;
            nombre:=cli_codi+' '+cli_nomb;
            numdoc:=cli_cuit;
            domi:=cli_domi;
            tpodoc:=TIPO_CUIT;
        end;
    if facven_tipo<>'A' then
        begin
            tc:=FACTURA_B;
            nombre:=cli_nomb;
            domi:=cli_domi;
             tpodoc:=TIPO_NINGUNO;
        end;
    hasar1.PrecioBase:=true;
   hasar1.DatosCliente(nombre,numdoc,tpodoc,resiva,domi);
 
   self.hasar1.AbrirComprobanteFiscal(tc);
 
   if not hasar1.HuboErrorFiscal then
     begin
          Query1.First;
         while not Query1.Eof do
             begin
                 descri:=Query1.FieldByName('descri').AsString;
                 cant:=Query1.FieldByName('cant').AsFloat;
                 monto:=Query1.FieldByName('monto').AsFloat;
                 iva:=Query1.FieldByName('iva').AsFloat;
                 impint:=Query1.FieldByName('impint').AsFloat;
                 hasar1.ImprimirItem(descri,cant,monto,iva,impint);
        
                 MQuery1.Next;
             end;

         imprime:=true;
         hasar1.Subtotal(imprime);
         if precingrbrut<>0 then
           hasar1.EspecificarPercepcionGlobal('Percepcion Ingr. Brutos',precingrbrut);
         if not MQPagos.Active then
           hasar1.ImprimirPago(condicionventa,totalfactura)
         else
           begin
               QPagos.First;
               while not QPagos.Eof do
                   begin
                       hasar1.ImprimirPago(QPagos.fieldbyname('mediodepago').AsString,QPagos.fieldbyname('importe').AsFloat  );
                       QPagos.Next;
                   end;
           end;
        QPagos.Active:=false;
         hasar1.CerrarComprobanteFiscal;
         facven_nume:=inttostr(strtoint(hasar1.Respuesta[3]));
         facven_fech:=hasar1.FechaHoraFiscal;
     end
   else
     begin
         MessageDlg('Verifique los Datos del Cliente', mtError, [mbOK], 0);

     end;

   hasar1.Enviar(chr(93)+chr(28)+'12'+chr(28)+chr(46));
   hasar1.Finalizar;
end;

fredymam 24-01-2007 04:51:29

Las facturas "B", con importe igual o superior a $ 1.000,, deben llevar necesariamente el Tipo y Numero de documento.

...esto es así por Ley. Aunque los controladores Epson no hacen distinción.

pborges36 24-01-2007 15:44:39

Muchas gracias!! Efectivamente ese era el problema.....


La franja horaria es GMT +2. Ahora son las 18:32:25.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi