@@ -432,30 +432,6 @@ function SuccessFailChart({ data }) {
432432}
433433
434434function Summary ( { summary, details, daily, monthly } ) {
435- function downloadInvoice ( ) {
436- const pdflib = window . jspdf ;
437- if ( ! pdflib || ! pdflib . jsPDF ) return ;
438- const doc = new pdflib . jsPDF ( ) ;
439- doc . text ( `Invoice for ${ summary . period } ` , 10 , 10 ) ;
440- let y = 20 ;
441- doc . text ( 'Account' , 10 , y ) ;
442- doc . text ( 'Core Hours' , 80 , y ) ;
443- doc . text ( 'Cost ($)' , 150 , y ) ;
444- y += 10 ;
445- details . forEach ( d => {
446- doc . text ( String ( d . account ) , 10 , y ) ;
447- doc . text ( String ( d . core_hours ) , 80 , y ) ;
448- doc . text ( String ( d . cost ) , 150 , y ) ;
449- y += 10 ;
450- if ( y > 280 ) {
451- doc . addPage ( ) ;
452- y = 10 ;
453- }
454- } ) ;
455- const safePeriod = summary . period . replace ( / [ ^ 0 - 9 A - Z a - z _ - ] / g, '' ) ;
456- doc . save ( `invoice-${ safePeriod } .pdf` ) ;
457- }
458-
459435 const sparklineData = daily . map ( d => d . core_hours ) ;
460436 const ratio = summary . projected_revenue
461437 ? summary . total / summary . projected_revenue
@@ -496,11 +472,6 @@ function Summary({ summary, details, daily, monthly }) {
496472 )
497473 )
498474 ) ,
499- React . createElement (
500- 'div' ,
501- { style : { margin : '1em 0' } } ,
502- React . createElement ( 'button' , { onClick : downloadInvoice } , 'Download Invoice' )
503- ) ,
504475 React . createElement (
505476 'div' ,
506477 { className : 'kpi-grid' } ,
0 commit comments