-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
24,212 additions
and
11 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
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 @@ | ||
[[source]] | ||
name = "pypi" | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
|
||
[dev-packages] | ||
|
||
[packages] | ||
intuit-oauth = "==1.2.3" | ||
rauth = ">=0.7.1" | ||
requests = ">=2.19.1" | ||
simplejson = ">=3.17.0" | ||
six = ">=1.14.0" | ||
nose = "*" | ||
authclient = "*" | ||
coverage = "*" | ||
|
||
[requires] | ||
python_version = "3.8" |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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,13 @@ | ||
from quickbooks.objects import Customer | ||
from quickbooks.objects.companycurrency import CompanyCurrency | ||
from tests.integration.test_base import QuickbooksTestCase | ||
|
||
|
||
class CompanyCurrencyTest(QuickbooksTestCase): | ||
def test_get_all(self): | ||
currencies = CompanyCurrency.all(qb=self.qb_client) | ||
self.assertGreater(len(currencies), 0) | ||
|
||
def test_get(self): | ||
currency = CompanyCurrency.get(id=1, qb=self.qb_client) | ||
self.assertEqual(currency.Name, 'Canadian Dollar') |
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 @@ | ||
from datetime import datetime | ||
|
||
from quickbooks.objects import Customer, PaymentMethod | ||
from quickbooks.objects.account import Account | ||
from quickbooks.objects.payment import Payment | ||
|
||
from tests.integration.test_base import QuickbooksTestCase | ||
|
||
|
||
class PaymentTest(QuickbooksTestCase): | ||
def setUp(self): | ||
super(PaymentTest, self).setUp() | ||
|
||
self.account_number = datetime.now().strftime('%d%H%M') | ||
self.name = "Test Account {0}".format(self.account_number) | ||
|
||
def test_getall(self): | ||
payments = Payment.all(max_results=5, qb=self.qb_client) | ||
|
||
self.assertEqual(len(payments), 5) | ||
self.assertNotEqual(payments[0].Id, 0) | ||
|
||
def test_create(self): | ||
payment = Payment() | ||
payment.TotalAmt = 140.0 | ||
|
||
customer = Customer.all(max_results=1, qb=self.qb_client)[0] | ||
payment.CustomerRef = customer.to_ref() | ||
|
||
payment_method = PaymentMethod.all(max_results=1, qb=self.qb_client)[0] | ||
|
||
payment.PaymentMethodRef = payment_method.to_ref() | ||
payment.save(qb=self.qb_client) | ||
|
||
query_payment = Payment.get(payment.Id, qb=self.qb_client) | ||
|
||
self.assertEqual(query_payment.CustomerRef.name, customer.DisplayName) | ||
self.assertEqual(query_payment.TotalAmt, 140.0) | ||
self.assertEqual(query_payment.PaymentMethodRef.value, payment_method.Id) |
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,51 @@ | ||
from datetime import datetime | ||
|
||
from quickbooks.objects import RefundReceipt, DetailLine, CustomerMemo, SalesItemLineDetail, \ | ||
Account, Item | ||
from quickbooks.objects.refundreceipt import RefundReceiptCheckPayment | ||
from tests.integration.test_base import QuickbooksTestCase | ||
|
||
|
||
class PaymentTest(QuickbooksTestCase): | ||
def setUp(self): | ||
super(PaymentTest, self).setUp() | ||
|
||
self.account_number = datetime.now().strftime('%d%H%M') | ||
self.name = "Test Account {0}".format(self.account_number) | ||
|
||
def test_create(self): | ||
refund_receipt = RefundReceipt() | ||
refund_receipt.DocNumber = "DocNum123" | ||
refund_receipt.TotalAmt = 100 | ||
refund_receipt.Balance = 100 | ||
refund_receipt.PrivateNote = "Private Note" | ||
refund_receipt.PaymentType = "Check" | ||
|
||
memo = CustomerMemo() | ||
memo.value = "Customer Memo" | ||
refund_receipt.CustomerMemo = memo | ||
|
||
refund_receipt.CheckPayment = RefundReceiptCheckPayment() | ||
refund_receipt.CheckPayment.CheckNum = "1001" | ||
refund_receipt.CheckPayment.NameOnAcct = "John Smith" | ||
refund_receipt.CheckPayment.AcctNum = "0000000000" | ||
refund_receipt.CheckPayment.BankName = "Bank" | ||
|
||
item = Item.all(max_results=1, qb=self.qb_client)[0] | ||
line = DetailLine() | ||
line.DetailType = "SalesItemLineDetail" | ||
line.Amount = 200 | ||
line.SalesItemLineDetail = SalesItemLineDetail() | ||
line.SalesItemLineDetail.ItemRef = item.to_ref() | ||
refund_receipt.Line.append(line) | ||
|
||
account = Account.where("Name = 'checking'", max_results=1, qb=self.qb_client)[0] | ||
refund_receipt.DepositToAccountRef = account.to_ref() | ||
|
||
refund_receipt.save(qb=self.qb_client) | ||
|
||
query_refund_receipt = RefundReceipt.get(refund_receipt.Id, qb=self.qb_client) | ||
|
||
self.assertEqual(query_refund_receipt.DocNumber, refund_receipt.DocNumber) | ||
self.assertEqual(query_refund_receipt.Line[0].Amount, 200) | ||
self.assertEqual(refund_receipt.DepositToAccountRef.value, account.Id) |
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