本文整理汇总了C++中BlFixed::toQString方法的典型用法代码示例。如果您正苦于以下问题:C++ BlFixed::toQString方法的具体用法?C++ BlFixed::toQString怎么用?C++ BlFixed::toQString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlFixed
的用法示例。
在下文中一共展示了BlFixed::toQString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: procesaFormula
/**
\param formula
\param return
\return
**/
bool BcCuentasAnualesImprimirView::procesaFormula ( const QDomNode &formula )
{
BL_FUNC_DEBUG
QDomElement valor = formula.firstChildElement ( "VALORACT" );
//
QString valors = valor.toElement().text();
QString codigo = formula.parentNode().firstChildElement ( "CONCEPTO" ).toElement().text();
//
if ( !valor.isNull() ) {
return true;
} // end if
BlFixed tvaloract = BlFixed ( "0.0" );
BlFixed tvalorant = BlFixed ( "0.0" );
QDomElement formula3 = formula.toElement();
QDomNodeList litems = formula3.elementsByTagName ( "OPERADOR" );
for ( int i = 0; i < litems.count(); i++ ) {
QDomNode item = litems.item ( i );
QDomElement e1 = item.toElement(); /// Try to convert the node to an element.
if ( !e1.isNull() ) { /// The node was really an element.
if ( !procesaOperador ( item ) )
return false;
QString valoract, valorant;
if ( valorItem ( item, valoract, valorant ) ) {
tvaloract = tvaloract + BlFixed ( valoract );
tvalorant = tvalorant + BlFixed ( valorant );
} else
return false;
} // end if
} // end for
QString tvaloracts = tvaloract.toQString();
QString tvalorants = tvalorant.toQString();
agregaValores ( formula, tvaloracts, tvalorants );
return true;
}
示例2: on_mui_pago_textChanged
void Cambio::on_mui_pago_textChanged()
{
BlFixed total ( mui_total->text().replace ( ",", "." ) );
BlFixed pago ( mui_pago->text().replace ( ",", "." ) );
BlFixed cambio = pago - total;
mui_cambio->setText ( cambio.toQString() );
}
示例3: _
QString Q19Writer::import ( BlFixed f, int longitud )
{
f.setPrecision ( 2 );
QString res = QString::number ( f.value );
if ( f.value < 0 )
{
throw _ ( "Datos incorrectos" ) +"\n" + _ ( "Importe negativo (%1) ! " ).arg ( f.toQString() );
}
if ( res.length() >longitud )
{
throw _ ( "Datos incorrectos" ) +"\n" + _ ( "Importe excesivo (%1) !. El limite son %2 digitos, incluyendo los 2 decimales " ).arg ( f.toQString() ).arg ( abs ( longitud ) );
}
return res.rightJustified ( longitud,'0',true );
}
示例4: pintatotales
/**
\param iva
\param base
\param desc
\param irpf
\param reqeq
**/
void AlbaranProveedorView::pintatotales ( BlFixed iva, BlFixed base, BlFixed total, BlFixed desc, BlFixed irpf, BlFixed reqeq )
{
BL_FUNC_DEBUG
m_totalBases->setText ( QString ( base.toQString() ) );
m_totalTaxes->setText ( QString ( iva.toQString() ) );
m_totalDiscounts->setText ( QString ( desc.toQString() ) );
m_totalIRPF->setText ( QString ( irpf.toQString() ) );
m_totalReqEq->setText ( QString ( reqeq.toQString() ) );
m_totalalbaranp->setText ( QString ( total.toQString() ) );
}
示例5: pintatotales
/**
\param iva
\param base
\param total
\param desc
\param irpf
\param reqeq
**/
void PedidoProveedorView::pintatotales ( BlFixed iva, BlFixed base, BlFixed total, BlFixed desc, BlFixed irpf, BlFixed reqeq )
{
BL_FUNC_DEBUG
mui_totalBaseImponible->setText ( base.toQString() );
mui_totalImpuestos->setText ( iva.toQString() );
mui_totalPedido->setText ( total.toQString() );
mui_totalDescuentos->setText ( desc.toQString() );
mui_totalIRPF->setText ( QString ( irpf.toQString() ) );
mui_totalRecargo->setText ( QString ( reqeq.toQString() ) );
}
示例6: pintatotales
/**
\param iva
\param base
\param total
\param desc
\param irpf
\param reqeq
**/
void FacturaView::pintatotales ( BlFixed iva, BlFixed base, BlFixed total, BlFixed desc, BlFixed irpf, BlFixed reqeq )
{
BL_FUNC_DEBUG
m_totalBases->setText ( base.toQString() );
m_totalTaxes->setText ( iva.toQString() );
m_totalfactura->setText ( total.toQString() );
m_totalDiscounts->setText ( desc.toQString() );
m_totalIRPF->setText ( QString ( irpf.toQString() ) );
m_totalReqEq->setText ( QString ( reqeq.toQString() ) );
}
示例7: s_recalculaSaldo
void cobropagoview::s_recalculaSaldo()
{
BL_FUNC_DEBUG
BlFixed totalcobro ( "0" );
BlFixed totalpago ( "0" );
for ( int i = 0; i < mui_listado->rowCount(); i++ ) {
BlDbSubFormRecord *rec = mui_listado->lineaat ( i );
if ( rec ) {
if ( rec->dbValue ( "tipoprevcobro" ) == "f" ) {
totalcobro = totalcobro + BlFixed ( rec->dbValue ( "cantidadprevcobro" ) );
} else {
totalpago = totalpago + BlFixed ( rec->dbValue ( "cantidadprevcobro" ) );
} // end if
} // end if
} // end for
m_totalCobros->setText ( totalcobro.toQString() );
m_totalPagos->setText ( totalpago.toQString() );
}
示例8: refActual
/**
\return
**/
void Q19Writer::genera ( BlDbRecordSet *curcobro, QString fileName , QStringList *idsGenerats)
{
BL_FUNC_DEBUG
QString refActual ( "cap rebut" );
if (fileName.length()==0) {
fileName = QFileDialog::getSaveFileName ( parentWidget(), _ ( "Fichero de remesa bancaria (Cuaderno 19)" ),
"",
_ ( "*.q19;;*" ) );
}
BlDebug::blDebug ( Q_FUNC_INFO, 0, QString(_("Nombre del fichero: '%1'")).arg(fileName) );
if (fileName.length()>0) { // else ha apretat cancel?lar
try
{
int cobraments=curcobro->numregistros();
BlDbRecordSet *curbanc;
/*
http://www.cam.es/1/empresas/servicios/pdf/c19.pdf
" Dentro de cada Cliente Ordenante, todos los registros individuales debera'n
figurar en el soporte clasificados ascendentemente por el nu'mero de Entidad-
Oficina de adeudo, Referencia y Co'digo de dato, terminando con un registro de
<<Total Ordenante>>. Al final llevara' un registro de <<Total General>>.
"
Per'o cada idbanco (de fet cada entitat, per'o no filem tan prim) requereix un
fitxer, perqu'e no portar'as a un banc els rebuts que vols cobrar per un altre.
I la data de c'arrec va a la capc,alera d'ordenant, per tant hem d'ordenar primer
per banc i data i despre's pel que demana als rebuts d'un ordenant. Farem tantes capc,aleres
d'ordenant com dates encara que sempre sigui el mateix ordenant.
*/
bool bancUnic = ( curcobro->value( "idbanco",0 ) == curcobro->value( "idbanco",curcobro->numregistros()-1 ) );
BlDebug::blDebug ( "bancUnic=",0,bancUnic?"si":"no" );
QString idbanc ( "" );
QFile file;
QTextStream out ( &file );
/*
http://www.cam.es/1/empresas/servicios/pdf/c19.pdf
- Codigo ASCII ( en mayusculas) (caracter 165= enye).
- Registros de longitud fija (162 bytes).
- Formato MS-DOS secuencial tipo texto.
En canvi un fitxer de mostra generat amb un programa que do'na el banc
te' 162 car'acters + \x0a , que no e's un salt de li'nia MSDOS. Ni se' si
un fitxer de registres de longitud fixa necessita salts de li'nia per a res.
*/
out.setCodec ( "Q19" );
QString sufijo;
QDate fechaCargo = ( curcobro->eof() ?
QDate()
: QDate::fromString ( curcobro->value( "fechavenccobro" ),"dd/MM/yyyy" ) ) ;
BlFixed impOrdenante ( 0,2 );
BlFixed impPresentador ( 0,2 );
QString resultats ( "" );
int registrosOrdenante=0;
int registrosPresentador=0;
int cobramentsOrdenante=0;
int cobramentsPresentador=0;
int ordenants=0;
int sensebanc=0;
int sensevenc=0;
while ( !curcobro->eof() )
{
if ( QDate::fromString ( curcobro->value( "fechavenccobro" ),"dd/MM/yyyy" ).isValid() )
{
if ( ( !curcobro->value( "idbanco" ).isNull() ) && ( curcobro->value( "idbanco" ).length() >0 ) )
{
if ( QDate::fromString ( curcobro->value( "fechavenccobro" ),"dd/MM/yyyy" ) != fechaCargo )
{
registrosPresentador++;
registrosOrdenante++;
totalOrdenante ( out, sufijo , curbanc, impOrdenante,
cobramentsOrdenante, registrosOrdenante );
ordenants++;
}
if ( curcobro->value( "idbanco" ) != idbanc )
{
// canvi de banc on cobrem els rebuts, canvi de fitxer
idbanc=curcobro->value( "idbanco" );
if ( file.handle() !=-1 )
{
registrosPresentador++;
totalPresentador ( out, sufijo, curbanc, impPresentador, cobramentsPresentador, registrosPresentador , ordenants );
resultats += _ ( "\n%3 : %1 recibos, %2 EUR. " ).arg ( cobramentsPresentador ).arg ( impPresentador.toQString() ).arg ( file.fileName() );
file.close();
delete curbanc;
}
curbanc = m_empresa->loadQuery ( "SELECT * FROM banco WHERE idbanco = $1",1,&idbanc );
sufijo = curbanc->value("sufijobanco");
if ( bancUnic )
{
file.setFileName ( fileName );
BlDebug::blDebug ( "creare' ",0,fileName );
}
else
//.........这里部分代码省略.........
示例9: pintar
void MTicketDesglose::pintar()
{
BL_FUNC_DEBUG
BtTicket *tick = ( ( BtCompany * ) mainCompany() ) ->ticketActual();
//QString html = "<font size=\"1\">";
QString html = "<p style=\"font-family:monospace; font-size: 12pt;\">";
QString html1 = "<font size=\"1\">";
html1 += "Ticket: " + tick->dbValue ( "nomticket" ) + "<BR>";
QString querytrab = "SELECT * FROM trabajador WHERE idtrabajador = " + tick->dbValue ( "idtrabajador" );
BlDbRecordSet *curtrab = mainCompany() ->loadQuery ( querytrab );
html1 += "Trabajador: " + tick->dbValue ( "idtrabajador" ) + " " + curtrab->value( "nomtrabajador" ) + "<BR>";
delete curtrab;
QString query = "SELECT * FROM cliente WHERE idcliente = " + tick->dbValue ( "idcliente" );
BlDbRecordSet *cur1 = mainCompany() ->loadQuery ( query );
html1 += "Cliente: " + tick->dbValue ( "idcliente" ) + " " + cur1->value( "nomcliente" ) + "<BR>";
delete cur1;
html += "<TABLE border=\"0\">";
BlDbRecord *item;
for ( int i = 0; i < tick->listaLineas() ->size(); ++i ) {
item = tick->listaLineas() ->at ( i );
QString bgcolor = "#FFFFFF";
if ( item == tick->lineaActBtTicket() ) bgcolor = "#CCCCFF";
html += "<TR>";
html += "<TD bgcolor=\"" + bgcolor + "\" align=\"right\" width=\"50\">" + item->dbValue ( "cantlalbaran" ) + "</TD>";
html += "<TD bgcolor=\"" + bgcolor + "\">" + item->dbValue ( "nomarticulo" ) + "</TD>";
BlFixed totalLinea ( "0.00" );
totalLinea = BlFixed ( item->dbValue ( "cantlalbaran" ) ) * BlFixed ( item->dbValue ( "pvplalbaran" ) );
html += "<TD bgcolor=\"" + bgcolor + "\" align=\"right\" width=\"50\">" + totalLinea.toQString() + "</TD>";
html += "</TR>";
}// end for
html += "</TABLE>";
// ======================================
html += "<BR><HR><BR>";
base basesimp;
base basesimpreqeq;
BlDbRecord *linea;
/// Impresion de los contenidos.
QString l;
BlFixed irpf ( "0" );
BlDbRecordSet *cur = mainCompany() ->loadQuery ( "SELECT * FROM configuracion WHERE nombre = 'IRPF'" );
if ( cur ) {
if ( !cur->eof() ) {
irpf = BlFixed ( cur->value( "valor" ) );
} // end if
delete cur;
} // end if
BlFixed descuentolinea ( "0.00" );
for ( int i = 0; i < tick->listaLineas() ->size(); ++i ) {
linea = tick->listaLineas() ->at ( i );
BlFixed cant ( linea->dbValue ( "cantlalbaran" ) );
BlFixed pvpund ( linea->dbValue ( "pvplalbaran" ) );
BlFixed desc1 ( linea->dbValue ( "descuentolalbaran" ) );
BlFixed cantpvp = cant * pvpund;
BlFixed base = cantpvp - cantpvp * desc1 / 100;
descuentolinea = descuentolinea + ( cantpvp * desc1 / 100 );
basesimp[linea->dbValue ( "ivalalbaran" ) ] = basesimp[linea->dbValue ( "ivalalbaran" ) ] + base;
basesimpreqeq[linea->dbValue ( "reqeqlalbaran" ) ] = basesimpreqeq[linea->dbValue ( "reqeqlalbaran" ) ] + base;
} // end for
BlFixed basei ( "0.00" );
base::Iterator it;
for ( it = basesimp.begin(); it != basesimp.end(); ++it ) {
basei = basei + it.value();
} // end for
/// Calculamos el total de los descuentos.
/// De momento aqui no se usan descuentos generales en venta.
BlFixed porcentt ( "0.00" );
/*
BlDbSubFormRecord *linea1;
if (m_listadescuentos->rowCount()) {
for (int i = 0; i < m_listadescuentos->rowCount(); ++i) {
linea1 = m_listadescuentos->lineaat(i);
BlFixed propor(linea1->dbValue("proporcion" + m_listadescuentos->tableName()).toAscii().constData());
porcentt = porcentt + propor;
} // end for
} // end if
*/
/// Calculamos el total de base imponible.
BlFixed totbaseimp ( "0.00" );
BlFixed parbaseimp ( "0.00" );
for ( it = basesimp.begin(); it != basesimp.end(); ++it ) {
if ( porcentt > BlFixed ( "0.00" ) ) {
parbaseimp = it.value() - it.value() * porcentt / 100;
} else {
parbaseimp = it.value();
} // end if
html1 += "Base Imp " + it.key() + "% " + parbaseimp.toQString() + "<BR>";
totbaseimp = totbaseimp + parbaseimp;
} // end for
/// Calculamos el total de IVA.
//.........这里部分代码省略.........
示例10: agregaValores
/**
\param nodo
\param valoract
\param valorant
**/
void BcCuentasAnualesImprimirView::agregaValores ( const QDomNode &nodo, const QString &valoract, const QString &valorant )
{
BL_FUNC_DEBUG
QDomElement enodo = nodo.toElement();
BlFixed fvaloract ( valoract );
BlFixed fvalorant ( valorant );
/// Miramos las opciones pasadas
if ( nodo.nodeName() == QString ( "OPERADOR" ) ) {
QDomNodeList opcs = enodo.elementsByTagName ( "OPCIONES" );
for ( int i = 0; i < opcs.count(); i++ ) {
QDomElement op = opcs.item ( i ).toElement();
QString opciones = op.text();
if ( opciones == "POSITIVO" ) {
if ( fvaloract < 0 )
fvaloract = fvaloract * -1;
if ( fvalorant < 0 )
fvalorant = fvalorant * -1;
} // end if
if ( opciones == "NEGATIVO" ) {
if ( fvaloract > 0 )
fvaloract = fvaloract * -1;
if ( fvalorant > 0 )
fvalorant = fvalorant * -1;
} // end if
if ( opciones == "RESTAR" ) {
fvaloract = fvaloract * -1;
fvalorant = fvalorant * -1;
} // end if
} // end for
} else {
QDomNodeList opcs = nodo.parentNode().toElement().elementsByTagName ( "OPCIONES" );
for ( int i = 0; i < opcs.count(); i++ ) {
QDomElement op = opcs.item ( i ).toElement();
QString opciones = op.text();
if ( opciones == "MAYORCERO" ) {
if ( fvaloract < 0 )
fvaloract = 0;
if ( fvalorant < 0 )
fvalorant = 0;
} // end if
if ( opciones == "MENORCERO" ) {
if ( fvaloract > 0 )
fvaloract = 0;
if ( fvalorant > 0 )
fvalorant = 0;
} // end if
} // end for
} // end if
QDomElement valoract1 = m_doc.createElement ( "VALORACT" );
valoract1.setTagName ( "VALORACT" );
QDomText etx = m_doc.createTextNode ( fvaloract.toQString() );
valoract1.appendChild ( etx );
QDomElement valorant1 = m_doc.createElement ( "VALORANT" );
valorant1.setTagName ( "VALORANT" );
QDomText etc = m_doc.createTextNode ( fvalorant.toQString() );
valorant1.appendChild ( etc );
QDomNode n = nodo;
enodo.appendChild ( valoract1 );
enodo.appendChild ( valorant1 );
}
示例11: pintar
void Devolucion::pintar()
{
if ( !m_ticket ) return;
// ====================== PINTAMOS ========================
QString html = "<p style=\"font-family:monospace; font-size: 8pt;\">";
QString html1 = "<font size=\"1\">";
html1 += "Ticket: " + m_ticket->dbValue ( "nomticket" ) + "<BR>";
QString querytrab = "SELECT * FROM trabajador WHERE idtrabajador = " + m_ticket->dbValue ( "idtrabajador" );
BlDbRecordSet *curtrab = mainCompany() ->loadQuery ( querytrab );
html1 += "Trabajador: " + m_ticket->dbValue ( "idtrabajador" ) + " " + curtrab->value( "nomtrabajador" ) + "<BR>";
delete curtrab;
QString query = "SELECT * FROM cliente WHERE idcliente = " + m_ticket->dbValue ( "idcliente" );
BlDbRecordSet *cur1 = mainCompany() ->loadQuery ( query );
html1 += "Cliente: " + m_ticket->dbValue ( "idcliente" ) + " " + cur1->value( "nomcliente" ) + "<BR>";
delete cur1;
if ( m_ticket->listaLineas()->size() > 0 ) {
html += "<TABLE border=\"0\">";
html += "<TR bgcolor = \"#CCCCCC\">";
html += "<TD>SEL</TD>";
for ( int z = 0; z < m_ticket->listaLineas()->at ( 0 )->lista()->size(); ++z ) {
BlDbField *head = m_ticket->listaLineas()->at ( 0 )->lista()->at ( z );
if ( head->fieldName().left ( 2 ) != "id" && head->fieldName().left ( 3 ) != "num" )
html += "<TD>" + head->fieldName().left ( 4 ) + "</TD>";
} // end for
html += "</TR>";
BlDbRecord *item;
for ( int i = 0; i < m_ticket->listaLineas() ->size(); ++i ) {
item = m_ticket->listaLineas() ->at ( i );
html += "<TR>";
html += "<TD><A NAME=\"plus\" HREF=\"?op=plus&numlalbaran=" + item->dbValue ( "numlalbaran" ) + "\">+</A> <A HREF=\"?op=minus&numlalbaran=" + item->dbValue ( "numlalbaran" ) + "\">-</A></td>";
for ( int j = 0; j < item->lista()->size(); ++j ) {
BlDbField *camp = item->lista()->at ( j );
if ( camp->fieldName().left ( 2 ) != "id" && camp->fieldName().left ( 3 ) != "num" )
html += "<TD>" + camp->fieldValue() + "</TD>";
} // end for
html += "</TR>";
}// end for
html += "</TABLE>";
} // end if
// ======================================
html += "<BR><HR><BR>";
base basesimp;
base basesimpreqeq;
BlDbRecord *linea;
/// Impresion de los contenidos.
QString l;
BlFixed irpf ( "0" );
BlDbRecordSet *cur = mainCompany() ->loadQuery ( "SELECT * FROM configuracion WHERE nombre = 'IRPF'" );
if ( cur ) {
if ( !cur->eof() ) {
irpf = BlFixed ( cur->value( "valor" ) );
} // end if
delete cur;
} // end if
BlFixed descuentolinea ( "0.00" );
for ( int i = 0; i < m_ticket->listaLineas() ->size(); ++i ) {
linea = m_ticket->listaLineas() ->at ( i );
BlFixed cant ( linea->dbValue ( "cantlalbaran" ) );
BlFixed pvpund ( linea->dbValue ( "pvplalbaran" ) );
BlFixed desc1 ( linea->dbValue ( "descuentolalbaran" ) );
BlFixed cantpvp = cant * pvpund;
BlFixed base = cantpvp - cantpvp * desc1 / 100;
descuentolinea = descuentolinea + ( cantpvp * desc1 / 100 );
basesimp[linea->dbValue ( "ivalalbaran" ) ] = basesimp[linea->dbValue ( "ivalalbaran" ) ] + base;
basesimpreqeq[linea->dbValue ( "reqeqlalbaran" ) ] = basesimpreqeq[linea->dbValue ( "reqeqlalbaran" ) ] + base;
} // end for
BlFixed basei ( "0.00" );
base::Iterator it;
for ( it = basesimp.begin(); it != basesimp.end(); ++it ) {
basei = basei + it.value();
} // end for
/// Calculamos el total de los descuentos.
/// De momento aqui no se usan descuentos generales en venta.
BlFixed porcentt ( "0.00" );
/// Calculamos el total de base imponible.
BlFixed totbaseimp ( "0.00" );
BlFixed parbaseimp ( "0.00" );
for ( it = basesimp.begin(); it != basesimp.end(); ++it ) {
if ( porcentt > BlFixed ( "0.00" ) ) {
parbaseimp = it.value() - it.value() * porcentt / 100;
} else {
parbaseimp = it.value();
} // end if
html1 += "Base Imp " + it.key() + "% " + parbaseimp.toQString() + "<BR>";
//.........这里部分代码省略.........
示例12: BtTicket_imprimirIVAInc
//.........这里部分代码省略.........
} // end for
for ( int i = 0; i < tick->listaLineas() ->size(); ++i ) {
linea = tick->listaLineas() ->at ( i );
BlFixed cantidad = BlFixed ( linea->dbValue ( "cantlalbaran" ) );
BlFixed totlinea = cantidad * BlFixed( linea->dbValue("pvpivainclalbaran"));
total.totalIva = total.totalIva + cantidad * BlFixed ( linea->dbValue ( "pvpivainclalbaran" ) );
totales[linea->dbValue ( "ivalalbaran" ) ] = totales[linea->dbValue ( "ivalalbaran" ) ] + totlinea;
} // end for
BlEscPrinter pr ( g_confpr->value(CONF_DIR_USER) + "bulmatpv_ticket_tc_ivainc.esc" );
pr.initializePrinter();
pr.setCharacterCodeTable ( page19 );
pr.setJustification ( BlEscPrinter::center );
if ( g_confpr->value( CONF_TPV_PRINTER_LOGO ) != "" ) {
pr.printImage ( g_confpr->value( CONF_TPV_PRINTER_LOGO ) );
} // end if
pr.printText ( empresa.nombre + "\n" );
pr.setCharacterPrintMode ( CHARACTER_FONTB_SELECTED );
pr.setCharacterSize ( CHAR_WIDTH_1 | CHAR_HEIGHT_1 );
pr.setColor ( red );
pr.printText ( empresa.direccionCompleta + "\n" );
pr.initializePrinter();
pr.setCharacterCodeTable ( page19 );
pr.printText ( "\n" );
pr.printText ( fecha.dia + " " + fecha.hora + "\n" );
if (cliente.cif != "")
pr.printText ( "Cliente: " + cliente.cif + " " + cliente.nombre + "\n" );
pr.printText ( "Num. Ticket: " + tick->dbValue("numalbaran") + "\n" );
pr.printText ( "\n" );
pr.turnWhiteBlack ( 1 );
pr.printText ( "Uds PRODUCTO � � � � � � � P.U. � IMPORTE \n" );
pr.turnWhiteBlack ( 0 );
pr.setCharacterPrintMode ( CHARACTER_FONTB_SELECTED );
pr.setCharacterSize ( CHAR_WIDTH_1 | CHAR_HEIGHT_1 );
for ( int i = 0; i < tick->listaLineas() ->size(); ++i ) {
if ( i == tick->listaLineas()->size() - 1 )
pr.setUnderlineMode ( 1 );
linea = tick->listaLineas()->at ( i );
BlFixed pvp = BlFixed ( linea->dbValue ( "pvpivainclalbaran" ) );
BlFixed pvptotal = BlFixed ( linea->dbValue ( "cantlalbaran" ) ) * pvp;
pr.printText ( linea->dbValue ( "cantlalbaran" ).rightJustified ( 3, ' ', true ) + " " );
pr.printText ( linea->dbValue ( "desclalbaran" ).leftJustified ( 21, ' ', true ) + " " );
pr.printText ( linea->dbValue ( "nomtc_talla" ).leftJustified ( 3, ' ', true ) + " " );
pr.printText ( linea->dbValue ( "nomtc_color" ).leftJustified ( 3, ' ', true ) + " " );
QString pvpstr = pvp.toQString();
QString pvptotalstr = pvptotal.toQString();
pr.printText ( QString ( pvpstr + "�" ).rightJustified ( 10, ' ', true ) + " " );
pr.printText ( QString ( pvptotalstr + "�" ).rightJustified ( 10, ' ', true ) );
pr.printText ( "\n" );
} // end for
pr.setUnderlineMode ( 0 );
pr.setJustification ( BlEscPrinter::right );
pr.setCharacterPrintMode ( CHARACTER_FONTA_SELECTED );
base::Iterator it;
for ( it = totales.begin(); it != totales.end(); ++it ) {
QString tipoIva = it.key();
QString sqlquery = "SELECT (" +it.value().toQString('.') + "/ ( 1 + " + tipoIva.replace(",",".") + "/100 ))::NUMERIC(12,2) AS base, " + it.value().toQString('.') + "- ("+it.value().toQString('.') + "/ ( 1 + " + tipoIva.replace(",",".") + "/100 ))::NUMERIC(12,2) AS iva";
BlDbRecordSet *cur = tick->mainCompany()->loadQuery(sqlquery);
pr.printText ( "Base Imponible: " + cur->value("base") + "�\n" );
pr.printText ( "IVA " +it.key() + "% " + cur->value("iva") + "�\n" );
delete cur;
} // end for
pr.setCharacterPrintMode ( CHARACTER_FONTA_SELECTED | EMPHASIZED_MODE | DOUBLE_HEIGHT | DOUBLE_WIDTH );
pr.printText ( "TOTAL: " + total.totalIva.toQString() + "�\n" );
pr.printText ( "\n\n" );
pr.setJustification ( BlEscPrinter::left );
pr.setCharacterPrintMode ( CHARACTER_FONTA_SELECTED );
pr.printText ( "Le ha atendido " + trabajador.nombre + "\n" );
pr.printText ( "\n" );
pr.printText ( "\n" );
pr.setJustification ( BlEscPrinter::center );
pr.setColor ( red );
pr.printText ( "*** GRACIAS POR SU VISITA ***\n" );
QByteArray qba = tick->dbValue ( "refalbaran" ).toLatin1();
char* barcode = qba.data();
pr.setJustification ( BlEscPrinter::center );
pr.setBarcodeFormat ( 2, 50, both, fontB );
pr.printBarCode ( code39, qba.size(), barcode );
pr.cutPaperAndFeed ( true, 10 );
pr.print();
/// Si queremos imprimir con CUPS lo hacemos de esta otra forma
if (!g_confpr->value( CONF_TICKET_PRINTER_FILE).isEmpty() && g_confpr->value( CONF_TICKET_PRINTER_FILE) != "/dev/null") {
QString comando = "cat " + g_confpr->value(CONF_DIR_USER) + "bulmatpv_ticket_tc_ivainc.esc" + " > " + g_confpr->value( CONF_TICKET_PRINTER_FILE );
system ( comando.toLatin1().data() );
} else if (g_confpr->value(CONF_CUPS_DEFAULT_PRINTER).isEmpty() || g_confpr->value(CONF_CUPS_DEFAULT_PRINTER).toLower() == "none") {
BlDebug::blDebug("Debe establecer el parametro CONF_CUPS_DEFAULT_PRINTER o CONF_TICKET_PRINTER_FILE para imprimir el ticket " , 2);
} else {
QString comando = "lp -d" + g_confpr->value(CONF_CUPS_DEFAULT_PRINTER) + " " + g_confpr->value(CONF_DIR_USER) + "bulmatpv_ticket_tc_ivainc.esc";
system ( comando.toLatin1().data() );
} // end if
return 1;
}
示例13: BtTicket_imprimir
//.........这里部分代码省略.........
BlDbRecord *linea;
if ( tick->listaLineas()->size() ) {
total.iva = BlFixed ( tick->listaLineas()->at ( 0 )->dbValue ( "ivalalbaran" ) );
}
for ( int i = 0; i < tick->listaLineas()->size(); ++i ) {
linea = tick->listaLineas()->at ( i );
BlFixed cantidad = BlFixed ( linea->dbValue ( "cantlalbaran" ) );
total.baseImponible = total.baseImponible + cantidad * BlFixed ( linea->dbValue ( "pvplalbaran" ) );
} // end for
total.totalIva = total.baseImponible + total.baseImponible * total.iva / BlFixed ( "100" );
BlEscPrinter pr ( g_confpr->value(CONF_DIR_USER) + "bulmatpv_ticket_tc.esc" );
pr.initializePrinter();
pr.setCharacterCodeTable ( page19 );
pr.setJustification ( BlEscPrinter::center );
if ( g_confpr->value( CONF_TPV_PRINTER_LOGO ) != "" ) {
pr.printImage ( g_confpr->value( CONF_TPV_PRINTER_LOGO ) );
} // end if
pr.printText ( empresa.nombre + "\n" );
pr.setCharacterPrintMode ( CHARACTER_FONTB_SELECTED );
pr.setCharacterSize ( CHAR_WIDTH_1 | CHAR_HEIGHT_1 );
pr.setColor ( red );
pr.printText ( empresa.direccionCompleta + "\n" );
pr.initializePrinter();
pr.setCharacterCodeTable ( page19 );
pr.printText ( "\n" );
pr.printText ( fecha.dia + " " + fecha.hora + "\n" );
pr.printText ( "Cliente, " + cliente.cif + " " + cliente.nombre + "\n" );
pr.printText ( "\n" );
pr.turnWhiteBlack ( 1 );
pr.printText ( " Uds. PRODUCTO � � � � � � P.U. IMPORTE\n" );
pr.turnWhiteBlack ( 0 );
pr.setCharacterPrintMode ( CHARACTER_FONTB_SELECTED );
pr.setCharacterSize ( CHAR_WIDTH_1 | CHAR_HEIGHT_1 );
for ( int i = 0; i < tick->listaLineas() ->size(); ++i ) {
if ( i == tick->listaLineas()->size() - 1 )
pr.setUnderlineMode ( 1 );
linea = tick->listaLineas() ->at ( i );
BlFixed iva = BlFixed ( linea->dbValue ( "ivalalbaran" ) );
BlFixed pvp = BlFixed ( linea->dbValue ( "pvplalbaran" ) );
pvp = pvp + pvp * iva / BlFixed ( "100" );
BlFixed pvptotal = BlFixed ( linea->dbValue ( "cantlalbaran" ) ) * pvp;
pr.printText ( linea->dbValue ( "cantlalbaran" ).rightJustified ( 5, ' ', true ) + " " );
pr.printText ( linea->dbValue ( "desclalbaran" ).leftJustified ( 27, ' ', true ) + " " );
QString pvpstr = pvp.toQString();
QString pvptotalstr = pvptotal.toQString();
pr.printText ( QString ( pvpstr + "�" ).rightJustified ( 10, ' ', true ) + " " );
pr.printText ( QString ( pvptotalstr + "�" ).rightJustified ( 10, ' ', true ) );
pr.printText ( "\n" );
} // end for
pr.setUnderlineMode ( 0 );
pr.setJustification ( BlEscPrinter::right );
pr.setCharacterPrintMode ( CHARACTER_FONTA_SELECTED );
pr.printText ( "Base Imponible: " + total.baseImponible.toQString() + "�\n" );
pr.printText ( "IVA " + total.iva.toQString() + "%:" + ( total.totalIva - total.baseImponible ).toQString() + "�\n" );
pr.setCharacterPrintMode ( CHARACTER_FONTA_SELECTED | EMPHASIZED_MODE | DOUBLE_HEIGHT | DOUBLE_WIDTH );
pr.printText ( "TOTAL: " + total.totalIva.toQString() + "�\n" );
pr.printText ( "\n\n" );
pr.setJustification ( BlEscPrinter::left );
pr.setCharacterPrintMode ( CHARACTER_FONTA_SELECTED );
pr.printText ( "Le ha atendido " + trabajador.nombre + "\n" );
pr.printText ( "\n" );
pr.printText ( "Tel. " + empresa.telefono + "\n" );
pr.printText ( "\n" );
pr.setJustification ( BlEscPrinter::center );
pr.setColor ( red );
pr.printText ( "*** GRACIAS POR SU VISITA ***\n" );
QByteArray qba = tick->dbValue ( "refalbaran" ).toLatin1();
char* barcode = qba.data();
pr.setJustification ( BlEscPrinter::center );
pr.setBarcodeFormat ( 2, 50, both, fontB );
pr.printBarCode ( code39, qba.size(), barcode );
pr.cutPaperAndFeed ( true, 10 );
pr.print();
/// Si queremos imprimir con CUPS lo hacemos de esta otra forma
if (!g_confpr->value( CONF_TICKET_PRINTER_FILE).isEmpty() && g_confpr->value( CONF_TICKET_PRINTER_FILE) != "/dev/null") {
QString comando = "cat " + g_confpr->value(CONF_DIR_USER) + "bulmatpv_ticket_tc.esc" + " > " + g_confpr->value( CONF_TICKET_PRINTER_FILE );
system ( comando.toLatin1().data() );
} else if (g_confpr->value(CONF_CUPS_DEFAULT_PRINTER).isEmpty() || g_confpr->value(CONF_CUPS_DEFAULT_PRINTER).toLower() == "none") {
BlDebug::blDebug("Debe establecer el parametro CONF_CUPS_DEFAULT_PRINTER o CONF_TICKET_PRINTER_FILE para imprimir el ticket " , 2);
} else {
blRawPrint ("bulmatpv_ticket_tc.esc");
} // end if
BlDebug::blDebug("END pluginbt_aliastallasycolores::BtTicket_imprimir",0);
return -1;
}
示例14: MTicketIVAInc_pintar
int MTicketIVAInc_pintar ( MTicketIVAInc *mtick )
{
BL_FUNC_DEBUG
QString query;
QString buscar;
BtTicket *tick = ( ( BtCompany * ) mtick->mainCompany() )->ticketActual();
QString plainTextContent = "";
QString htmlContent = "<font size=\"4\", font-family:monospace>";
htmlContent += "Ticket: " + tick->dbValue ( "nomticket" ) + "<BR>";
plainTextContent += "Ticket: " + tick->dbValue ( "nomticket" ) + "\n";
query = "SELECT idtrabajador, nomtrabajador FROM trabajador WHERE idtrabajador = " + tick->dbValue ( "idtrabajador" );
BlDbRecordSet *rsTrabajador = mtick->mainCompany()->loadQuery ( query );
plainTextContent += "Trabajador: " + rsTrabajador->value( "nomtrabajador" ) + "\n";
htmlContent += "Trabajador: " + rsTrabajador->value( "nomtrabajador" ) + "<br>";
delete rsTrabajador;
query = "SELECT idcliente, nomcliente FROM cliente WHERE idcliente = " + tick->dbValue ( "idcliente" );
BlDbRecordSet *rsCliente = mtick->mainCompany()->loadQuery ( query );
plainTextContent += "Cliente: " + rsCliente->value( "nomcliente" ) + "\n";
htmlContent += "Cliente: " + rsCliente->value( "nomcliente" ) + "<br>";
delete rsCliente;
htmlContent += "<br>";
htmlContent += "<TABLE border=\"0\" width=\"100%\">";
htmlContent += "<tr><td>" + QString(_("CANT:")) + "</td><td width=\"30%\">" + QString(_("ARTI:")) + "</td><td>" + QString(_("TALLA:")) + "</td><td>" + QString(_("COLOR:")) + "</td><td>" + QString(_("PREC:")) + "</td></tr>";
htmlContent += "<tr><td colspan=\"5\" width=\"100%\" ><hr></td></tr>";
plainTextContent += "\n";
plainTextContent += " " + QString(_("CANT:").rightJustified( 7, ' ', true )) + " " + QString(_("ARTI:").leftJustified ( 15, ' ', true )) + " " + QString(_("TALLA:").leftJustified( 7, ' ', true ))+ " " + QString(_("COLOR:").leftJustified( 7, ' ', true ))+ " " + QString(_("PRECIO:").leftJustified( 9, ' ', true )) + "\n";
plainTextContent += "-----------------------------------------------------------\n";
// if (tick->dbValue("nomticket") != "") {
// htmlContent += "<TR><TD colspan=\"5\" align=\"center\"><B>" + tick->dbValue ( "nomticket" ) + "</B></td></tr>";
// } // end if
BlDbRecord *item;
for ( int i = 0; i < tick->listaLineas()->size(); ++i ) {
item = tick->listaLineas()->at ( i );
QString bgcolor = "#FFFFFF";
if ( item == tick->lineaActBtTicket() ) {
buscar = item->dbValue ( "nomarticulo" );
bgcolor = "#CCCCFF";
plainTextContent += "> ";
} else {
plainTextContent += " ";
} // end if
htmlContent += "<TR>";
htmlContent += "<TD bgcolor=\"" + bgcolor + "\" align=\"right\" width=\"50\">" + item->dbValue ( "cantlalbaran" ) + "</TD>";
htmlContent += "<TD bgcolor=\"" + bgcolor + "\" whidth>" + item->dbValue ( "nomarticulo" ) + "</TD>";
htmlContent += "<TD bgcolor=\"" + bgcolor + "\">" + item->dbValue ( "nomtc_talla" ) + "</TD>";
htmlContent += "<TD bgcolor=\"" + bgcolor + "\">" + item->dbValue ( "nomtc_color" ) + "</TD>";
BlFixed totalLinea ( "0.00" );
totalLinea = BlFixed ( item->dbValue ( "cantlalbaran" ) ) * BlFixed ( item->dbValue ( "pvpivainclalbaran" ) );
htmlContent += "<TD bgcolor=\"" + bgcolor + "\" align=\"right\" width=\"50\">" + totalLinea.toQString() + "</TD>";
htmlContent += "</TR>";
plainTextContent += item->dbValue("cantlalbaran").rightJustified ( 7, ' ', true ) + " ";
plainTextContent += item->dbValue("nomarticulo").leftJustified ( 20, ' ', true ) + " ";
plainTextContent += item->dbValue("nomtc_talla").leftJustified ( 7, ' ', true ) + " ";
plainTextContent += item->dbValue("nomtc_color").leftJustified ( 7, ' ', true ) + " ";
plainTextContent += totalLinea.toQString().leftJustified ( 9, ' ', true ) + "\n";
} // end for
htmlContent+= "</TABLE>";
htmlContent += "<HR>";
base basesimp;
base basesimpreqeq;
BlDbRecord *linea;
QString l;
BlFixed irpf ( "0" );
BlDbRecordSet *cur = mtick->mainCompany()->loadQuery ( "SELECT * FROM configuracion WHERE nombre = 'IRPF'" );
if ( cur ) {
if ( !cur->eof() ) {
irpf = BlFixed ( cur->value( "valor" ) );
} // end if
delete cur;
} // end if
BlFixed descuentolinea ( "0.00" );
for ( int i = 0; i < tick->listaLineas()->size(); ++i ) {
linea = tick->listaLineas()->at ( i );
BlFixed cant ( linea->dbValue ( "cantlalbaran" ) );
BlFixed pvpund ( linea->dbValue ( "pvpivainclalbaran" ) );
BlFixed desc1 ( linea->dbValue ( "descuentolalbaran" ) );
BlFixed cantpvp = cant * pvpund;
BlFixed iva ( linea->dbValue ( "ivalalbaran" ) );
BlFixed base = cantpvp - cantpvp * desc1 / 100;
base = base / ( BlFixed ( "1" ) + ( iva / BlFixed ( "100" ) ) );
descuentolinea = descuentolinea + ( cantpvp * desc1 / 100 );
basesimp[linea->dbValue ( "ivalalbaran" ) ] = basesimp[linea->dbValue ( "ivalalbaran" ) ] + base;
basesimpreqeq[linea->dbValue ( "reqeqlalbaran" ) ] = basesimpreqeq[linea->dbValue ( "reqeqlalbaran" ) ] + base;
} // end for
//.........这里部分代码省略.........
示例15: presentar
}
/** Hace la carga del listado.
Para ello genera los SELECTS con ayuda de generaFiltro y los pasa al SubFormulario para que los presente.
Tambien hace un select de calculo de totales y lo presenta en el textEdit correspondiente.
*/
void CobrosList::presentar()
{
BL_FUNC_DEBUG
if ( mainCompany() != NULL ) {
QString query = "SELECT * FROM cobro LEFT JOIN cliente ON cliente.idcliente = cobro.idcliente LEFT JOIN forma_pago ON cobro.idforma_pago = forma_pago.idforma_pago LEFT JOIN trabajador ON trabajador.idtrabajador = cobro.idtrabajador WHERE 1 = 1 " + generaFiltro();
mui_list->load ( query );
/// Hacemos el calculo del total.
BlFixed total = mui_list->sumarCampo ( "cantcobro" );
m_total->setText ( total.toQString() );
} // end if
}
/** Metodo auxiliar que genera la clausula WHERE del listado con las opciones de filtrado especificadas.
*/
const QString CobrosList::generaFiltro()
{
BL_FUNC_DEBUG
QString filtro = "";
/// Hacemos el filtrado like del campo m_filtro
filtro += mui_list->likeFilterSQL(m_filtro->text());