@@ -486,7 +486,7 @@ fn trans_line_om_fields_unset_tax_push_record() -> TestSyncOutgoingRecord {
486
486
}
487
487
}
488
488
489
- /// When invoice line was cancelled
489
+ // When invoice line was cancelled
490
490
const TRANS_LINE_NEGATIVE : ( & str , & str ) = (
491
491
"1CC10911C7F64369B965181D78696837" ,
492
492
r#"{
@@ -535,20 +535,19 @@ const TRANS_LINE_NEGATIVE: (&str, &str) = (
535
535
"sentQuantity": 0,
536
536
"optionID": "",
537
537
"isVVMPassed": "",
538
- "program_ID": "",
539
538
"prescribedQuantity": 0,
540
539
"vaccine_vial_monitor_status_ID": "",
541
540
"sent_pack_size": 0,
542
541
"custom_data": null,
543
542
"medicine_administrator_ID": "",
544
- "om_item_code": null ,
543
+ "om_item_code": "item_a_code" ,
545
544
"om_tax": null,
546
- "om_total_before_tax": null ,
547
- "om_total_after_tax": null ,
545
+ "om_total_before_tax": 4000.0 ,
546
+ "om_total_after_tax": 4000.0 ,
548
547
"om_item_variant_id": null
549
548
}"# ,
550
549
) ;
551
- fn trans_line_negative ( ) -> TestSyncIncomingRecord {
550
+ fn trans_line_negative_pull_record ( ) -> TestSyncIncomingRecord {
552
551
TestSyncIncomingRecord :: new_pull_upsert (
553
552
TABLE_NAME ,
554
553
TRANS_LINE_NEGATIVE ,
@@ -578,14 +577,43 @@ fn trans_line_negative() -> TestSyncIncomingRecord {
578
577
} ,
579
578
)
580
579
}
580
+ fn trans_line_negative_push_record ( ) -> TestSyncOutgoingRecord {
581
+ TestSyncOutgoingRecord {
582
+ table_name : TABLE_NAME . to_string ( ) ,
583
+ record_id : TRANS_LINE_NEGATIVE . 0 . to_string ( ) ,
584
+ push_data : json ! ( LegacyTransLineRow {
585
+ id: TRANS_LINE_NEGATIVE . 0 . to_string( ) ,
586
+ invoice_id: "outbound_shipment_a" . to_string( ) ,
587
+ item_id: mock_item_a( ) . id,
588
+ item_name: mock_item_a( ) . name,
589
+ item_code: Some ( mock_item_a( ) . code) ,
590
+ stock_line_id: Some ( mock_stock_line_a( ) . id) ,
591
+ location_id: None ,
592
+ batch: None ,
593
+ expiry_date: None ,
594
+ pack_size: 1.0 ,
595
+ cost_price_per_pack: 200.0 ,
596
+ sell_price_per_pack: 200.0 ,
597
+ total_before_tax: Some ( 4000.0 ) ,
598
+ total_after_tax: Some ( 4000.0 ) ,
599
+ tax_percentage: None ,
600
+ r#type: LegacyTransLineType :: StockIn ,
601
+ number_of_packs: 20.0 ,
602
+ note: None ,
603
+ option_id: None ,
604
+ foreign_currency_price_before_tax: Some ( 200.0 ) ,
605
+ item_variant_id: None ,
606
+ } ) ,
607
+ }
608
+ }
581
609
582
610
pub ( crate ) fn test_pull_upsert_records ( ) -> Vec < TestSyncIncomingRecord > {
583
611
vec ! [
584
612
trans_line_1_pull_record( ) ,
585
613
trans_line_2_pull_record( ) ,
586
614
trans_line_om_fields_pull_record( ) ,
587
615
trans_line_om_fields_unset_tax_pull_record( ) ,
588
- trans_line_negative ( ) ,
616
+ trans_line_negative_pull_record ( ) ,
589
617
]
590
618
}
591
619
@@ -603,5 +631,6 @@ pub(crate) fn test_push_records() -> Vec<TestSyncOutgoingRecord> {
603
631
trans_line_2_push_record( ) ,
604
632
trans_line_om_fields_push_record( ) ,
605
633
trans_line_om_fields_unset_tax_push_record( ) ,
634
+ trans_line_negative_push_record( ) ,
606
635
]
607
636
}
0 commit comments