56 lines
2.4 KiB
C++
56 lines
2.4 KiB
C++
//---------------------------------------------------------------------
|
|
#include <vcl.h>
|
|
#pragma hdrstop
|
|
|
|
#include "TpvVntFctPrint.h"
|
|
#include "TpvVentas.h"
|
|
//---------------------------------------------------------------------
|
|
#pragma resource "*.dfm"
|
|
TQRMDFacturaVnt *QRMDFacturaVnt;
|
|
//---------------------------------------------------------------------
|
|
__fastcall TQRMDFacturaVnt::TQRMDFacturaVnt(TComponent* AOwner)
|
|
: TQuickRep(AOwner)
|
|
{
|
|
TbProductos->Active = true;
|
|
TbCircular->Active = true;
|
|
TbVntCabecera->Active = true;
|
|
TbClt->Active = true;
|
|
TbVntLineas->Active = true;
|
|
try {
|
|
QRImage4->Picture->LoadFromFile("systm\\bannerFACT.bmp");
|
|
} catch(...) {
|
|
//nothing
|
|
}
|
|
}
|
|
//---------------------------------------------------------------------
|
|
void __fastcall TQRMDFacturaVnt::TitleBand1BeforePrint(
|
|
TQRCustomBand *Sender, bool &PrintBand)
|
|
{
|
|
|
|
char Caracter;
|
|
if ( TbClt->FieldByName( "DocumentoDNP" )->AsString.IsEmpty() ) Caracter = '0'; else
|
|
Caracter = (TbClt->FieldByName( "DocumentoDNP" )->AsString)[1];
|
|
if ( !(Caracter >= '0' && Caracter <= '9') )
|
|
LblNombre->Caption = TbClt->FieldByName( "Empresa" )->AsString;
|
|
else
|
|
LblNombre->Caption = TbClt->FieldByName( "Apellidos" )->AsString + ", " + TbClt->FieldByName( "Nombre" )->AsString;
|
|
LblDir->Caption = TbClt->FieldByName( "Calle" )->AsString + ", " + TbClt->FieldByName( "Num" )->AsString + TbClt->FieldByName( "Piso" )->AsString + TbClt->FieldByName( "Letra" ) -> AsString;
|
|
LblCP->Caption = "CP: " + TbClt->FieldByName( "CP" )->AsString + " " + TbClt->FieldByName( "Población" ) ->AsString + ", (" + TbClt->FieldByName("Provincia")->AsString+")";
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
void __fastcall TQRMDFacturaVnt::PageFooterBand1BeforePrint(
|
|
TQRCustomBand *Sender, bool &PrintBand)
|
|
{
|
|
QRTotal->Caption = FormatCurr("###,###,###.#0", TbVntCabecera->FieldByName("TotalSin")->AsCurrency + TbVntCabecera->FieldByName("TotalIva")->AsCurrency );
|
|
TotalE->Caption = FormatCurr("###,###,###.#0", (TbVntCabecera->FieldByName("TotalSin")->AsCurrency + TbVntCabecera->FieldByName("TotalIva")->AsCurrency)/166.386 );
|
|
TotalSinE->Caption = FormatCurr("###,###,###.#0", (TbVntCabecera->FieldByName("TotalSin")->AsCurrency)/166.386 );
|
|
TotalIvaE->Caption = FormatCurr("###,###,###.#0", (TbVntCabecera->FieldByName("TotalIva")->AsCurrency)/166.386 );
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|
|
|