sanmar_sdk.standard.invoices ============================ .. py:module:: sanmar_sdk.standard.invoices .. autoapi-nested-parse:: SanMar's own invoicing service. SanMar invoices once a day, after 9 PM Pacific, for everything shipped that day, and suggests waiting a further day before reading invoices. Every lookup comes in two forms: whole invoices, with their lines, and headers only. Attributes ---------- .. autoapisummary:: sanmar_sdk.standard.invoices.INVOICE_RANGE_LIMIT sanmar_sdk.standard.invoices.HEADER_RANGE_LIMIT Classes ------- .. autoapisummary:: sanmar_sdk.standard.invoices.Address sanmar_sdk.standard.invoices.Party sanmar_sdk.standard.invoices.InvoiceHeader sanmar_sdk.standard.invoices.InvoiceLine sanmar_sdk.standard.invoices.Invoice sanmar_sdk.standard.invoices.InvoiceService Module Contents --------------- .. py:data:: INVOICE_RANGE_LIMIT SanMar returns whole invoices for up to three months of invoice dates at a time. .. py:data:: HEADER_RANGE_LIMIT SanMar returns invoice headers for up to a year of invoice dates at a time. .. py:class:: Address(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` A postal address on an invoice. .. py:attribute:: address1 :type: str | None :value: None .. py:attribute:: address2 :type: str | None :value: None .. py:attribute:: address3 :type: str | None :value: None .. py:attribute:: city :type: str | None :value: None .. py:attribute:: state :type: str | None :value: None .. py:attribute:: postal_code :type: str | None :value: None .. py:attribute:: country :type: str | None :value: None .. py:class:: Party(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` Who an invoice is sold to, shipped to, or paid to. .. py:attribute:: name :type: str | None :value: None .. py:attribute:: address :type: Address :value: None .. py:class:: InvoiceHeader(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` The header of one SanMar invoice. .. py:attribute:: invoice_number :type: int :value: None .. py:attribute:: invoice_date :type: sanmar_sdk.base.SanMarDate :value: None .. py:attribute:: sales_order_number :type: int | None :value: None .. py:attribute:: status :type: str | None :value: None ``Paid`` or ``Unpaid``. .. py:attribute:: is_credit_memo :type: bool :value: None .. py:attribute:: customer_number :type: int | None :value: None .. py:attribute:: po_number :type: str | None :value: None .. py:attribute:: order_date :type: sanmar_sdk.base.SanMarDate | None :value: None .. py:attribute:: due_date :type: sanmar_sdk.base.SanMarDate | None :value: None .. py:attribute:: sold_to :type: Party | None :value: None .. py:attribute:: ship_to :type: Party | None :value: None .. py:attribute:: remit_to :type: Party | None :value: None .. py:attribute:: ship_via :type: str | None :value: None .. py:attribute:: fob :type: str | None :value: None The shipping point, such as ``SPARKS NV``. .. py:attribute:: terms :type: str | None :value: None .. py:attribute:: department :type: str | None :value: None .. py:attribute:: total_cases :type: int | None :value: None .. py:attribute:: total_weight :type: int | None :value: None .. py:attribute:: subtotal :type: decimal.Decimal | None :value: None .. py:attribute:: sales_tax :type: decimal.Decimal | None :value: None .. py:attribute:: shipping_and_handling :type: decimal.Decimal | None :value: None .. py:attribute:: total :type: decimal.Decimal | None :value: None .. py:attribute:: freight_savings :type: decimal.Decimal | None :value: None .. py:class:: InvoiceLine(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` One line of a SanMar invoice. .. py:attribute:: style :type: str | None :value: None .. py:attribute:: catalog_color :type: str | None :value: None The color as SanMar's order system records it, which is the catalog (mainframe) color. .. py:attribute:: size :type: str | None :value: None .. py:attribute:: description :type: str | None :value: None .. py:attribute:: quantity :type: int :value: None .. py:attribute:: unit_price :type: decimal.Decimal | None :value: None .. py:attribute:: amount :type: decimal.Decimal | None :value: None .. py:attribute:: unique_key :type: str | None :value: None .. py:class:: Invoice(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` One SanMar invoice, with its lines. .. py:attribute:: header :type: InvoiceHeader :value: None .. py:attribute:: lines :type: sanmar_sdk.base.OneOrMany[InvoiceLine] :value: None .. py:class:: InvoiceService(soap: SoapClient, credentials: Credentials) Bases: :py:obj:`sanmar_sdk._soap.Service` SanMar's own invoicing service. .. py:method:: get(invoice_number: int) -> Invoice Fetch one invoice by its number. :raises ~sanmar_sdk.exceptions.NotFoundError: If SanMar has no invoice with that number. .. py:method:: by_purchase_order(po_number: str) -> list[Invoice] Fetch the invoices for one purchase order. SanMar matches at most the first 13 characters of a PO number here. .. py:method:: by_invoice_date(start: datetime.date, end: datetime.date) -> list[Invoice] Fetch the invoices dated between two days, inclusive, up to three months apart. .. py:method:: by_order_date(order_date: datetime.date) -> list[Invoice] Fetch the invoices for orders placed on one day. .. py:method:: unpaid() -> list[Invoice] Fetch every unpaid invoice. .. py:method:: since_last_call() -> list[Invoice] Fetch the invoices added since this was last called. The first call returns the last three months. Each call moves SanMar's marker, so the invoices it returns are not returned again. .. py:method:: headers_by_purchase_order(po_number: str) -> list[InvoiceHeader] Fetch the invoice headers for one purchase order. .. py:method:: headers_by_invoice_date(start: datetime.date, end: datetime.date) -> list[InvoiceHeader] Fetch the invoice headers dated between two days, inclusive, up to a year apart. .. py:method:: headers_by_order_date(order_date: datetime.date) -> list[InvoiceHeader] Fetch the invoice headers for orders placed on one day. .. py:method:: unpaid_headers() -> list[InvoiceHeader] Fetch the headers of every unpaid invoice.