Purchase Order Failure

Author: Accord Project

purchase-order-failure@0.9.1 Contract ^0.20.10 c60857f151e5bd0ec5bf7cfac5a020302e7a691309d20bdb3d1887337f76f28a

Issues credits for late purchase orders. Purchase orders sent via DocuSign must have the text recipient tabs with the following tab labels and validations: deliveryDate with Date validation, actualPrice with Numbers validation and currencyCode with no validation.

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

Purchase Order Failure

This clause emits a payment obligation for purchase orders that are received late. Purchase orders sent via DocuSign must have the "text" recipient tabs with the following tab labels and validations: deliveryDate with "Date" validation, actualPrice with "Numbers" validation and currencyCode with no validation.

Template Text

In the event that a Purchase Order Failure causes any Product to be delivered more than 1 days after the delivery date for such Product specified in the applicable Purchase Order therefore, "Buyer Corp" shall be entitled to receive a 5.0% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to "Article 5". In the event that a Purchase Order Failure causes any Product to be delivered more than 2 days after the delivery date for such Product specified in the applicable Purchase Order therefore, "Buyer Corp" shall be entitled to receive a 10% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to "Article 5". In the event that a Purchase Order Failure causes any Product to be delivered more than 10 days, after the delivery date for such Product specified in the applicable Purchase Order therefore, "Buyer Corp" shall be entitled to receive a 50% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to "Article 5". Any discount amount owing to "Buyer Corp" pursuant to this "Section 3.5(c)" shall be paid by paying "Buyer Corp" such amount via electronic money transfer. In case of 5 or more Purchase Order Failures in the past 60 days, then "Buyer Corp" shall be entitled to an additional 599.99 USD compensation.

In the event that a Purchase Order Failure causes any Product to be delivered more than 1 days after the delivery date for such Product specified in the applicable Purchase Order therefore, "Buyer Corp" shall be entitled to receive a 5.0% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to "Article 5". In the event that a Purchase Order Failure causes any Product to be delivered more than 2 days after the delivery date for such Product specified in the applicable Purchase Order therefore, "Buyer Corp" shall be entitled to receive a 10% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to "Article 5". In the event that a Purchase Order Failure causes any Product to be delivered more than 10 days, after the delivery date for such Product specified in the applicable Purchase Order therefore, "Buyer Corp" shall be entitled to receive a 50% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to "Article 5". Any discount amount owing to "Buyer Corp" pursuant to this "Section 3.5(c)" shall be paid by paying "Buyer Corp" such amount via electronic money transfer. In case of 5 or more Purchase Order Failures in the past 60 days, then "Buyer Corp" shall be entitled to an additional 599.99 USD compensation.
In the event that a Purchase Order Failure causes any Product to be delivered more than {{lateOne}} after the delivery date for such Product specified in the applicable Purchase Order therefore, {{buyer}} shall be entitled to receive a {{lateOnePercent}}% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to {{article}}. In the event that a Purchase Order Failure causes any Product to be delivered more than {{lateTwo}} after the delivery date for such Product specified in the applicable Purchase Order therefore, {{buyer}} shall be entitled to receive a {{lateTwoPercent}}% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to {{article}}. In the event that a Purchase Order Failure causes any Product to be delivered more than {{lateThree}}, after the delivery date for such Product specified in the applicable Purchase Order therefore, {{buyer}} shall be entitled to receive a {{lateThreePercent}}% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to {{article}}. Any discount amount owing to {{buyer}} pursuant to this {{thisSection}} shall be paid by paying {{buyer}} such amount via electronic money transfer. In case of {{maxFailures}} or more Purchase Order Failures in the past {{failureRange}}, then {{buyer}} shall be entitled to an additional {{repeatedFailureCompensation}} compensation.
{
    "$class": "com.docusign.clauses.PurchaseOrderFailure",
    "contractId": "3bf4d1ab-ac6c-4ebe-8158-9c7677d0dfda",
    "buyer": {
        "$class": "org.accordproject.cicero.contract.AccordParty",
        "partyId": "Buyer Corp"
    },
    "lateOne": {
        "$class": "org.accordproject.time.Duration",
        "amount": 1,
        "unit": "days"
    },
    "lateTwo": {
        "$class": "org.accordproject.time.Duration",
        "amount": 2,
        "unit": "days"
    },
    "lateThree": {
        "$class": "org.accordproject.time.Duration",
        "amount": 10,
        "unit": "days"
    },
    "lateOnePercent": 5,
    "lateTwoPercent": 10,
    "lateThreePercent": 50,
    "article": "Article 5",
    "thisSection": "Section 3.5(c)",
    "maxFailures": 5,
    "failureRange": {
        "$class": "org.accordproject.time.Duration",
        "amount": 60,
        "unit": "days"
    },
    "repeatedFailureCompensation": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 599.99,
        "currencyCode": "USD"
    }
}

