72 lines
3.0 KiB
C++
72 lines
3.0 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 );
|
|
QRLabel16->Caption = FormatCurr("###,###,###.#0 €", (TbVntCabecera->FieldByName("TotalSin")->AsCurrency + TbVntCabecera->FieldByName("TotalIva")->AsCurrency)/166.386 );
|
|
QRLabel17->Caption = FormatCurr("###,###,###.#0 €", (TbVntCabecera->FieldByName("TotalIva")->AsCurrency)/166.386 );
|
|
QRLabel18->Caption = FormatCurr("###,###,###.#0 €", (TbVntCabecera->FieldByName("TotalSin")->AsCurrency)/166.386 );
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
void __fastcall TQRMDFacturaVnt::DetailBand1BeforePrint(
|
|
TQRCustomBand *Sender, bool &PrintBand)
|
|
{
|
|
QRDBText9->Mask = TbVntLineas->FieldByName("PrecioC")->AsInteger == 0 ? "#" : "###,###,###.#0";
|
|
if ( TbVntLineas->FieldByName("PrecioC")->AsInteger == 0 ||
|
|
TbVntLineas->FieldByName("Cantidad")->AsInteger == 0 )
|
|
{
|
|
QRExpr4->Mask = "#";
|
|
QRExpr1->Mask = "#";
|
|
} else {
|
|
QRExpr4->Mask = "###,###,###.#0";
|
|
QRExpr1->Mask = "###,###,###.#0";
|
|
}
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|