sanmar_sdk.standard.invoices¶
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¶
SanMar returns whole invoices for up to three months of invoice dates at a time. |
|
SanMar returns invoice headers for up to a year of invoice dates at a time. |
Classes¶
A postal address on an invoice. |
|
Who an invoice is sold to, shipped to, or paid to. |
|
The header of one SanMar invoice. |
|
One line of a SanMar invoice. |
|
One SanMar invoice, with its lines. |
|
SanMar's own invoicing service. |
Module Contents¶
- sanmar_sdk.standard.invoices.INVOICE_RANGE_LIMIT[source]¶
SanMar returns whole invoices for up to three months of invoice dates at a time.
- sanmar_sdk.standard.invoices.HEADER_RANGE_LIMIT[source]¶
SanMar returns invoice headers for up to a year of invoice dates at a time.
- class sanmar_sdk.standard.invoices.Address(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordA postal address on an invoice.
- class sanmar_sdk.standard.invoices.Party(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordWho an invoice is sold to, shipped to, or paid to.
- class sanmar_sdk.standard.invoices.InvoiceHeader(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordThe header of one SanMar invoice.
- invoice_date: sanmar_sdk.base.SanMarDate = None[source]¶
- order_date: sanmar_sdk.base.SanMarDate | None = None[source]¶
- due_date: sanmar_sdk.base.SanMarDate | None = None[source]¶
- subtotal: decimal.Decimal | None = None[source]¶
- sales_tax: decimal.Decimal | None = None[source]¶
- shipping_and_handling: decimal.Decimal | None = None[source]¶
- total: decimal.Decimal | None = None[source]¶
- freight_savings: decimal.Decimal | None = None[source]¶
- class sanmar_sdk.standard.invoices.InvoiceLine(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordOne line of a SanMar invoice.
- catalog_color: str | None = None[source]¶
The color as SanMar’s order system records it, which is the catalog (mainframe) color.
- unit_price: decimal.Decimal | None = None[source]¶
- amount: decimal.Decimal | None = None[source]¶
- class sanmar_sdk.standard.invoices.Invoice(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordOne SanMar invoice, with its lines.
- header: InvoiceHeader = None[source]¶
- lines: sanmar_sdk.base.OneOrMany[InvoiceLine] = None[source]¶
- class sanmar_sdk.standard.invoices.InvoiceService(soap: SoapClient, credentials: Credentials)[source]¶
Bases:
sanmar_sdk._soap.ServiceSanMar’s own invoicing service.
- get(invoice_number: int) Invoice[source]¶
Fetch one invoice by its number.
- Raises:
NotFoundError – If SanMar has no invoice with that number.
- by_purchase_order(po_number: str) list[Invoice][source]¶
Fetch the invoices for one purchase order.
SanMar matches at most the first 13 characters of a PO number here.
- by_invoice_date(start: datetime.date, end: datetime.date) list[Invoice][source]¶
Fetch the invoices dated between two days, inclusive, up to three months apart.
- by_order_date(order_date: datetime.date) list[Invoice][source]¶
Fetch the invoices for orders placed on one day.
- since_last_call() list[Invoice][source]¶
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.
- headers_by_purchase_order(po_number: str) list[InvoiceHeader][source]¶
Fetch the invoice headers for one purchase order.
- headers_by_invoice_date(start: datetime.date, end: datetime.date) list[InvoiceHeader][source]¶
Fetch the invoice headers dated between two days, inclusive, up to a year apart.
- headers_by_order_date(order_date: datetime.date) list[InvoiceHeader][source]¶
Fetch the invoice headers for orders placed on one day.
- unpaid_headers() list[InvoiceHeader][source]¶
Fetch the headers of every unpaid invoice.