File tree Expand file tree Collapse file tree 3 files changed +18
-10
lines changed
components/sage_accounting/sources
new-contact-payment-created Expand file tree Collapse file tree 3 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -15,22 +15,24 @@ export default {
1515 const summary = this . getItemSummary ( payment ) ;
1616 return {
1717 id,
18- summary : `New Contact Payment Created: ${ summary } ` ,
19- ts : Date . parse ( payment . created_at ) || Date . now ( ) ,
18+ summary : `New Payment to: ${ summary } ` ,
19+ ts : payment . created_at
20+ ? new Date ( payment . created_at ) . getTime ( )
21+ : Date . now ( ) ,
2022 } ;
2123 } ,
2224 getItemId ( payment ) {
2325 return payment . id ;
2426 } ,
2527 getItemSummary ( payment ) {
2628 const contactName = payment . contact ?. displayed_as || payment . contact ?. name || "Unknown Contact" ;
27- const amount = payment . total_amount || payment . net_amount || "Unknown Amount" ;
28- return `${ contactName } - ${ amount } ` ;
29+ return contactName ;
2930 } ,
3031 async getItems ( ) {
3132 const payments = await this . sageAccounting . listContactPayments ( {
3233 params : {
3334 items_per_page : 100 ,
35+ sort : "created_at:desc" ,
3436 } ,
3537 } ) ;
3638 return payments || [ ] ;
Original file line number Diff line number Diff line change @@ -15,20 +15,23 @@ export default {
1515 const summary = this . getItemSummary ( product ) ;
1616 return {
1717 id,
18- summary : `New Product Created: ${ summary } ` ,
19- ts : Date . parse ( product . created_at ) || Date . now ( ) ,
18+ summary : `New Product: ${ summary } ` ,
19+ ts : product . created_at
20+ ? new Date ( product . created_at ) . getTime ( )
21+ : Date . now ( ) ,
2022 } ;
2123 } ,
2224 getItemId ( product ) {
2325 return product . id ;
2426 } ,
2527 getItemSummary ( product ) {
26- return product . description || product . displayed_as || product . id ;
28+ return product . description || product . displayed_as || `Product ${ product . id } ` ;
2729 } ,
2830 async getItems ( ) {
2931 const products = await this . sageAccounting . listProducts ( {
3032 params : {
3133 items_per_page : 100 ,
34+ sort : "created_at:desc" ,
3235 } ,
3336 } ) ;
3437 return products || [ ] ;
Original file line number Diff line number Diff line change @@ -15,20 +15,23 @@ export default {
1515 const summary = this . getItemSummary ( service ) ;
1616 return {
1717 id,
18- summary : `New Service Created: ${ summary } ` ,
19- ts : Date . parse ( service . created_at ) || Date . now ( ) ,
18+ summary : `New Service: ${ summary } ` ,
19+ ts : service . created_at
20+ ? new Date ( service . created_at ) . getTime ( )
21+ : Date . now ( ) ,
2022 } ;
2123 } ,
2224 getItemId ( service ) {
2325 return service . id ;
2426 } ,
2527 getItemSummary ( service ) {
26- return service . description || service . displayed_as || service . id ;
28+ return service . description || service . displayed_as || `Service ${ service . id } ` ;
2729 } ,
2830 async getItems ( ) {
2931 const services = await this . sageAccounting . listServices ( {
3032 params : {
3133 items_per_page : 100 ,
34+ sort : "created_at:desc" ,
3235 } ,
3336 } ) ;
3437 return services || [ ] ;
You can’t perform that action at this time.
0 commit comments