procedure TfrmVAdmiSoloDes.btnImpClick(Sender: TObject);
Var MyPrinter: TextFile;
xcan, xval, xtot, xcam:shortstring;
xdes : string[35];
xAne : string[35];
xsum:real;
consulta:string;
begin
AssignFILE(MyPrinter,'COM1');
ReWrite(MyPrinter);
// Write(MyPrinter, CHR(27) + CHR(64)); // Inicializar Impresora
//Write(MyPrinter, CHR(27)+CHR(67)+CHR(44)); // Fijar Tamaño en Lineas
// Write(MyPrinter,CHR(27)+ CHR(77)); // Tipo de Letra Chicas
// Write(MyPrinter,CHR(27)+ CHR(104)+CHR(2)); // Tipo de Letra Chicas
// Write(MyPrinter,CHR(27)+ CHR(13)); // Tipo de Letra Chicas
//Write(MyPrinter,CHR(27)+CHR(197)); // Negrita
Writeln(MyPrinter,'----------------------------------------');
Writeln(MyPrinter,'');
Writeln(MyPrinter,'');
//Write(MyPrinter,CHR(27)+CHR(179)+CHR(28)); // Espacio entre Lines
Writeln(MyPrinter,'* * * COCINA * * * ');
Writeln(MyPrinter,'NR.ORDEN:' + cdsTempME_ORDEN.asstring + ' ' + ' HORA: ' + cdsTempOR_INICIO.asstring);
Writeln(MyPrinter,'Moso : ' + self.cdsTempMO_NOMBRE.asstring);
Writeln(MyPrinter,'Mesa : ' + self.cdsMesasME_DESCRIP.asstring );
//----------------------------
//------------------------------
Writeln(MyPrinter,'----------------------------------------');
self.cds_prin.First;
while not self.cds_prin.Eof do
begin
xdes:=copy(self.cds_prinORPR_DESCRIP.AsString,1,35);
Writeln(MyPrinter,xdes);
if SELF.cds_prin_d.Active then
self.cds_prin_d.Close;
self.cds_prin_d.DataSet.Params[0].AsInteger := self.cds_prinORPR_N_ORDEN.AsInteger ;
self.cds_prin_d.DataSet.Params[1].AsInteger := self.cds_prinORPR_INDICE.AsInteger ;
self.cds_prin_d.Active := True;
if not self.cds_prin_d.IsEmpty then
begin
self.cds_prin_d.First;
while not self.cds_prin_d.Eof do
begin
// xcan:=format('%2.0f',[self.cds_prin_dORPRD_INX.AsFloat]);
xdes:=copy(self.cds_prin_dORPRD_DESCRIP.AsString,1,25);
Writeln(MyPrinter,'*'+' '+xdes);
self.cds_prin_d.Next;
end;
end;
if dm.sp_marco_prin.active then
dm.sp_marco_prin.Close;
dm.sp_marco_prin.Params[0].AsInteger := self.cds_prinORPR_N_ORDEN.asinteger ;
dm.sp_marco_prin.Params[1].asinteger := self.cds_prinORPR_INDICE.asinteger ;
dm.sp_marco_prin.ExecProc ;
self.cds_prin.Next;
end;
Writeln(MyPrinter,'----------------------------------------');
Writeln(MyPrinter,'');
Writeln(MyPrinter,'');
Writeln(MyPrinter,'');
Writeln(MyPrinter,'');
Writeln(MyPrinter,'');
Writeln(MyPrinter,'');
Writeln(MyPrinter, #27+#105); //corte de papel ESC+i o #27+(el valor ascii de i)
//Write(MyPrinter,#12); // Expulsar la Hoja
System.CloseFile(MyPrinter);
self.cds_prin.Refresh;