pub(crate) const LIST_INVOICES: &str = r#"
query (
$businessId: ID!,
$page: Int,
$pageSize: Int,
$sort: [InvoiceSort!]!,
$status: InvoiceStatus,
$customerId: ID,
$currency: CurrencyCode,
$invoiceDateStart: Date,
$invoiceDateEnd: Date,
$invoiceNumber: String
) {
business(id: $businessId) {
invoices(
page: $page, pageSize: $pageSize, sort: $sort,
status: $status, customerId: $customerId, currency: $currency,
invoiceDateStart: $invoiceDateStart, invoiceDateEnd: $invoiceDateEnd,
invoiceNumber: $invoiceNumber
) {
pageInfo {
currentPage
totalPages
totalCount
}
edges {
node {
id createdAt modifiedAt pdfUrl viewUrl status
title subhead invoiceNumber poNumber invoiceDate dueDate
amountDue { value currency { code symbol } }
amountPaid { value currency { code symbol } }
taxTotal { value currency { code symbol } }
total { value currency { code symbol } }
subtotal { value currency { code symbol } }
currency { code symbol name }
exchangeRate
memo footer
disableCreditCardPayments disableBankPayments
itemTitle unitTitle priceTitle amountTitle
hideName hideDescription hideUnit hidePrice hideAmount
lastSentAt lastSentVia lastViewedAt
customer { id name email }
items {
product { id name }
description quantity unitPrice
subtotal { value currency { code symbol } }
total { value currency { code symbol } }
taxes {
salesTax { id name }
amount { value currency { code symbol } }
}
}
}
}
}
}
}
"#;
pub(crate) const GET_INVOICE: &str = r#"
query ($businessId: ID!, $invoiceId: ID!) {
business(id: $businessId) {
invoice(id: $invoiceId) {
id createdAt modifiedAt pdfUrl viewUrl status
title subhead invoiceNumber poNumber invoiceDate dueDate
amountDue { value currency { code symbol } }
amountPaid { value currency { code symbol } }
taxTotal { value currency { code symbol } }
total { value currency { code symbol } }
subtotal { value currency { code symbol } }
discountTotal { value currency { code symbol } }
currency { code symbol name }
exchangeRate
memo footer
disableCreditCardPayments disableBankPayments disableAmexPayments
itemTitle unitTitle priceTitle amountTitle
hideName hideDescription hideUnit hidePrice hideAmount
lastSentAt lastSentVia lastViewedAt
customer {
id name firstName lastName email
address {
addressLine1 addressLine2 city
province { code name }
country { code name }
postalCode
}
currency { code symbol name }
createdAt modifiedAt
}
items {
product { id name description unitPrice isSold isBought isArchived createdAt modifiedAt }
account { id name }
description quantity unitPrice
subtotal { value currency { code symbol } }
total { value currency { code symbol } }
taxes {
salesTax { id name abbreviation rate }
amount { value currency { code symbol } }
}
}
}
}
}
"#;