to get a personalized navigation.
to get a personalized navigation.
Hi
I am currently working on a new integration and am wondering how I can retrieve Customers invoices with expired due dates or may be all the invoices and the attached document with it.
https://docs.business.visma.net/docs/schema/bitflags
in the link above i found a way to fetch credit Notes but no invoices. Any tips will be helpful.
Secondly I want to create and fetch payment using graphql query.
i tried the query bellow but getting empty array as response
query payment_object_ref_null {
useCompany(no: 386****) {
payment {
items {
paymentNo
lines: joindown_PaymentLine_via_Payment {
items {
currency: joinup_Currency {
currencyNo
bank: joinup_Bank {
name
currency: joinup_Currency {
currencyNo
}
}
}
}
}
}
}
}
}
Solved! Go to Solution.
Hi,
If you are generate the invoice from the order, you can get a PDF representing the invoice with the reeport feature.
See the documentation on reporting: https://docs.business.dev.visma.net/docs/schema/mutations/reports
Example:
mutation CreateInvoiceFromOrder($no: Int, $orderNo: String)
{
useCompany(no: $no)
{
order_reports
{
invoicesAndCreditNotes(
filter:{orderNo:{_eq:$orderNo}}
returnDocuments: true
splitAttachments: true
approval: true
formNo: 203
printDestination: PRINT_TO_PDF
)
{
succeeded
documents
{
name
content
attachments
{
content
}
}
}
}
}
}
If you want to fetch a copy of the pdf on a later point, you have to run the the orderdocument_reports
mutation GetInvoiceCopy($no: Int, $invoiceNo: String)
{
useCompany(no: $no)
{
orderDocument_reports
{
orderDocumentCopy(
filter: {invoiceNo:{_eq:$invoiceNo}}
returnDocuments: true
splitAttachments: true
printDestination: PRINT_TO_PDF
)
{
succeeded
documents
{
name
content
attachments
{
content
}
}
}
}
}
}
Hope this give you a insight on how
Hi again,
I didnt fully answer you questions
To answer your first question, the easiest way to retrieve invoice data that has not been paid is via the Customer ledger. You can use voucher type = 11 and paidstatus in [1,2]
The value of paidstatus is
Here is the query we use to get invoice, then you have to use the report mutaion in my first reply to get a PDF copy of the invoice
query GetIncoiceInfoFromCustomerTransaction($no: Int, $dueDate: Int,$pagesize: Int, $after: String) {
useCompany(no: $no) {
customerTransaction(
first: $pagesize
after: $after
filter:
{
voucherType:{_eq:11}
dueDate: {_lt:$dueDate}
paidStatus:{_in:[1,2]}
}
)
{
totalCount
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
items {
customerNo
invoiceNo
voucherNo
voucherType
amountDomestic
outstandingAmountDomestic
cid
dueDate
crossReference
paidStatus
paidLast
createdDateTime
changedDateTime
voucherDate
}
}
}
}
Thank you very much. It worked
Copyright © 2022 Visma.com. All rights reserved.