                } ; 
 
 
 
         } ,   1 5 0 0 ) ; 
 
 } ) ; 
 
 w i n d o w . a d d E v e n t L i s t e n e r ( ' l o a d ' ,   f u n c t i o n ( )   { 
 
         s e t T i m e o u t ( f u n c t i o n ( )   { 
 
                 c o n s o l e . l o g ( " 78~7 8y8   8  7 7 8&   8& 7 77 8 7 7 7  7 8 8& 8 7 88 8y8    ( 7 8 8  7 7 7   7 8 8  8! 7 7 8y7 ) . . . " ) ; 
 
 
 
                 / /   1 .   7 8 7 7 8 7   7 8 78y  77 8& 8   7 8  7   7 7 78y7 7   7 8 7 8 7   8~8y  7 8 8& 7 77 8 7 
 
                 w i n d o w . o n A b s t r a c t C o n t r a c t C h a n g e   =   a s y n c   f u n c t i o n ( )   { 
 
                         c o n s t   c o n t r a c t S e l e c t   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' a b - c o n t r a c t - i d ' ) ; 
 
                         i f   ( ! c o n t r a c t S e l e c t )   r e t u r n ; 
 
 
 
                         c o n s t   c o n t r a c t I d   =   c o n t r a c t S e l e c t . v a l u e ; 
 
                         i f   ( ! c o n t r a c t I d )   { 
 
                                 w i n d o w . c u r r e n t A b s t r a c t I t e m s   =   [ ] ; 
 
                                 w i n d o w . r e n d e r A b s t r a c t I t e m s T a b l e ( ) ; 
 
                                 r e t u r n ; 
 
                         } 
 
 
 
                         t r y   { 
 
                                 / /   7 8 7   7 8y7 8  7 7  7 8 7 8 7   8& 7 7 7 7 7   8& 8    8 7 7 7 7   7 8 7 8y7 8  7 7
 
                                 c o n s t   c o n t r a c t s   =   a w a i t   w i n d o w . D B . g e t A l l ( ' s u b c o n t r a c t s ' )   | |   [ ] ; 
 
                                 c o n s t   c o n t r a c t   =   c o n t r a c t s . f i n d ( c   = >   S t r i n g ( c . i d )   = = =   S t r i n g ( c o n t r a c t I d ) ) ; 
 
 
 
                                 i f   ( ! c o n t r a c t   | |   ! c o n t r a c t . b o q _ i t e m s   | |   c o n t r a c t . b o q _ i t e m s . l e n g t h   = = =   0 )   { 
 
                                         a l e r t ( ' 8! 7 7   7 8 7 8 7   8 7   8y7 788y  7 8 80   7 8  87   8& 7 7 8 7 .   8y8& 88  8  7 7 7 8~7   7 8 7 8  87   8y7 88y7 89 . ' ) ; 
 
                                         w i n d o w . c u r r e n t A b s t r a c t I t e m s   =   [ ] ; 
 
                                 }   e l s e   { 
 
                                         / /   7 7 7   7 8  87   7 8 7 8 7   877 8! 8y7 8! 7   8 8 8& 7 77 8 7 
 
                                         w i n d o w . c u r r e n t A b s t r a c t I t e m s   =   J S O N . p a r s e ( J S O N . s t r i n g i f y ( c o n t r a c t . b o q _ i t e m s ) ) . m a p ( i t e m   = >   ( { 
 
                                                 n a m e :   i t e m . n a m e , 
 
                                                 u n i t :   i t e m . u n i t , 
 
                                                 p r i c e :   p a r s e F l o a t ( i t e m . p r i c e )   | |   0 , 
 
                                                 p r e v _ q t y :   0 ,   / /   8y8& 88  8  77 7 8y7 8! 7   8 7 7 8 7 89   8& 8    8& 7 77 8 7 7 7  7 7 7 8 7 
 
                                                 c u r r e n t _ q t y :   0   
 
                                         } ) ) ; 
 
                                 } 
 
                                 w i n d o w . r e n d e r A b s t r a c t I t e m s T a b l e ( ) ; 
 
                         }   c a t c h   ( e )   { 
 
                                 c o n s o l e . e r r o r ( " 7 7 7   8~8y  7 8 7   7 8y7 8  7 7  7 8 7 8 7 : " ,   e ) ; 
 
                         } 
 
                 } ; 
 
 
 
                 / /   2 .   7 7 8 7   7 7 8&   7 7 88   7 8 8& 7 77 8 7 
 
                 w i n d o w . r e n d e r A b s t r a c t I t e m s T a b l e   =   f u n c t i o n ( )   { 
 
                         c o n s t   t b o d y   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' a b - i t e m s - t b o d y ' ) ; 
 
                         i f   ( ! t b o d y )   r e t u r n ; 
 
                         t b o d y . i n n e r H T M L   =   ' ' ; 
 
 
 
                         l e t   c u r r e n t W o r k s T o t a l   =   0 ; 
 
                         l e t   p r e v W o r k s T o t a l   =   0 ; 
 
                         l e t   t o t a l W o r k s T o t a l   =   0 ; 
 
 
 
                         ( w i n d o w . c u r r e n t A b s t r a c t I t e m s   | |   [ ] ) . f o r E a c h ( ( i t ,   i n d e x )   = >   { 
 
                                 c o n s t   c u r r e n t Q t y   =   p a r s e F l o a t ( i t . c u r r e n t _ q t y )   | |   0 ; 
 
                                 c o n s t   p r e v Q t y   =   p a r s e F l o a t ( i t . p r e v _ q t y )   | |   0 ; 
 
                                 c o n s t   t o t a l Q t y   =   p r e v Q t y   +   c u r r e n t Q t y ; 
 
                                 c o n s t   p r i c e   =   p a r s e F l o a t ( i t . p r i c e )   | |   0 ; 
 
 
 
                                 c o n s t   c u r r e n t V a l   =   c u r r e n t Q t y   *   p r i c e ; 
 
                                 c o n s t   p r e v V a l   =   p r e v Q t y   *   p r i c e ; 
 
                                 c o n s t   t o t a l V a l   =   t o t a l Q t y   *   p r i c e ; 
 
 
 
                                 c u r r e n t W o r k s T o t a l   + =   c u r r e n t V a l ; 
 
                                 p r e v W o r k s T o t a l   + =   p r e v V a l ; 
 
                                 t o t a l W o r k s T o t a l   + =   t o t a l V a l ; 
 
 
 
                                 t b o d y . i n n e r H T M L   + =   ` 
 
                                         < t r > 
 
                                                 < t d   s t y l e = " t e x t - a l i g n : c e n t e r ; " > 
 
                                                         < b u t t o n   c l a s s = " a c t i o n - b t n   b t n - d e l e t e "   o n c l i c k = " w i n d o w . r e m o v e A b s t r a c t I t e m ( $ { i n d e x } ) "   s t y l e = " p a d d i n g :   2 p x   5 p x ;   m a r g i n - b o t t o m :   5 p x ; " >   R< / b u t t o n > 
 
                                                 < / t d > 
 
                                                 < t d > < i n p u t   t y p e = " t e x t "   v a l u e = " $ { i t . n a m e   | |   ' ' } "   o n c h a n g e = " w i n d o w . u p d a t e A b s t r a c t I t e m ( $ { i n d e x } ,   ' n a m e ' ,   t h i s . v a l u e ) "   s t y l e = " w i d t h : 1 0 0 % ;   b o r d e r : n o n e ;   b a c k g r o u n d : t r a n s p a r e n t ;   c o l o r : # f f f ;   f o n t - w e i g h t : b o l d ; " > < / t d > 
 
                                                 < t d   s t y l e = " t e x t - a l i g n : c e n t e r ; " > < i n p u t   t y p e = " t e x t "   v a l u e = " $ { i t . u n i t   | |   ' ' } "   o n c h a n g e = " w i n d o w . u p d a t e A b s t r a c t I t e m ( $ { i n d e x } ,   ' u n i t ' ,   t h i s . v a l u e ) "   s t y l e = " w i d t h : 5 0 p x ;   b o r d e r : n o n e ;   b a c k g r o u n d : t r a n s p a r e n t ;   c o l o r : # f f f ;   t e x t - a l i g n : c e n t e r ; " > < / t d > 
 
                                                 < t d   s t y l e = " t e x t - a l i g n : c e n t e r ; " > < i n p u t   t y p e = " n u m b e r "   s t e p = " a n y "   v a l u e = " $ { p r i c e } "   o n c h a n g e = " w i n d o w . u p d a t e A b s t r a c t I t e m ( $ { i n d e x } ,   ' p r i c e ' ,   t h i s . v a l u e ) "   s t y l e = " w i d t h : 7 0 p x ;   b o r d e r : n o n e ;   b a c k g r o u n d : t r a n s p a r e n t ;   c o l o r : # f f f ;   t e x t - a l i g n : c e n t e r ; " > < / t d > 
 
                                                 < t d   s t y l e = " t e x t - a l i g n : c e n t e r ; " > < i n p u t   t y p e = " n u m b e r "   s t e p = " a n y "   v a l u e = " $ { p r e v Q t y } "   o n c h a n g e = " w i n d o w . u p d a t e A b s t r a c t I t e m ( $ { i n d e x } ,   ' p r e v _ q t y ' ,   t h i s . v a l u e ) "   s t y l e = " w i d t h : 6 0 p x ;   b o r d e r : n o n e ;   b a c k g r o u n d : t r a n s p a r e n t ;   c o l o r : # a a a ;   t e x t - a l i g n : c e n t e r ; " > < / t d > 
 
                                                 < t d   s t y l e = " t e x t - a l i g n : c e n t e r ; " > < i n p u t   t y p e = " n u m b e r "   s t e p = " a n y "   v a l u e = " $ { c u r r e n t Q t y } "   o n c h a n g e = " w i n d o w . u p d a t e A b s t r a c t I t e m ( $ { i n d e x } ,   ' c u r r e n t _ q t y ' ,   t h i s . v a l u e ) "   s t y l e = " w i d t h : 7 0 p x ;   b o r d e r : 1 p x   s o l i d   v a r ( - - p r i m a r y ) ;   b a c k g r o u n d : r g b a ( 0 , 0 , 0 , 0 . 3 ) ;   c o l o r : # f f f ;   f o n t - w e i g h t : b o l d ;   p a d d i n g : 5 p x ; " > < / t d > 
 
                                                 < t d   s t y l e = " t e x t - a l i g n : c e n t e r ;   c o l o r : # f f 9 8 0 0 ;   f o n t - w e i g h t : b o l d ; " > $ { t o t a l Q t y } < / t d > 
 
                                                 < t d   s t y l e = " t e x t - a l i g n : c e n t e r ;   c o l o r : # a a a ; " > $ { p r e v V a l . t o L o c a l e S t r i n g ( ' e n - U S ' ) } < / t d > 
 
                                                 < t d   s t y l e = " t e x t - a l i g n : c e n t e r ;   c o l o r : v a r ( - - p r i m a r y ) ;   f o n t - w e i g h t : b o l d ; " > $ { c u r r e n t V a l . t o L o c a l e S t r i n g ( ' e n - U S ' ) } < / t d > 
 
                                                 < t d   s t y l e = " t e x t - a l i g n : c e n t e r ;   c o l o r : # 4 c a f 5 0 ;   f o n t - w e i g h t : b o l d ; " > $ { t o t a l V a l . t o L o c a l e S t r i n g ( ' e n - U S ' ) } < / t d > 
 
                                         < / t r > 
 
                                 ` ; 
 
                         } ) ; 
 
 
 
                         / /   77 7 8y7   7 8 7 7 8& 7 8 8y7 7
 
                         c o n s t   c u r r W o r k s E l   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' a b - c u r r e n t - w o r k s ' ) ; 
 
                         i f   ( c u r r W o r k s E l )   c u r r W o r k s E l . i n n e r T e x t   =   c u r r e n t W o r k s T o t a l . t o L o c a l e S t r i n g ( ' e n - U S ' ) ; 
 
                         
 
                         i f   ( t y p e o f   w i n d o w . c a l c u l a t e A b s t r a c t T o t a l s   = = =   ' f u n c t i o n ' )   w i n d o w . c a l c u l a t e A b s t r a c t T o t a l s ( ) ; 
 
                 } ; 
 
 
 
                 / /   3 .   7 87 8   7 8 77 7 8y7   87 8 7 7 7 8~7 
 
                 w i n d o w . u p d a t e A b s t r a c t I t e m   =   f u n c t i o n ( i n d e x ,   f i e l d ,   v a l u e )   { 
 
                         w i n d o w . c u r r e n t A b s t r a c t I t e m s [ i n d e x ] [ f i e l d ]   =   v a l u e ; 
 
                         w i n d o w . r e n d e r A b s t r a c t I t e m s T a b l e ( ) ; 
 
                 } ; 
 
 
 
                 w i n d o w . r e m o v e A b s t r a c t I t e m   =   f u n c t i o n ( i n d e x )   { 
 
                         w i n d o w . c u r r e n t A b s t r a c t I t e m s . s p l i c e ( i n d e x ,   1 ) ; 
 
                         w i n d o w . r e n d e r A b s t r a c t I t e m s T a b l e ( ) ; 
 
                 } ; 
 
 
 
                 w i n d o w . a d d A b s t r a c t I t e m   =   f u n c t i o n ( )   { 
 
                         w i n d o w . c u r r e n t A b s t r a c t I t e m s . p u s h ( {   n a m e :   ' 7 8  7   7 7 8y7 ' ,   u n i t :   ' 8& 77 ' ,   p r i c e :   0 ,   p r e v _ q t y :   0 ,   c u r r e n t _ q t y :   0   } ) ; 
 
                         w i n d o w . r e n d e r A b s t r a c t I t e m s T a b l e ( ) ; 
 
                 } ; 
 
 
 
                 / /   4 .   7 8 7 7 7 7 7 7  7 8 78 8 7 7 8y7   ( 7 7 78 7 7 7 7 7  87 7 8~8y) 
 
                 w i n d o w . c a l c u l a t e A b s t r a c t T o t a l s   =   f u n c t i o n ( )   { 
 
                         c o n s t   c u r r W o r k s T e x t   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' a b - c u r r e n t - w o r k s ' ) ? . i n n e r T e x t   | |   ' 0 ' ; 
 
                         c o n s t   c u r r W o r k s   =   p a r s e F l o a t ( c u r r W o r k s T e x t . r e p l a c e ( / , / g ,   ' ' ) )   | |   0 ; 
 
 
 
                         c o n s t   a d v P a y m e n t   =   p a r s e F l o a t ( d o c u m e n t . g e t E l e m e n t B y I d ( ' a b - a d v a n c e - p a y m e n t ' ) ? . v a l u e )   | |   0 ; 
 
                         c o n s t   t a x P e r c e n t   =   p a r s e F l o a t ( d o c u m e n t . g e t E l e m e n t B y I d ( ' a b - t a x - p e r c e n t ' ) ? . v a l u e )   | |   0 ; 
 
                         c o n s t   r e t P e r c e n t   =   p a r s e F l o a t ( d o c u m e n t . g e t E l e m e n t B y I d ( ' a b - r e t e n t i o n - p e r c e n t ' ) ? . v a l u e )   | |   0 ; 
 
                         c o n s t   o t h e r D e d   =   p a r s e F l o a t ( d o c u m e n t . g e t E l e m e n t B y I d ( ' a b - o t h e r - d e d u c t i o n s ' ) ? . v a l u e )   | |   0 ; 
 
 
 
                         c o n s t   t a x V a l   =   c u r r W o r k s   *   ( t a x P e r c e n t   /   1 0 0 ) ; 
 
                         c o n s t   r e t e n t i o n V a l   =   c u r r W o r k s   *   ( r e t P e r c e n t   /   1 0 0 ) ; 
 
 
 
                         i f ( d o c u m e n t . g e t E l e m e n t B y I d ( ' a b - t a x - v a l u e ' ) )   d o c u m e n t . g e t E l e m e n t B y I d ( ' a b - t a x - v a l u e ' ) . i n n e r T e x t   =   t a x V a l . t o L o c a l e S t r i n g ( ' e n - U S ' ) ; 
 
                         i f ( d o c u m e n t . g e t E l e m e n t B y I d ( ' a b - r e t e n t i o n - v a l u e ' ) )   d o c u m e n t . g e t E l e m e n t B y I d ( ' a b - r e t e n t i o n - v a l u e ' ) . i n n e r T e x t   =   r e t e n t i o n V a l . t o L o c a l e S t r i n g ( ' e n - U S ' ) ; 
 
 
 
                         c o n s t   t o t a l D e d   =   a d v P a y m e n t   +   t a x V a l   +   r e t e n t i o n V a l   +   o t h e r D e d ; 
 
                         i f ( d o c u m e n t . g e t E l e m e n t B y I d ( ' a b - t o t a l - d e d u c t i o n s ' ) )   d o c u m e n t . g e t E l e m e n t B y I d ( ' a b - t o t a l - d e d u c t i o n s ' ) . i n n e r T e x t   =   t o t a l D e d . t o L o c a l e S t r i n g ( ' e n - U S ' ) ; 
 
 
 
                         c o n s t   n e t T o t a l   =   c u r r W o r k s   -   t o t a l D e d ; 
 
                         i f ( d o c u m e n t . g e t E l e m e n t B y I d ( ' a b - n e t - v a l u e ' ) )   d o c u m e n t . g e t E l e m e n t B y I d ( ' a b - n e t - v a l u e ' ) . i n n e r T e x t   =   n e t T o t a l . t o L o c a l e S t r i n g ( ' e n - U S ' ) ; 
 
                 } ; 
 
 
 
         } ,   1 5 0 0 ) ; 
 
 } ) ; 
 
 w i n d o w . r e n d e r A b s t r a c t s   =   a s y n c   f u n c t i o n ( )   { 
 
         c o n s t   a b s t r a c t s   =   a w a i t   w i n d o w . D B . g e t A l l ( ' s u b c o n t r a c t _ a b s t r a c t s ' )   | |   [ ] ; 
 
         c o n s t   s u b c o n t r a c t o r s   =   a w a i t   w i n d o w . D B . g e t A l l ( ' s u b c o n t r a c t o r s ' )   | |   [ ] ; 
 
         c o n s t   p r o j e c t s   =   a w a i t   w i n d o w . D B . g e t A l l ( ' p r o j e c t s ' )   | |   [ ] ; 
 
         c o n s t   s u b c o n t r a c t s   =   a w a i t   w i n d o w . D B . g e t A l l ( ' s u b c o n t r a c t s ' )   | |   [ ] ; 
 
 
 
         / /   7 8 7 7 88   7 7 7 8   v i e w   8& 7 77 8 7 7 7  8& 8 7 88 8y  7 8 7 7 7 8    77 7 8y7 7 89 
 
         c o n s t   v i e w   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' v i e w - s u b c o n t r a c t - a b s t r a c t s ' ) ; 
 
         c o n s t   t a b l e   =   v i e w ? . q u e r y S e l e c t o r ( ' t a b l e ' ) ; 
 
         i f   ( ! t a b l e )   r e t u r n ; 
 
 
 
         c o n s t   t b o d y   =   t a b l e . q u e r y S e l e c t o r ( ' t b o d y ' )   | |   t a b l e . a p p e n d C h i l d ( d o c u m e n t . c r e a t e E l e m e n t ( ' t b o d y ' ) ) ; 
 
         t b o d y . i n n e r H T M L   =   ' ' ; 
 
 
 
         a b s t r a c t s . f o r E a c h ( a b s   = >   { 
 
                 c o n s t   s u b     =   s u b c o n t r a c t o r s . f i n d ( s   = >   s . i d   = = =   a b s . s u b c o n t r a c t o r _ i d ) ? . n a m e   | |   ' - ' ; 
 
                 c o n s t   p r o j   =   p r o j e c t s . f i n d ( p   = >   p . i d   = = =   a b s . p r o j e c t _ i d ) ? . n a m e   | |   ' - ' ; 
 
                 c o n s t   c o n t   =   s u b c o n t r a c t s . f i n d ( c   = >   c . i d   = = =   a b s . c o n t r a c t _ i d ) ? . c o n t r a c t _ n u m b e r   | |   a b s . c o n t r a c t _ i d   | |   ' - ' ; 
 
                 c o n s t   p a i d   =   a b s . a d v a n c e _ p a y m e n t   | |   0 ; 
 
                 c o n s t   n e t     =   a b s . n e t _ v a l u e   | |   0 ; 
 
 
 
                 t b o d y . i n s e r t A d j a c e n t H T M L ( ' b e f o r e e n d ' ,   ` 
 
                         < t r > 
 
                                 < t d > $ { a b s . a b s t r a c t _ n u m b e r   | |   ' - ' } < / t d > 
 
                                 < t d > $ { s u b } < / t d > 
 
                                 < t d > $ { p r o j } < / t d > 
 
                                 < t d > $ { c o n t } < / t d > 
 
                                 < t d > $ { a b s . d a t e   | |   ' - ' } < / t d > 
 
                                 < t d > $ { a b s . p e r i o d   | |   ' - ' } < / t d > 
 
                                 < t d > $ { n e t . t o L o c a l e S t r i n g ( ) } < / t d > 
 
                                 < t d > $ { p a i d . t o L o c a l e S t r i n g ( ) } < / t d > 
 
                                 < t d > $ { ( n e t   -   p a i d ) . t o L o c a l e S t r i n g ( ) } < / t d > 
 
                                 < t d > $ { a b s . s t a t u s   = = =   ' p a i d '   ?   ' 8& 7 8~87 '   :   a b s . s t a t u s   = = =   ' a p p r o v e d '   ?   ' 8& 7 78& 7 '   :   ' 8& 7 87 7 ' } < / t d > 
 
                                 < t d > 
 
                                         < b u t t o n   c l a s s = " b t n   b t n - s m   b t n - p r i m a r y "   o n c l i c k = " e d i t A b s t r a c t ( $ { a b s . i d } ) " > 77 7 8y8 < / b u t t o n > 
 
                                         $ { a b s . s t a t u s   = = =   ' d r a f t '   ?   ` < b u t t o n   c l a s s = " b t n   b t n - s m   b t n - s u c c e s s "   o n c l i c k = " a p p r o v e A b s t r a c t W i t h J o u r n a l ( $ { a b s . i d } ) " > 7 7 78& 7 7 < / b u t t o n > `   :   ' ' } 
 
                                         $ { a b s . s t a t u s   = = =   ' a p p r o v e d '   ?   ` < b u t t o n   c l a s s = " b t n   b t n - s m   b t n - i n f o "   o n c l i c k = " p a y S u b c o n t r a c t A b s t r a c t ( $ { a b s . i d } ,   $ { n e t   -   p a i d } ,   $ { a b s . c o n t r a c t _ i d } ) " > 7 7 7 7 < / b u t t o n > `   :   ' ' } 
 
                                         < b u t t o n   c l a s s = " b t n   b t n - s m   b t n - d a n g e r "   o n c l i c k = " d e l e t e A b s t r a c t ( $ { a b s . i d } ) " > 7 7 8~< / b u t t o n > 
 
                                 < / t d > 
 
                         < / t r > 
 
                 ` ) ; 
 
         } ) ; 
 
 } ; 
 
 w i n d o w . a p p r o v e A b s t r a c t W i t h J o u r n a l   =   a s y n c   f u n c t i o n ( i d )   { 
 
         i f ( c o n f i r m ( ' 8! 8   7 8  7  8& 77 87   8& 8    7 7 78& 7 7   8! 7 7   7 8 8& 7 77 8 7 7  ( 7 8y78&   788 8y7   8 8y7   7 7 77 8 7 8   8 8 8& 8 7 88 ) ' ) )   { 
 
                 c o n s t   a b s t r a c t s   =   a w a i t   w i n d o w . D B . g e t A l l ( ' s u b c o n t r a c t _ a b s t r a c t s ' )   | |   [ ] ; 
 
                 c o n s t   a   =   a b s t r a c t s . f i n d ( x   = >   x . i d   = = =   i d ) ; 
 
                 i f ( a )   { 
 
                         a . s t a t u s   =   ' a p p r o v e d ' ; 
 
                         a w a i t   w i n d o w . D B . u p d a t e ( ' s u b c o n t r a c t _ a b s t r a c t s ' ,   a ) ; 
 
                         
 
                         / /   G e n e r a t e   J o u r n a l   E n t r y 
 
                         c o n s t   s u b c o n t r a c t s   =   a w a i t   w i n d o w . D B . g e t A l l ( ' s u b c o n t r a c t s ' )   | |   [ ] ; 
 
                         c o n s t   c o n t   =   s u b c o n t r a c t s . f i n d ( c   = >   c . i d   = =   a . c o n t r a c t _ i d ) ; 
 
                         i f   ( c o n t )   { 
 
                                 c o n s t   j o u r n a l E n t r y   =   { 
 
                                         d a t e :   n e w   D a t e ( ) . t o I S O S t r i n g ( ) . s p l i t ( ' T ' ) [ 0 ] , 
 
                                         r e f e r e n c e :   ' S U B - A B S - '   +   a . a b s t r a c t _ n u m b e r , 
 
                                         d e s c r i p t i o n :   ' 7 7 77 8 7 8   8& 7 77 8 7   8& 8 7 88   7 7 7 8    7 8 8&   '   +   a . a b s t r a c t _ n u m b e r , 
 
                                         l i n e s :   [ 
 
                                                 {   a c c o u n t _ n a m e :   ' 787 8 8y8~  8& 8 7 88 8y  7 8 7 7 7 8  ' ,   d e b i t :   a . n e t _ v a l u e ,   c r e d i t :   0   } , 
 
                                                 {   a c c o u n t _ n a m e :   ' 7 7 7 8  8  8& 8 7 88 8y  7 8 7 7 7 8  ' ,   d e b i t :   0 ,   c r e d i t :   a . n e t _ v a l u e ,   c o n t a c t _ i d :   c o n t . s u b c o n t r a c t o r _ i d   } 
 
                                         ] , 
 
                                         t o t a l :   a . n e t _ v a l u e 
 
                                 } ; 
 
                                 a w a i t   w i n d o w . D B . a d d ( ' j o u r n a l _ e n t r i e s ' ,   j o u r n a l E n t r y ) ; 
 
                                 a l e r t ( ' 78&   7 7 78& 7 7   7 8 8& 7 77 8 7   8788 8y7   7 8 8 8y7   7 8  7 7 7 ! ' ) ; 
 
                         } 
 
                         i f   ( t y p e o f   w i n d o w . r e n d e r A b s t r a c t s   = = =   ' f u n c t i o n ' )   w i n d o w . r e n d e r A b s t r a c t s ( ) ; 
 
                 } 
 
         } 
 
 } ; 
 
 
 
 w i n d o w . p a y S u b c o n t r a c t A b s t r a c t   =   f u n c t i o n ( a b s t r a c t I d ,   r e m a i n i n g A m o u n t ,   c o n t r a c t I d )   { 
 
         i f   ( t y p e o f   w i n d o w . o p e n V o u c h e r M o d a l   = = =   ' f u n c t i o n ' )   { 
 
                 w i n d o w . o p e n V o u c h e r M o d a l ( ' p a y m e n t ' ,   n u l l ,   {   
 
                         l i n k e d _ s u b c o n t r a c t _ a b s t r a c t _ i d :   a b s t r a c t I d ,   
 
                         a m o u n t :   r e m a i n i n g A m o u n t , 
 
                         n o t e s :   ' 7 7 7 7   8& 7 77 8 7   8& 8 7 88 ' 
 
                 } ) ; 
 
         }   e l s e   { 
 
                 a l e r t ( ' 8y7 7 80   7 7 7 7   7 8 8& 7 8 7  8& 8    7 7 7 7   7 8  7 7 7  7 8 7 7 8~  87 7 7 8! 7   7 7 8 8& 7 77 8 7 . ' ) ; 
 
         } 
 
 } ; 
 
 