Late Invoice with Payment

Author: Accord Project

lateinvoicewithpayment@0.5.2 Contract ^0.20.10 75a29cfce41d96ac42a41da9c5018a03a4a98a86b04c470dbf6a8132285f4611

A sample Late invoice clause which emits a payment obligation.

Download Archive Download Compiled Archive Open in Template Studio Open in VSCode Web

Late Invoice Clause With Payment

A sample Late invoice clause which emits a payment obligation.

Template Text

2.4 "Betty Buyer" is not required to pay any invoice that is issued more than 180 days after it is due to be issued by "Steve Seller".

2.4 "Betty Buyer" is not required to pay any invoice that is issued more than 180 days after it is due to be issued by "Steve Seller".
2.4 {{purchaser}} is not required to pay any invoice that is issued more than {{maximumDelay}} after it is due to be issued by {{supplier}}.
{
    "$class": "org.accordproject.lateinvoicewithpayment.LateInvoiceContract",
    "contractId": "768e5566-e59d-4443-9d49-7d183b4608aa",
    "maximumDelay": {
        "$class": "org.accordproject.time.Duration",
        "amount": 180,
        "unit": "days"
    },
    "purchaser": {
        "$class": "org.accordproject.cicero.contract.AccordParty",
        "partyId": "Betty Buyer"
    },
    "supplier": {
        "$class": "org.accordproject.cicero.contract.AccordParty",
        "partyId": "Steve Seller"
    }
}

Template Model

namespace org.accordproject.lateinvoicewithpayment

import org.accordproject.cicero.contract.* from https://models.accordproject.org/cicero/contract.cto
import org.accordproject.cicero.runtime.* from https://models.accordproject.org/cicero/runtime.cto
import org.accordproject.time.* from https://models.accordproject.org/v2.0/time.cto
import org.accordproject.money.* from https://models.accordproject.org/money.cto

/**
 * Defines the data model for the LateInvoice template.
 * This defines the structure of the abstract syntax tree that the parser for the template
 * must generate from input source text.
 */
asset LateInvoiceContract extends AccordContract {
  /**
   * If the invoice deliver date  >= termination date then the buyer does not have to pay
   */
  o Duration maximumDelay
  o AccordParty purchaser
  o AccordParty supplier
}

/**
 * Defines the input data required by the template
 */
transaction LateInvoiceRequest extends Request {
  /**
   * What was the agreed delivery date for the invoice?
   */
  o DateTime invoiceDue
  o MonetaryAmount amountDue
}

/**
 * Defines the output data for the template
 */
transaction LateInvoiceResponse extends Response {
  o Boolean paymentRequired
  o String cause optional
}

Model Dependencies

Template Logic

Find the full logic for this template on on GitHub.

State Types

Type Sample JSON
org.accordproject.cicero.contract.AccordContractState
{
    "$class": "org.accordproject.cicero.contract.AccordContractState",
    "stateId": "e0d3a010-c07a-11ea-ad77-8b5ce7c057ac"
}

Request Types

Type Sample JSON
org.accordproject.lateinvoicewithpayment.LateInvoiceRequest
{
    "$class": "org.accordproject.lateinvoicewithpayment.LateInvoiceRequest",
    "invoiceDue": "2020-07-07T18:54:17.872+01:00",
    "amountDue": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 31.147,
        "currencyCode": "SVC"
    },
    "transactionId": "e0d37900-c07a-11ea-ad77-8b5ce7c057ac",
    "timestamp": "2020-07-07T18:54:17.872+01:00"
}

Response Types

Type Sample JSON
org.accordproject.lateinvoicewithpayment.LateInvoiceResponse
{
    "$class": "org.accordproject.lateinvoicewithpayment.LateInvoiceResponse",
    "paymentRequired": false,
    "cause": "Non.",
    "transactionId": "e0d37901-c07a-11ea-ad77-8b5ce7c057ac",
    "timestamp": "2020-07-07T18:54:17.872+01:00"
}

Events Types

Type Sample JSON
org.accordproject.cicero.runtime.PaymentObligation
{
    "$class": "org.accordproject.cicero.runtime.PaymentObligation",
    "amount": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 180.747,
        "currencyCode": "MVR"
    },
    "description": "Ex ullamco in incididunt minim.",
    "contract": "resource:org.accordproject.lateinvoicewithpayment.LateInvoiceContract#0905",
    "promisor": "resource:org.accordproject.cicero.contract.AccordParty#4119",
    "promisee": "resource:org.accordproject.cicero.contract.AccordParty#2766",
    "deadline": "2020-07-07T18:54:17.873+01:00",
    "eventId": "e0d3a011-c07a-11ea-ad77-8b5ce7c057ac",
    "timestamp": "2020-07-07T18:54:17.873+01:00"
}

Technical Integration

Please refer to the Cicero documentation for details and examples of how to integrate a call to a Cicero template into your application.

View the Latest code for this template on GitHub.