diff --git a/pyzaim/pyzaim.py b/pyzaim/pyzaim.py index d8dde2f..aa349e2 100644 --- a/pyzaim/pyzaim.py +++ b/pyzaim/pyzaim.py @@ -111,6 +111,7 @@ def insert_payment_simple( comment=None, name=None, place=None, + receipt_id=None, ): genre_id = self.genre_stoi[genre] category_id = self.genre_to_category[genre_id] @@ -118,7 +119,9 @@ def insert_payment_simple( from_account_id = self.account_stoi[from_account] else: from_account_id = None - return self.insert_payment(date, amount, category_id, genre_id, from_account_id, comment, name, place) + return self.insert_payment( + date, amount, category_id, genre_id, from_account_id, comment, name, place, receipt_id + ) def insert_payment( self, @@ -130,6 +133,7 @@ def insert_payment( comment=None, name=None, place=None, + receipt_id=None, ): data = { "mapping": 1, @@ -146,6 +150,8 @@ def insert_payment( data["name"] = name if place is not None: data["place"] = place + if receipt_id is not None: + data["receipt_id"] = receipt_id return self.auth.post(self.payment_url, data=data) def update_payment_simple( @@ -158,6 +164,7 @@ def update_payment_simple( comment=None, name=None, place=None, + receipt_id=None, ): genre_id = self.genre_stoi[genre] category_id = self.genre_to_category[genre_id] @@ -175,6 +182,7 @@ def update_payment_simple( comment, name, place, + receipt_id, ) def update_payment( @@ -188,6 +196,7 @@ def update_payment( comment=None, name=None, place=None, + receipt_id=None, ): data = { "mapping": 1, @@ -205,6 +214,8 @@ def update_payment( data["name"] = name if place is not None: data["place"] = place + if receipt_id is not None: + data["receipt_id"] = receipt_id return self.auth.put("{}/{}".format(self.payment_url, data_id), data=data) def delete_payment(self, data_id):