ePages 7.37.0 - DE_EPAGES/Order/API/OrderDocument.pm

Package DE_EPAGES::Order::API::OrderDocument

object interface for Order Documents.

@EXPORT_OK
CreateOrderDocument
CreateShippingLabel
CreateLegalDocumentPDF
GetLegalDocumentPDFFileName
GetLegalDocumentPDFLocation
GetLegalDocumentPDFAttachment
GetCustomerInformationPDFAttachment
GetLegalDocumentPDFWebFileName
SetOrderChangeLastUpdatedOn

Functions

CreateLegalDocumentPDF
CreateOrderDocument
CreateShippingLabel
GetCustomerInformationPDFAttachment
GetLegalDocumentPDFAttachment
GetLegalDocumentPDFFileName
GetLegalDocumentPDFLocation
GetLegalDocumentPDFWebFileName
SetOrderChangeLastUpdatedOn

CreateLegalDocumentPDF

Creates a new legal document PDF in the given language.

Syntax
CreateLegalDocumentPDF($Shop, $LegalDocument, $LanguageID);
Input
$Shop (object)
shop object
$LegalDocument (object)
LegalDocument content object
$LanguageID (integer)
language
Return
$Success (boolean)
true if a PDFs was written

CreateOrderDocument

Creates a new packing slip object for the given Order object.

Syntax
$Document = CreateOrderDocument( $Order, $DocumentTypeName, $DocumentTypePlural);
$Document = CreateOrderDocument( $Order, $DocumentTypeName, $DocumentTypePlural, $hOptions );
Example
my $Invoice = CreateOrderDocument($Order, 'Invoice', 'Invoices');
my $Invoice = CreateOrderDocument(
    $Order,
    'Invoice,
    'Invoices',
    {
        'DeliveryDate' => $DeliveryDate,
        'IssueDate' => $IssueDate
    }
);
Input
$Order (object)
order object
$DocumentTypeName (string)
class package name of the document type, i.e.
'Invoice'
$DocumentTypePlural (string)
"plural" class package name of the document type,
i.e. 'Invoices'
$hOptions
optional attributes of new object
  • Alias - object alias - string
  • DeliveryDate - datetime object for delivery date - object
  • IssueDate - datetime object for issue date - object
  • Issued - finalize the document (optional) - boolean
  • UseAlwaysDeliveryDate - use handed over delivery date (optional) - boolean
Return
$PackingSlip (object)
packing slip object

CreateShippingLabel

Creates a new shipping label object for the given Order object ( if the order has assigned a ShippingFulfillmentMethod )

Syntax
$Label = CreateShippingLabel( $Order);
Example
my $Label = CreateShippingLabel($Order);
Input
$Order (object)
order object
Return
$ShippingLabel (object)
shipping label object

GetCustomerInformationPDFAttachment

Returns the PDF full filename to use as mail attachment. Creates a new customer information PDF if it wasn't created yet.

Syntax
GetCustomerInformationPDFAttachment($Shop, $LanguageID);
Input
$Shop (object)
shop object
$LanguageID (integer)
language
Return
$hAttachment (ref.hash)
hash with the PDF filename

GetLegalDocumentPDFAttachment

Returns the PDF full filename to use as mail attachment. Creates a new legal document PDF if it wasn't created yet.

Syntax
GetLegalDocumentPDFAttachment($Shop, $LanguageID, $LegalDocument);
Input
$Shop (object)
shop object
$LanguageID (integer)
language
$LegalDocument (object)
legal document,
e.g. 'CustomerInformation', 'TermsAndConditions', ...
Return
$hAttachment (ref.hash)
hash with the PDF filename

GetLegalDocumentPDFFileName

Returns the PDF full filename.

Syntax
GetLegalDocumentPDFFileName($Shop, $LanguageID, $LegalDocument);
Input
$Shop (object)
shop object
$LanguageID (integer)
language
$LegalDocument (object)
legal document,
e.g. 'CustomerInformation', 'TermsAndConditions', ...
Return
$FileName (string)
full PDF filename

GetLegalDocumentPDFLocation

Returns the folder which contains the generated PDFs. Each resides in a language folder, which is added during creation.

Syntax
GetLegalDocumentPDFLocation($Shop, $LegalDocument);
Input
$Shop (object)
shop object
$LegalDocument (object)
legal document,
e.g. 'CustomerInformation', 'TermsAndConditions', ...
Return
$Location (string)
folder for the generated PDFs

GetLegalDocumentPDFWebFileName

Returns the PDF web filename (including shop URL).

Syntax
GetLegalDocumentPDFWebFileName($Shop, $LanguageID, $LegalDocument);
Input
$Shop (object)
shop object
$LanguageID (integer)
order language
$LegalDocument (object)
legal document,
e.g. 'CustomerInformation', 'TermsAndConditions', ...
Return
$FileName (string)
full PDF filename

SetOrderChangeLastUpdatedOn

Updates the timestamp of Order in LastUpdate SQL Table using as objectId the OrderId and profileId OrderChange

Syntax
SetOrderChangeLastUpdatedOn( $Order );
Input
$Order (Object)
Order Object