This repository has been archived by the owner on Nov 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
contact api update for balances, payment terms and batch payments
- Loading branch information
Ben Hopkins
committed
Oct 8, 2013
1 parent
744b0da
commit 314afcb
Showing
7 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace XeroApi.Model | ||
{ | ||
public class AccountBase | ||
{ | ||
public decimal? Outstanding { get; set; } | ||
|
||
public decimal? Overdue { get; set; } | ||
|
||
public override string ToString() | ||
{ | ||
return String.Format("Outstanding: {0:C}, Overdue: {1:C}.", Outstanding ?? 0, Overdue ?? 0); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace XeroApi.Model | ||
{ | ||
public class Balances | ||
{ | ||
public AccountBase AccountsReceivable { get; set; } | ||
|
||
public AccountBase AccountsPayable { get; set; } | ||
|
||
public override string ToString() | ||
{ | ||
StringBuilder sb = new StringBuilder(); | ||
|
||
sb.AppendFormat("Sales Invoices: {0} ", AccountsReceivable.ToString()); | ||
|
||
sb.AppendFormat("Bills: {0}", AccountsPayable.ToString()); | ||
|
||
return sb.ToString(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace XeroApi.Model | ||
{ | ||
public class BatchPayments | ||
{ | ||
public string BankAccountNumber { get; set; } | ||
public string BankAccountName { get; set; } | ||
public string Details { get; set; } | ||
|
||
public override string ToString() | ||
{ | ||
StringBuilder sb = new StringBuilder(); | ||
|
||
sb.AppendFormat("Bank Account Number: {0} ", BankAccountNumber); | ||
|
||
sb.AppendFormat("Bank Account Name: {0} ", BankAccountName); | ||
|
||
sb.AppendFormat("Details: {0}", Details); | ||
|
||
return sb.ToString(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace XeroApi.Model | ||
{ | ||
public class PaymentTermBase | ||
{ | ||
public int Day { get; set; } | ||
public string Type { get; set; } | ||
public override string ToString() | ||
{ | ||
string suffix; | ||
|
||
switch (Day) | ||
{ | ||
case 1: | ||
case 21: | ||
case 31: | ||
suffix = "st"; | ||
break; | ||
case 2: | ||
case 22: | ||
suffix = "nd"; | ||
break; | ||
case 3: | ||
case 23: | ||
suffix = "rd"; | ||
break; | ||
default: | ||
suffix = "th"; | ||
break; | ||
} | ||
|
||
return String.Format("{0}{1} {2}", Day, suffix, Type); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace XeroApi.Model | ||
{ | ||
public class PaymentTerms | ||
{ | ||
public PaymentTermBase Bills { get; set; } | ||
public PaymentTermBase Sales { get; set; } | ||
|
||
public override string ToString() | ||
{ | ||
StringBuilder sb = new StringBuilder(); | ||
|
||
sb.Append("Bills: " + Bills.ToString() + " "); | ||
|
||
sb.Append("Sales: " + Sales.ToString()); | ||
|
||
return sb.ToString(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters