myinvois-sdk
Version:
TypeScript SDK for interacting with the Malaysia e-invoicing system (MyInvois) API
49 lines (48 loc) • 2 kB
TypeScript
/**
* Enum for document types supported by MyInvois
* Based on official documentation
*/
export declare enum DocumentType {
INVOICE = "01",// Invoice issued by Supplier to Buyer
CREDIT_NOTE = "02",// Credit note to correct errors, apply discounts, or account for returns
DEBIT_NOTE = "03",// Debit note to indicate additional charges
REFUND_NOTE = "04",// Refund note to confirm refund of Buyer's payment
SELF_BILLED_INVOICE = "05",// Self-billed invoice issued by Buyer
SELF_BILLED_CREDIT_NOTE = "06",// Self-billed credit note
SELF_BILLED_DEBIT_NOTE = "07",// Self-billed debit note
SELF_BILLED_REFUND_NOTE = "08"
}
/**
* Map of document type codes to human-readable descriptions
*/
export declare const DocumentTypeDescriptions: Record<string, string>;
/**
* Returns true if the document type is a standard (non-self-billed) document
* @param documentType The document type to check
*/
export declare function isStandardDocument(documentType: string): boolean;
/**
* Returns true if the document type is a self-billed document
* @param documentType The document type to check
*/
export declare function isSelfBilledDocument(documentType: string): boolean;
/**
* Returns true if the document is an invoice (standard or self-billed)
* @param documentType The document type to check
*/
export declare function isInvoice(documentType: string): boolean;
/**
* Returns true if the document is a credit note (standard or self-billed)
* @param documentType The document type to check
*/
export declare function isCreditNote(documentType: string): boolean;
/**
* Returns true if the document is a debit note (standard or self-billed)
* @param documentType The document type to check
*/
export declare function isDebitNote(documentType: string): boolean;
/**
* Returns true if the document is a refund note (standard or self-billed)
* @param documentType The document type to check
*/
export declare function isRefundNote(documentType: string): boolean;