Skip to content

Commit

Permalink
adding submission status for purchase order
Browse files Browse the repository at this point in the history
  • Loading branch information
aelsaidy committed Aug 16, 2020
1 parent 3c70780 commit fcae9f4
Show file tree
Hide file tree
Showing 2 changed files with 343 additions and 325 deletions.
154 changes: 82 additions & 72 deletions src/Model/PurchaseOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace Skuio\Sdk\Model;


use Carbon\Carbon;
use Skuio\Sdk\Model;

Expand All @@ -20,6 +19,8 @@
* @property Carbon $purchase_order_date
* @property string $purchase_order_number
* @property string $submission_format
* @property string $submission_status
* @property string $last_submitted_at
* @property string $approval_status
* @property int $payment_term_id
* @property int $incoterm_id
Expand All @@ -36,83 +37,92 @@
class PurchaseOrder extends Model
{

/**
* Order Statuses
*/
const STATUS_DRAFT = 'draft';
const STATUS_OPEN = 'open';
const STATUS_CLOSED = 'closed';
const STATUS = [
self::STATUS_DRAFT,
self::STATUS_OPEN,
self::STATUS_CLOSED,
];
/**
* Order Statuses
*/
const STATUS_DRAFT = 'draft';
const STATUS_OPEN = 'open';
const STATUS_CLOSED = 'closed';
const STATUS = [
self::STATUS_DRAFT,
self::STATUS_OPEN,
self::STATUS_CLOSED,
];

// Approval Statuses
const APPROVAL_STATUS_PENDING = 'pending';
const APPROVAL_STATUS_APPROVED = 'approved';
const APPROVAL_STATUS = [ self::APPROVAL_STATUS_PENDING, self::APPROVAL_STATUS_APPROVED ];
// Approval Statuses
const APPROVAL_STATUS_PENDING = 'pending';
const APPROVAL_STATUS_APPROVED = 'approved';
const APPROVAL_STATUS = [ self::APPROVAL_STATUS_PENDING, self::APPROVAL_STATUS_APPROVED ];

/**
* Submission Statuses
*/
const SUBMISSION_STATUS_UNSUBMITTED = 'unsubmitted';
const SUBMISSION_STATUS_SUBMITTED = 'submitted';
const SUBMISSION_STATUS_CHANGE_REQUEST_SUPPLIER = 'change_supplier';
const SUBMISSION_STATUS_CHANGE_REQUEST_BUYER = 'change_buyer';
const SUBMISSION_STATUS_FINALIZED = 'finalized';
const SUBMISSION_STATUS_CANCELED = 'canceled'; // by Supplier (After Submission)
const SUBMISSION_STATUS_VOIDED = 'voided '; // by Buyer (Before Submission)
const SUBMISSION_STATUS = [
self::SUBMISSION_STATUS_UNSUBMITTED,
self::SUBMISSION_STATUS_SUBMITTED,
self::SUBMISSION_STATUS_CHANGE_REQUEST_BUYER,
self::SUBMISSION_STATUS_CHANGE_REQUEST_SUPPLIER,
self::SUBMISSION_STATUS_FINALIZED,
self::SUBMISSION_STATUS_CANCELED,
self::SUBMISSION_STATUS_VOIDED,
];
/**
* Submission Statuses
*/
const SUBMISSION_STATUS_UNSUBMITTED = 'unsubmitted';
const SUBMISSION_STATUS_SUBMITTED = 'submitted';
const SUBMISSION_STATUS_CHANGE_REQUEST_SUPPLIER = 'change_supplier';
const SUBMISSION_STATUS_CHANGE_REQUEST_BUYER = 'change_buyer';
const SUBMISSION_STATUS_FINALIZED = 'finalized';
const SUBMISSION_STATUS_CANCELED = 'canceled'; // by Supplier (After Submission)
const SUBMISSION_STATUS_VOIDED = 'voided '; // by Buyer (Before Submission)
const SUBMISSION_STATUS = [
self::SUBMISSION_STATUS_UNSUBMITTED,
self::SUBMISSION_STATUS_SUBMITTED,
self::SUBMISSION_STATUS_CHANGE_REQUEST_BUYER,
self::SUBMISSION_STATUS_CHANGE_REQUEST_SUPPLIER,
self::SUBMISSION_STATUS_FINALIZED,
self::SUBMISSION_STATUS_CANCELED,
self::SUBMISSION_STATUS_VOIDED,
];

/**
* Receipt Statuses
*/
const RECEIPT_STATUS_UNRECEIVED = 'unreceived';
const RECEIPT_STATUS_RECEIVED = 'received';
const RECEIPT_STATUS_PARTIALLY_RECEIVED = 'partially_received';
const RECEIPT_STATUS_DROPSHIP = 'Dropship';
const RECEIPT_STATUS = [
self::RECEIPT_STATUS_UNRECEIVED,
self::RECEIPT_STATUS_RECEIVED,
self::RECEIPT_STATUS_PARTIALLY_RECEIVED,
self::RECEIPT_STATUS_DROPSHIP,
];
/**
* Submission Format
*/
const SUBMISSION_FORMAT_PDF_ATTACHMENT = 'email_pdf_attachment';
const SUBMISSION_FORMAT_MANUAL = 'manual';
const SUBMISSION_FORMATS = [
self::SUBMISSION_FORMAT_PDF_ATTACHMENT,
self::SUBMISSION_FORMAT_MANUAL,
];

/**
* Receipt Statuses
*/
const RECEIPT_STATUS_UNRECEIVED = 'unreceived';
const RECEIPT_STATUS_RECEIVED = 'received';
const RECEIPT_STATUS_PARTIALLY_RECEIVED = 'partially_received';
const RECEIPT_STATUS_DROPSHIP = 'Dropship';
const RECEIPT_STATUS = [
self::RECEIPT_STATUS_UNRECEIVED,
self::RECEIPT_STATUS_RECEIVED,
self::RECEIPT_STATUS_PARTIALLY_RECEIVED,
self::RECEIPT_STATUS_DROPSHIP,
];

/**
* Shipment Status
*/
const SHIPMENT_STATUS_UNSHIPPED = 'unshipped';
const SHIPMENT_STATUS_SHIPPED_WAREHOUSE = 'shipped_to_warehouse';
const SHIPMENT_STATUS_SHIPPED_CUSTOMER = 'shipped_to_customer'; // In the case of dropship orders
const SHIPMENT_STATUS = [
self::SHIPMENT_STATUS_UNSHIPPED,
self::SHIPMENT_STATUS_SHIPPED_WAREHOUSE,
self::SHIPMENT_STATUS_SHIPPED_CUSTOMER,
];
/**
* Shipment Status
*/
const SHIPMENT_STATUS_UNSHIPPED = 'unshipped';
const SHIPMENT_STATUS_SHIPPED_WAREHOUSE = 'shipped_to_warehouse';
const SHIPMENT_STATUS_SHIPPED_CUSTOMER = 'shipped_to_customer'; // In the case of dropship orders
const SHIPMENT_STATUS = [
self::SHIPMENT_STATUS_UNSHIPPED,
self::SHIPMENT_STATUS_SHIPPED_WAREHOUSE,
self::SHIPMENT_STATUS_SHIPPED_CUSTOMER,
];

/**
* Invoice statuses
*/
const INVOICE_STATUS_UNINVOICED = 'uninvoiced';
const INVOICE_STATUS_PARTIALLY_INVOICED = 'partially_invoiced';
const INVOICE_STATUS_INVOICED = 'invoiced'; // Ready to submit to Accounting Software
const INVOICE_STATUS_INVOICE_PAID = 'invoice_paid'; // Can be determined by pulling status from Accounting Software
const INVOICE_STATUS = [
self::INVOICE_STATUS_UNINVOICED,
self::INVOICE_STATUS_PARTIALLY_INVOICED,
self::INVOICE_STATUS_INVOICED,
self::INVOICE_STATUS_INVOICE_PAID,
];
/**
* Invoice statuses
*/
const INVOICE_STATUS_UNINVOICED = 'uninvoiced';
const INVOICE_STATUS_PARTIALLY_INVOICED = 'partially_invoiced';
const INVOICE_STATUS_INVOICED = 'invoiced'; // Ready to submit to Accounting Software
const INVOICE_STATUS_INVOICE_PAID = 'invoice_paid'; // Can be determined by pulling status from Accounting Software
const INVOICE_STATUS = [
self::INVOICE_STATUS_UNINVOICED,
self::INVOICE_STATUS_PARTIALLY_INVOICED,
self::INVOICE_STATUS_INVOICED,
self::INVOICE_STATUS_INVOICE_PAID,
];

/**
* Add purchase order line
Expand Down
Loading

0 comments on commit fcae9f4

Please sign in to comment.