Template Model

namespace com.docusign.clauses

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 com.docusign.connect.DocuSignEnvelopeInformation from https://models.accordproject.org/docusign/connect.cto
import org.accordproject.money.MonetaryAmount from https://models.accordproject.org/money.cto

/**
 * Defines the data model for the Purchase Order Failure
 * template.
 */
asset PurchaseOrderFailure extends AccordContract {
  o AccordParty buyer

  o Duration lateOne
  o Duration lateTwo
  o Duration lateThree

  o Double lateOnePercent
  o Double lateTwoPercent
  o Double lateThreePercent

  o String article
  o String thisSection

  o Integer maxFailures
  o Duration failureRange
  o MonetaryAmount repeatedFailureCompensation
}

/**
 * Defines the state of the contract
 */
asset PurchaseOrderFailureState extends AccordContractState {
  o DateTime[] pastFailures
  o Integer nbPastFailures
}

/**
 * Defines the output data for the template
 */
transaction PurchaseOrderFailureResponse extends Response {
  /**
   * The penalty to be paid by the seller
   */
  o MonetaryAmount penalty
}

Model Dependencies

Template Logic

Find the full logic for this template on on GitHub.

State Types

Type Sample JSON
com.docusign.clauses.PurchaseOrderFailureState
{
    "$class": "com.docusign.clauses.PurchaseOrderFailureState",
    "pastFailures": [
        "2020-07-07T18:53:41.983+01:00"
    ],
    "nbPastFailures": 1092,
    "stateId": "cb6f3ef0-c07a-11ea-ad77-8b5ce7c057ac"
}

Request Types

Type Sample JSON
com.docusign.connect.DocuSignEnvelopeInformation
{
    "$class": "com.docusign.connect.DocuSignEnvelopeInformation",
    "envelopeStatus": {
        "$class": "com.docusign.connect.EnvelopeStatus",
        "status": "Declined",
        "envelopeId": "Dolore et ipsum aute ipsum.",
        "created": "2020-07-07T18:53:41.981+01:00",
        "sent": "2020-07-07T18:53:41.981+01:00",
        "delivered": "2020-07-07T18:53:41.981+01:00",
        "signed": "2020-07-07T18:53:41.981+01:00",
        "completed": "2020-07-07T18:53:41.981+01:00",
        "declined": "2020-07-07T18:53:41.981+01:00",
        "email": "Fugiat ea Lorem magna."
    },
    "recipients": [
        {
            "$class": "com.docusign.connect.Recipient",
            "status": "FaxPending",
            "email": "Irure cillum non deserunt.",
            "userName": "Eiusmod aute velit ea.",
            "sent": "2020-07-07T18:53:41.981+01:00",
            "delivered": "2020-07-07T18:53:41.981+01:00",
            "signed": "2020-07-07T18:53:41.981+01:00",
            "declined": "2020-07-07T18:53:41.981+01:00",
            "declineReason": "Consequat ex tempor dolore duis.",
            "tabStatuses": [
                {
                    "$class": "com.docusign.connect.NumberTabStatus",
                    "tabName": "Et.",
                    "tabValue": 178.069,
                    "tabType": "LastName",
                    "status": "Do.",
                    "tabLabel": "Ea.",
                    "originalValue": "Dolor.",
                    "signed": "2020-07-07T18:53:41.981+01:00",
                    "customTabType": "Text"
                }
            ]
        }
    ],
    "customFields": [
        {
            "$class": "com.docusign.connect.CustomField",
            "name": "Aliqua duis magna.",
            "value": "Elit."
        }
    ],
    "transactionId": "cb6ef0d0-c07a-11ea-ad77-8b5ce7c057ac",
    "timestamp": "2020-07-07T18:53:41.981+01:00"
}

Response Types

Type Sample JSON
com.docusign.clauses.PurchaseOrderFailureResponse
{
    "$class": "com.docusign.clauses.PurchaseOrderFailureResponse",
    "penalty": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 181.709,
        "currencyCode": "HTG"
    },
    "transactionId": "cb6f17e0-c07a-11ea-ad77-8b5ce7c057ac",
    "timestamp": "2020-07-07T18:53:41.982+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": 112.134,
        "currencyCode": "CNY"
    },
    "description": "Quis officia.",
    "contract": "resource:com.docusign.clauses.PurchaseOrderFailure#6112",
    "promisor": "resource:org.accordproject.cicero.contract.AccordParty#4898",
    "promisee": "resource:org.accordproject.cicero.contract.AccordParty#1822",
    "deadline": "2020-07-07T18:53:41.983+01:00",
    "eventId": "cb6f3ef1-c07a-11ea-ad77-8b5ce7c057ac",
    "timestamp": "2020-07-07T18:53:41.983+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.