@@ -325,26 +325,26 @@ public byte[] GenerateBytesExcel(AuditFile auditFile, FormatoOutput formatoOutpu
325325 . Customers . SingleOrDefault ( w => ( w . CustomerID ?? string . Empty ) . Equals ( factura . CustomerID , StringComparison . OrdinalIgnoreCase ) ) ?
326326 . CompanyName ?? string . Empty ) ;
327327
328- row . CreateCell ( 15 ) . SetCellValue ( factura . DocumentTotals ? . TaxPayable . ToString ( ) ?? "0" ) ;
329- row . CreateCell ( 17 ) . SetCellValue ( factura . DocumentTotals ? . NetTotal . ToString ( ) ?? "0" ) ;
330- row . CreateCell ( 20 ) . SetCellValue ( ( factura . Lines ? . Sum ( s => s . SettlementAmount ) ?? 0m ) . ToString ( ) ) ;
331- row . CreateCell ( 21 ) . SetCellValue ( factura . DocumentTotals ? . GrossTotal . ToString ( ) ?? "0" ) ;
332- row . CreateCell ( 22 ) . SetCellValue ( factura . DocumentTotals ? . Payments . Sum ( s => s . PaymentAmount ) . ToString ( ) ?? "0" ) ;
328+ row . CreateCell ( 15 ) . SetCellValue ( Convert . ToDouble ( factura . DocumentTotals ? . TaxPayable ?? 0m ) ) ;
329+ row . CreateCell ( 17 ) . SetCellValue ( Convert . ToDouble ( factura . DocumentTotals ? . NetTotal ?? 0m ) ) ;
330+ row . CreateCell ( 20 ) . SetCellValue ( Convert . ToDouble ( factura . Lines ? . Sum ( s => s . SettlementAmount ) ?? 0m ) ) ;
331+ row . CreateCell ( 21 ) . SetCellValue ( Convert . ToDouble ( factura . DocumentTotals ? . GrossTotal ?? 0m ) ) ;
332+ row . CreateCell ( 22 ) . SetCellValue ( Convert . ToDouble ( factura . DocumentTotals ? . Payments . Sum ( s => s . PaymentAmount ) ?? 0m ) ) ;
333333
334334 decimal impostos = factura . Lines ?
335335 . FirstOrDefault ( w =>
336336 w . Tax . Where ( wh => wh . TaxPercentage != 0m ) . FirstOrDefault ( ) ? . TaxPercentage != 0m ) ?
337337 . Tax . FirstOrDefault ( w => w . TaxPercentage != 0m ) ? . TaxPercentage ?? 0m ;
338338
339- row . CreateCell ( 23 ) . SetCellValue ( factura . Lines ?
339+ row . CreateCell ( 23 ) . SetCellValue ( Convert . ToDouble ( factura . Lines ?
340340 . FirstOrDefault ( w =>
341341 w . Tax . Where ( wh => wh . TaxPercentage != 0m ) . FirstOrDefault ( ) ? . TaxPercentage != 0m ) ?
342- . Tax . FirstOrDefault ( w => w . TaxPercentage != 0m ) ? . TaxPercentage . ToString ( ) ?? "0" ) ;
342+ . Tax . FirstOrDefault ( w => w . TaxPercentage != 0m ) ? . TaxPercentage ?? 0m ) ) ;
343343
344- row . CreateCell ( 24 ) . SetCellValue ( factura . DocumentTotals ? . NetTotal . ToString ( ) ?? "0" ) ;
345- row . CreateCell ( 25 ) . SetCellValue ( ( factura . Lines ? . Sum ( s => s . SettlementAmount ) ?? 0m ) . ToString ( ) ) ;
346- row . CreateCell ( 26 ) . SetCellValue ( factura . DocumentTotals ? . TaxPayable . ToString ( ) ?? "0" ) ;
347- row . CreateCell ( 27 ) . SetCellValue ( factura . DocumentTotals ? . GrossTotal . ToString ( ) ?? "0" ) ;
344+ row . CreateCell ( 24 ) . SetCellValue ( Convert . ToDouble ( factura . DocumentTotals ? . NetTotal ?? 0m ) ) ;
345+ row . CreateCell ( 25 ) . SetCellValue ( Convert . ToDouble ( factura . Lines ? . Sum ( s => s . SettlementAmount ) ?? 0m ) ) ;
346+ row . CreateCell ( 26 ) . SetCellValue ( Convert . ToDouble ( factura . DocumentTotals ? . TaxPayable ?? 0m ) ) ;
347+ row . CreateCell ( 27 ) . SetCellValue ( Convert . ToDouble ( factura . DocumentTotals ? . GrossTotal ?? 0m ) ) ;
348348 row . CreateCell ( 28 ) . SetCellValue ( auditFile . Header ? . CurrencyCode ?? string . Empty ) ;
349349 row . CreateCell ( 29 ) . SetCellValue ( taxaCambio ) ;
350350 } ) ;
0 commit comments