@@ -15,7 +15,7 @@ public void allocation_to_invoice()
1515 {
1616 var creditNote = new CreditNotes . CreditNotesTest ( ) . Given_an_authorised_creditnote ( CreditNoteType . AccountsReceivable ) ;
1717 var invoice = new Create ( ) . Given_an_authorised_invoice ( InvoiceType . AccountsReceivable ) ;
18- var expected = Math . Min ( creditNote . Total , invoice . Total . GetValueOrDefault ( ) ) ;
18+ var expected = Math . Min ( creditNote . Total . GetValueOrDefault ( ) , invoice . Total . GetValueOrDefault ( ) ) ;
1919
2020 var result = Api . Allocations . Add ( new Allocation
2121 {
@@ -34,7 +34,7 @@ public void allocation_to_invoice_minimal()
3434 {
3535 var creditNote = new CreditNotes . CreditNotesTest ( ) . Given_an_authorised_creditnote ( ) ;
3636 var invoice = new Create ( ) . Given_an_authorised_invoice ( ) ;
37- var expected = Math . Min ( creditNote . Total , invoice . Total . GetValueOrDefault ( ) ) ;
37+ var expected = Math . Min ( creditNote . Total . GetValueOrDefault ( ) , invoice . Total . GetValueOrDefault ( ) ) ;
3838
3939 var result = Api . Allocations . Add ( new Allocation
4040 {
@@ -54,7 +54,7 @@ public void allocation_on_creditnote()
5454 {
5555 var creditNote = new CreditNotes . CreditNotesTest ( ) . Given_an_authorised_creditnote ( ) ;
5656 var invoice = new Create ( ) . Given_an_authorised_invoice ( ) ;
57- var expected = Math . Min ( creditNote . Total , invoice . Total . GetValueOrDefault ( ) ) ;
57+ var expected = Math . Min ( creditNote . Total . GetValueOrDefault ( ) , invoice . Total . GetValueOrDefault ( ) ) ;
5858
5959 Api . Allocations . Add ( new Allocation
6060 {
@@ -114,7 +114,7 @@ public void Credit_notes_show_up_on_invoices()
114114 {
115115 var creditNote = new CreditNotes . CreditNotesTest ( ) . Given_an_authorised_creditnote ( ) ;
116116 var invoice = new Create ( ) . Given_an_authorised_invoice ( ) ;
117- var amount = Math . Min ( creditNote . Total , invoice . Total . GetValueOrDefault ( ) ) ;
117+ var amount = Math . Min ( creditNote . Total . GetValueOrDefault ( ) , invoice . Total . GetValueOrDefault ( ) ) ;
118118
119119 Api . Allocations . Add ( new Allocation
120120 {
0 commit comments