from pod_base import APIException, PodException
from examples.config import *
from pod_billing import PodBilling

try:
    pod_billing = PodBilling(api_token=API_TOKEN, server_type=SERVER_MODE)

    meta_query = {"field": "name", "has": "reza"}

    meta_query = {"field": "price", "gt": "1200000"}

    invoices = pod_billing.get_invoice_list_by_metadata(meta_query,
                                                        sc_api_key=SC_API_KEY,
                                                        sc_voucher_hash=[])
    print("Invoices :\n", invoices)
    print("Total :", pod_billing.total_items())
    # OUTPUT
    # Invoices :
    # [
    #   {
    #     "id": 59678,
    #     "totalAmountWithoutDiscount": 44500,
    #     "delegationAmount": 0,
    #     "totalAmount": 44500,
    #     "payableAmount": 48505,
    #     "vat": 4005,
    #     "issuanceDate": 1578481916475,
    #     "deliveryDate": 1582144200000,
    #     "billNumber": "Py_56555977",
    #     "paymentBillNumber": "1048043",
    #     "uniqueNumber": "f924fcbf0949e9b",
Esempio n. 2
0
    pod_billing = PodBilling(api_token=API_TOKEN, server_type=SERVER_MODE)

    params = {
        'isPayed': False,
        # 'isClosed': False,
        # 'isWaiting': True,
        'isCanceled': False,
        'fromDate': '1398/06/01 13:00:00',
        'toDate': '1398/06/02 17:00:00',
    }

    invoices = pod_billing.get_invoice_list(page=1, **params)
    print("Invoices :\n", invoices)
    # for invoice in invoices:
    #     print(invoice['id'])
    print("Total Invoice :", pod_billing.total_items())

    invoices = pod_billing.get_invoice_list(page=1)
    print("Invoices :\n", invoices)
    print("Total Invoice :", pod_billing.total_items())
    # OUTPUT
    # Invoices :
    #  [
    #   {
    #     "id": 32157,
    #     "totalAmountWithoutDiscount": 15,
    #     "delegationAmount": 0,
    #     "totalAmount": 15,
    #     "payableAmount": 16.35,
    #     "vat": 1.35,
    #     "issuanceDate": 1566630237976,
Esempio n. 3
0
# coding=utf-8
from pod_base import APIException, PodException
from examples.config import *
from pod_billing import PodBilling

try:
    pod_billing = PodBilling(api_token=API_TOKEN, server_type=SERVER_MODE)
    export_list = pod_billing.export.get_export_list()
    print("Export List :\n", export_list)
    print("Total Export : ", pod_billing.total_items())
    # OUTPUT
    # Export List :
    #  [
    #   {
    #       'id': 1510,
    #       'statusCode': 'EXPORT_SERVICE_STATUS_SUCCESSFUL',
    #       'creationDate': 1578382127057,
    #       'resultFile': {
    #           'id': 68083,
    #           'name': 'result-Tue Jan 07 07:29:00 UTC 2020.xlsx',
    #           'hashCode': '16f7e0000000000000004888519156',
    #           'size': 0
    #       },
    #       'service': '/nzh/biz/getInvoiceList/'
    #   },
    #   ...
    #   ]
    # Total Export :  21

    if len(export_list) > 0:
        export = export_list[0]