Categories

.orderUiDocumentGenerator()

Categories: UI

.orderUiDocumentGenerator( [ options ] )

Subclass: de_epages

Inherit: (Subclass: de_epages) .widget()

Plugin: de_epages.order.ui.documentGenerator

Description: Create a dialog to generate documents.

  • .orderUiDocumentGenerator( [ options ] )

    version added: 6.15.0

    options   A map of additional options to pass to the method.

The .orderUiDocumentGenerator() creates a dialog which enables the user to generate the packaging slip and/or invoice documents for an order. Also the status of the order can be updated to Ready for shipping, Dispatched and Invoiced. After creating the documents the printview automatically can be shown in a new tab.

  • Binds the orderUiDocumentGenerator()-Dialog to an anonymous div and calls the open-method of the widget via on-click event attached to a page element.

    Code:
    
    <script>
    	jQuery.ready({
    				plugin: [ 'de_epages.order.ui.documentGenerator' ],
    				DOM:    true
    			}, function($){
    				var documentWidget = de_epages('<div>').orderUiDocumentGenerator();
    				$("#generateDocuments").on("click",function(){
    					de_epages(documentWidget).orderUiDocumentGenerator('open');
    				});
    			});
    </script>
    
  • Opens the orderUiDocumentGenerator() with use of the option to commit a list of order id's to generate the chosen documents for all the orders in the list. The list consists of orders which have been chosen by checkboxes.

    Code:
    
    <script>
    jq(this.form)
    			.find('input:checkbox:checked[name=ListObjectID]')
    			.each(function(){
    				selected.push( jq(this).val() );
    			});
    
    		if( !selected.length ){
    			return false;
    		}
    		jQuery.ready({
    				plugin: [ 'de_epages.order.ui.documentGenerator' ],
    				DOM:    true
    			}, function($){
    				var documentWidget = de_epages('<div>').orderUiDocumentGenerator({
    					orders    :   selected
    				});
    				de_epages(documentWidget).orderUiDocumentGenerator('open');
    			});
    </script>
    
    
  • orders

    version added: 6.15.0

    A list of objectIds of orders for which documents have to be created

    Default: undefined

  • open

    • .orderUiDocumentGenerator('open')

      version added: 6.15.0

    When the method is called it checks if there is already a dialog created or if the dialog is not defined yet. If not defined, the widget function _create() is called otherwise the dialog only opens as an overlay.