public function __construct($objParentObject, $strSetEditPanelMethod, $strCloseEditPanelMethod, $strControlId = null)
 {
     // Call the Parent
     try {
         parent::__construct($objParentObject, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     // Record Method Callbacks
     $this->strSetEditPanelMethod = $strSetEditPanelMethod;
     $this->strCloseEditPanelMethod = $strCloseEditPanelMethod;
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_CONTROL->ParentControl->dtgInventoryTransaction_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colInventoryTransactionId = new QDataGridColumn(QApplication::Translate('Inventory Transaction Id'), '<?= $_ITEM->InventoryTransactionId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->InventoryTransactionId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->InventoryTransactionId, false)));
     $this->colInventoryLocationId = new QDataGridColumn(QApplication::Translate('Inventory Location Id'), '<?= $_CONTROL->ParentControl->dtgInventoryTransaction_InventoryLocation_Render($_ITEM); ?>');
     $this->colTransactionId = new QDataGridColumn(QApplication::Translate('Transaction Id'), '<?= $_CONTROL->ParentControl->dtgInventoryTransaction_Transaction_Render($_ITEM); ?>');
     $this->colQuantity = new QDataGridColumn(QApplication::Translate('Quantity'), '<?= $_ITEM->Quantity; ?>', array('OrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->Quantity), 'ReverseOrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->Quantity, false)));
     $this->colSourceLocationId = new QDataGridColumn(QApplication::Translate('Source Location Id'), '<?= $_CONTROL->ParentControl->dtgInventoryTransaction_SourceLocation_Render($_ITEM); ?>');
     $this->colDestinationLocationId = new QDataGridColumn(QApplication::Translate('Destination Location Id'), '<?= $_CONTROL->ParentControl->dtgInventoryTransaction_DestinationLocation_Render($_ITEM); ?>');
     $this->colCreatedBy = new QDataGridColumn(QApplication::Translate('Created By'), '<?= $_CONTROL->ParentControl->dtgInventoryTransaction_CreatedByObject_Render($_ITEM); ?>');
     $this->colCreationDate = new QDataGridColumn(QApplication::Translate('Creation Date'), '<?= $_CONTROL->ParentControl->dtgInventoryTransaction_CreationDate_Render($_ITEM); ?>', array('OrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->CreationDate), 'ReverseOrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->CreationDate, false)));
     $this->colModifiedBy = new QDataGridColumn(QApplication::Translate('Modified By'), '<?= $_CONTROL->ParentControl->dtgInventoryTransaction_ModifiedByObject_Render($_ITEM); ?>');
     $this->colModifiedDate = new QDataGridColumn(QApplication::Translate('Modified Date'), '<?= QString::Truncate($_ITEM->ModifiedDate, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->ModifiedDate), 'ReverseOrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->ModifiedDate, false)));
     // Setup DataGrid
     $this->dtgInventoryTransaction = new QDataGrid($this);
     $this->dtgInventoryTransaction->CellSpacing = 0;
     $this->dtgInventoryTransaction->CellPadding = 4;
     $this->dtgInventoryTransaction->BorderStyle = QBorderStyle::Solid;
     $this->dtgInventoryTransaction->BorderWidth = 1;
     $this->dtgInventoryTransaction->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgInventoryTransaction->Paginator = new QPaginator($this->dtgInventoryTransaction);
     $this->dtgInventoryTransaction->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgInventoryTransaction->UseAjax = true;
     // Specify the local databind method this datagrid will use
     $this->dtgInventoryTransaction->SetDataBinder('dtgInventoryTransaction_Bind', $this);
     $this->dtgInventoryTransaction->AddColumn($this->colEditLinkColumn);
     $this->dtgInventoryTransaction->AddColumn($this->colInventoryTransactionId);
     $this->dtgInventoryTransaction->AddColumn($this->colInventoryLocationId);
     $this->dtgInventoryTransaction->AddColumn($this->colTransactionId);
     $this->dtgInventoryTransaction->AddColumn($this->colQuantity);
     $this->dtgInventoryTransaction->AddColumn($this->colSourceLocationId);
     $this->dtgInventoryTransaction->AddColumn($this->colDestinationLocationId);
     $this->dtgInventoryTransaction->AddColumn($this->colCreatedBy);
     $this->dtgInventoryTransaction->AddColumn($this->colCreationDate);
     $this->dtgInventoryTransaction->AddColumn($this->colModifiedBy);
     $this->dtgInventoryTransaction->AddColumn($this->colModifiedDate);
     // Setup the Create New button
     $this->btnCreateNew = new QButton($this);
     $this->btnCreateNew->Text = QApplication::Translate('Create a New') . ' ' . QApplication::Translate('InventoryTransaction');
     $this->btnCreateNew->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCreateNew_Click'));
 }
 protected function Form_Create()
 {
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgInventoryTransaction_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colInventoryTransactionId = new QDataGridColumn(QApplication::Translate('Inventory Transaction Id'), '<?= $_ITEM->InventoryTransactionId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->InventoryTransactionId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->InventoryTransactionId, false)));
     $this->colInventoryLocationId = new QDataGridColumn(QApplication::Translate('Inventory Location Id'), '<?= $_FORM->dtgInventoryTransaction_InventoryLocation_Render($_ITEM); ?>');
     $this->colTransactionId = new QDataGridColumn(QApplication::Translate('Transaction Id'), '<?= $_FORM->dtgInventoryTransaction_Transaction_Render($_ITEM); ?>');
     $this->colQuantity = new QDataGridColumn(QApplication::Translate('Quantity'), '<?= $_ITEM->Quantity; ?>', array('OrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->Quantity), 'ReverseOrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->Quantity, false)));
     $this->colSourceLocationId = new QDataGridColumn(QApplication::Translate('Source Location Id'), '<?= $_FORM->dtgInventoryTransaction_SourceLocation_Render($_ITEM); ?>');
     $this->colDestinationLocationId = new QDataGridColumn(QApplication::Translate('Destination Location Id'), '<?= $_FORM->dtgInventoryTransaction_DestinationLocation_Render($_ITEM); ?>');
     $this->colCreatedBy = new QDataGridColumn(QApplication::Translate('Created By'), '<?= $_FORM->dtgInventoryTransaction_CreatedByObject_Render($_ITEM); ?>');
     $this->colCreationDate = new QDataGridColumn(QApplication::Translate('Creation Date'), '<?= $_FORM->dtgInventoryTransaction_CreationDate_Render($_ITEM); ?>', array('OrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->CreationDate), 'ReverseOrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->CreationDate, false)));
     $this->colModifiedBy = new QDataGridColumn(QApplication::Translate('Modified By'), '<?= $_FORM->dtgInventoryTransaction_ModifiedByObject_Render($_ITEM); ?>');
     $this->colModifiedDate = new QDataGridColumn(QApplication::Translate('Modified Date'), '<?= QString::Truncate($_ITEM->ModifiedDate, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->ModifiedDate), 'ReverseOrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->ModifiedDate, false)));
     // Setup DataGrid
     $this->dtgInventoryTransaction = new QDataGrid($this);
     $this->dtgInventoryTransaction->CellSpacing = 0;
     $this->dtgInventoryTransaction->CellPadding = 4;
     $this->dtgInventoryTransaction->BorderStyle = QBorderStyle::Solid;
     $this->dtgInventoryTransaction->BorderWidth = 1;
     $this->dtgInventoryTransaction->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgInventoryTransaction->Paginator = new QPaginator($this->dtgInventoryTransaction);
     $this->dtgInventoryTransaction->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgInventoryTransaction->UseAjax = false;
     // Specify the local databind method this datagrid will use
     $this->dtgInventoryTransaction->SetDataBinder('dtgInventoryTransaction_Bind');
     $this->dtgInventoryTransaction->AddColumn($this->colEditLinkColumn);
     $this->dtgInventoryTransaction->AddColumn($this->colInventoryTransactionId);
     $this->dtgInventoryTransaction->AddColumn($this->colInventoryLocationId);
     $this->dtgInventoryTransaction->AddColumn($this->colTransactionId);
     $this->dtgInventoryTransaction->AddColumn($this->colQuantity);
     $this->dtgInventoryTransaction->AddColumn($this->colSourceLocationId);
     $this->dtgInventoryTransaction->AddColumn($this->colDestinationLocationId);
     $this->dtgInventoryTransaction->AddColumn($this->colCreatedBy);
     $this->dtgInventoryTransaction->AddColumn($this->colCreationDate);
     $this->dtgInventoryTransaction->AddColumn($this->colModifiedBy);
     $this->dtgInventoryTransaction->AddColumn($this->colModifiedDate);
 }
Пример #3
0
 protected function Form_Create()
 {
     // check rigths for the Inventory to Ship
     $this->blnShowInventory = true;
     $objRoleModule = RoleModule::LoadByRoleIdModuleId(QApplication::$objUserAccount->RoleId, 3);
     if ($objRoleModule->AccessFlag) {
         $objRoleModuleAuthorization = RoleModuleAuthorization::LoadByRoleModuleIdAuthorizationId($objRoleModule->RoleModuleId, 2);
         if ($objRoleModuleAuthorization->AuthorizationLevelId == 3) {
             $this->blnShowInventory = false;
         }
     } else {
         $this->blnShowInventory = false;
     }
     // Call Setup Receipt to either load existing or create new receipt
     $this->SetupReceipt();
     // Create the Header Menu
     $this->ctlHeaderMenu_Create();
     // Create the Shortcut Menu
     $this->ctlShortcutMenu_Create();
     // Create the labels
     $this->lblHeaderReceipt_Create();
     $this->lblFromCompany_Create();
     $this->lblFromContact_Create();
     $this->lblToContact_Create();
     $this->lblToAddress_Create();
     $this->lblReceiptNumber_Create();
     $this->pnlNote_Create();
     $this->lblDueDate_Create();
     $this->lblReceiptDate_Create();
     // Create the inputs
     $this->lstFromCompany_Create();
     $this->lblNewFromCompany_Create();
     $this->lstFromContact_Create();
     $this->lblNewFromContact_Create();
     $this->lstToContact_Create();
     $this->lblNewToContact_Create();
     $this->lstToAddress_Create();
     $this->lblNewToAddress_Create();
     $this->txtNote_Create();
     // Create all custom asset fields - this must be here for tab ordering
     $this->customFields_Create();
     if ($this->blnShowInventory) {
         $this->txtNewInventoryModelCode_Create();
         $this->ctlInventorySearchTool_Create();
         $this->txtQuantity_Create();
         $this->btnAddInventory_Create();
     }
     $this->txtNewAssetCode_Create();
     $this->rblAssetType_Create();
     $this->lstAssetModel_Create();
     $this->chkAutoGenerateAssetCode_Create();
     $this->calDueDate_Create();
     $this->calDateReceived_Create();
     if (QApplication::$TracmorSettings->CustomReceiptNumbers) {
         $this->txtReceiptNumber_Create();
     }
     // Create the buttons
     $this->btnSave_Create();
     $this->btnEdit_Create();
     $this->btnCancel_Create();
     $this->btnDelete_Create();
     $this->atcAttach_Create();
     $this->pnlAttachments_Create();
     $this->btnAddAsset_Create();
     $this->ctlAssetSearchTool_Create();
     //Set display logic of Built-In Fields
     $this->UpdateBuiltInFields();
     // Set display logic of certain Entities
     $this->UpdateAddressAccess();
     $this->UpdateCompanyAccess();
     $this->UpdateContactAccess();
     // Check prerequisites for scheduling receipts
     $this->CheckPrerequisites();
     // Create the datagrids
     $this->dtgAssetTransact_Create();
     $this->dtgInventoryTransact_Create();
     // New entities Dialog
     $this->dlgNew_Create();
     // Load the objAssetTransactionArray and objInventoryTransactionArray for the first time
     if ($this->blnEditMode) {
         $objClauses = array();
         if ($objClause = $this->dtgAssetTransact->OrderByClause) {
             array_push($objClauses, $objClause);
         }
         /*if ($objClause = $this->dtgAssetTransact->LimitClause)
         		array_push($objClauses, $objClause);*/
         if ($objClause = QQ::Expand(QQN::AssetTransaction()->Asset->AssetModel)) {
             array_push($objClauses, $objClause);
         }
         $this->objAssetTransactionArray = AssetTransaction::LoadArrayByTransactionId($this->objReceipt->TransactionId, $objClauses);
         $objClauses = null;
         $objClauses = array();
         if ($objClause = $this->dtgInventoryTransact->OrderByClause) {
             array_push($objClauses, $objClause);
         }
         /*if ($objClause = $this->dtgInventoryTransact->LimitClause)
         		array_push($objClauses, $objClause);*/
         if ($objClause = QQ::Expand(QQN::InventoryTransaction()->InventoryLocation->InventoryModel)) {
         }
         array_push($objClauses, $objClause);
         $this->objInventoryTransactionArray = InventoryTransaction::LoadArrayByTransactionId($this->objReceipt->TransactionId, $objClauses);
         $this->DisplayLabels();
     } elseif (!$this->blnEditMode) {
         $this->DisplayInputs();
     }
     // Check if there is an Asset or InventoryModel ID in the query string to automatically add them - they would be coming from AssetEdit or InventoryEdit
     if (!$this->blnEditMode) {
         $intAssetId = QApplication::QueryString('intAssetId');
         // If an Asset was passed in the query string, load the txt in the Asset Code text box and click the add button
         if ($intAssetId) {
             $objAsset = Asset::Load($intAssetId);
             if ($objAsset) {
                 $this->txtNewAssetCode->Text = $objAsset->AssetCode;
                 $this->btnAddAsset_Click($this, null, null);
             }
         }
         $intInventoryModelId = QApplication::QueryString('intInventoryModelId');
         // If an InventoryModel was passed in the query string, load the text in the InventoryModel text box and set the focus to the quantity box
         if ($intInventoryModelId) {
             $objInventoryModel = InventoryModel::Load($intInventoryModelId);
             if ($objInventoryModel) {
                 $this->txtNewInventoryModelCode->Text = $objInventoryModel->InventoryModelCode;
                 $this->txtQuantity->Focus();
             }
         }
     }
 }
Пример #4
0
 protected function Form_Create()
 {
     // check rigths for the Inventory to Ship
     $this->blnShowInventory = true;
     $objRoleModule = RoleModule::LoadByRoleIdModuleId(QApplication::$objUserAccount->RoleId, 3);
     if ($objRoleModule->AccessFlag) {
         $objRoleModuleAuthorization = RoleModuleAuthorization::LoadByRoleModuleIdAuthorizationId($objRoleModule->RoleModuleId, 2);
         if ($objRoleModuleAuthorization->AuthorizationLevelId == 3) {
             $this->blnShowInventory = false;
         }
     } else {
         $this->blnShowInventory = false;
     }
     // Call SetupShipment to either Load/Edit Existing or Create New
     $this->SetupShipment();
     $this->objCompanyArray = Company::LoadAll(QQ::Clause(QQ::OrderBy(QQN::Company()->ShortDescription)));
     // Create the Header Menu
     $this->ctlHeaderMenu_Create();
     // Create the Shortcut Menu
     $this->ctlShortcutMenu_Create();
     // Packing List Link
     $this->lblPackingListLink_Create();
     // Shipping Labels
     $this->lblShipmentNumber_Create();
     $this->lblHeaderShipment_Create();
     $this->lblShipDate_Create();
     $this->lblFromCompany_Create();
     $this->lblFromContact_Create();
     $this->lblFromAddress_Create();
     $this->lstToCompany_Create();
     $this->lblNewToCompany_Create();
     $this->lstToContact_Create();
     $this->lblNewToContact_Create();
     $this->lstToAddress_Create();
     $this->lblNewToAddress_Create();
     $this->lblFromAddressFull_Create();
     $this->lblToCompany_Create();
     $this->lblToContact_Create();
     $this->lblToAddress_Create();
     $this->lblToAddressFull_Create();
     $this->lblCourier_Create();
     $this->pnlNote_Create();
     $this->lblTrackingNumber_Create();
     // Shipping Inputs
     $this->dlgExchange_Create();
     $this->dlgDueDate_Create();
     $this->calShipDate_Create();
     $this->lstFromCompany_Create();
     $this->lblNewFromCompany_Create();
     $this->lstFromContact_Create();
     $this->lblNewFromContact_Create();
     $this->lstFromAddress_Create();
     $this->lblNewFromAddress_Create();
     if (QApplication::$TracmorSettings->CustomShipmentNumbers) {
         $this->txtShipmentNumber_Create();
     }
     $this->lstCourier_Create();
     $this->txtNote_Create();
     $this->txtNewAssetCode_Create();
     if ($this->blnShowInventory) {
         $this->txtNewInventoryModelCode_Create();
         $this->btnLookup_Create();
         $this->ctlInventorySearchTool_Create();
         $this->lstSourceLocation_Create();
         $this->txtQuantity_Create();
         $this->btnAddInventory_Create();
     }
     $this->txtTrackingNumber_Create();
     //$this->lblAdvanced_Create();
     $this->txtReceiptAssetCode_Create();
     $this->chkAutoGenerateAssetCode_Create();
     $this->dtpScheduleReceiptDueDate_Create();
     $this->rblAssetType_Create();
     $this->chkScheduleReceipt_Create();
     $this->btnAddAsset_Create();
     $this->ctlAssetSearchTool_Create();
     $this->btnSaveExchange_Create();
     $this->btnCancelExchange_Create();
     $this->btnSaveDueDate_Create();
     $this->btnCancelDueDate_Create();
     $this->pnlAttachments_Create();
     // Create all custom asset fields
     $this->customFields_Create();
     //Set display logic of Built-In Fields
     $this->UpdateBuiltInFields();
     $this->UpdateAddressAccess();
     $this->UpdateCompanyAccess();
     $this->UpdateContactAccess();
     // New entities Dialog
     $this->dlgNew_Create();
     if (!$this->objShipment->ShippedFlag) {
         // Shipping Buttons
         $this->btnDelete_Create();
     }
     $this->btnSave_Create();
     $this->btnCancel_Create();
     $this->btnEdit_Create();
     $this->atcAttach_Create();
     // Complete Shipment Buttons
     $this->btnCompleteShipment_Create();
     $this->btnCancelShipment_Create();
     $this->btnCancelCompleteShipment_Create();
     // Shipping Datagrids
     $this->dtgAssetTransact_Create();
     $this->dtgInventoryTransact_Create();
     // Load the objAssetTransactionArray and objInventoryTransactionArray for the first time
     if ($this->blnEditMode) {
         $objClauses = array();
         if ($objClause = $this->dtgAssetTransact->OrderByClause) {
             array_push($objClauses, $objClause);
         }
         /*if ($objClause = $this->dtgAssetTransact->LimitClause)
         		array_push($objClauses, $objClause);*/
         if ($objClause = QQ::Expand(QQN::AssetTransaction()->Asset->AssetModel)) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::AssetTransaction()->SourceLocation)) {
         }
         array_push($objClauses, $objClause);
         $this->objAssetTransactionArray = AssetTransaction::LoadArrayByTransactionId($this->objShipment->TransactionId, $objClauses);
         $objClauses = null;
         $objClauses = array();
         if ($objClause = $this->dtgInventoryTransact->OrderByClause) {
             array_push($objClauses, $objClause);
         }
         /*if ($objClause = $this->dtgInventoryTransact->LimitClause)
         		array_push($objClauses, $objClause);*/
         if ($objClause = QQ::Expand(QQN::InventoryTransaction()->InventoryLocation->InventoryModel)) {
         }
         array_push($objClauses, $objClause);
         $this->objInventoryTransactionArray = InventoryTransaction::LoadArrayByTransactionId($this->objShipment->TransactionId, $objClauses);
         // If shipped, display labels. Otherwise, we don't need to call DisplayLabels because only labels are on the QPanel.
         $this->DisplayLabels();
     } elseif (!$this->blnEditMode) {
         $this->DisplayInputs();
     }
     // Check if there is an Asset or InventoryModel ID in the query string to automatically add them - they would be coming from AssetEdit or InventoryEdit
     if (!$this->blnEditMode) {
         $intAssetId = QApplication::QueryString('intAssetId');
         // If an Asset was passed in the query string, load the txt in the Asset Tag text box and click the add button
         if ($intAssetId) {
             $objAsset = Asset::Load($intAssetId);
             if ($objAsset) {
                 $this->txtNewAssetCode->Text = $objAsset->AssetCode;
                 $this->btnAddAsset_Click($this, null, null);
             }
         }
         $intInventoryModelId = QApplication::QueryString('intInventoryModelId');
         // If an InventoryModel was passed in the query string, load the text in the InventoryModel text box and set the focus to the quantity box
         if ($intInventoryModelId) {
             $objInventoryModel = InventoryModel::Load($intInventoryModelId);
             if ($objInventoryModel) {
                 $this->txtNewInventoryModelCode->Text = $objInventoryModel->InventoryModelCode;
                 $this->btnLookup_Click($this, null, null);
                 QApplication::ExecuteJavaScript(sprintf("document.getElementById('%s').focus()", $this->lstSourceLocation->ControlId));
             }
         }
     }
 }
 /**
  * Count InventoryTransactions
  * by InventoryModelId Index(es), but only those transactions that are Shipments or Receipts
  * @param integer $intAssetId
  * @param boolean $blnInclude - include only shipments and receipts or all other transactions
  * @return int
  */
 public static function CountShipmentReceiptByInventoryModelId($intInventoryModelId, $blnInclude = true)
 {
     // Call AssetTransaction::QueryCount to perform the CountByAssetId query
     if ($blnInclude) {
         $arrToReturn = InventoryTransaction::QueryCount(QQ::AndCondition(QQ::Equal(QQN::InventoryTransaction()->InventoryLocation->InventoryModelId, $intInventoryModelId), QQ::OrCondition(QQ::Equal(QQN::InventoryTransaction()->Transaction->TransactionTypeId, 6), QQ::Equal(QQN::InventoryTransaction()->Transaction->TransactionTypeId, 7))));
     } else {
         $arrToReturn = InventoryTransaction::QueryCount(QQ::AndCondition(QQ::Equal(QQN::InventoryTransaction()->InventoryLocation->InventoryModelId, $intInventoryModelId), QQ::NotEqual(QQN::InventoryTransaction()->Transaction->TransactionTypeId, 6), QQ::NotEqual(QQN::InventoryTransaction()->Transaction->TransactionTypeId, 7)));
     }
     return $arrToReturn;
 }
 protected function dtgInventoryTransaction_Create()
 {
     $this->dtgInventoryTransaction = new QDataGrid($this);
     $this->dtgInventoryTransaction->Name = 'Transaction History';
     $this->dtgInventoryTransaction->CellPadding = 5;
     $this->dtgInventoryTransaction->CellSpacing = 0;
     $this->dtgInventoryTransaction->CssClass = "datagrid";
     // Enable AJAX - this won't work while using the DB profiler
     $this->dtgInventoryTransaction->UseAjax = true;
     // Enable Pagination, and set to 20 items per page
     $objPaginator = new QPaginator($this->dtgInventoryTransaction);
     $this->dtgInventoryTransaction->Paginator = $objPaginator;
     $this->dtgInventoryTransaction->ItemsPerPage = 20;
     $this->dtgInventoryTransaction->AddColumn(new QDataGridColumn(QApplication::Translate('Transaction Type'), '<?= $_ITEM->Transaction->__toStringWithLink() ?>', array('OrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->Transaction->TransactionType->ShortDescription), 'ReverseOrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->Transaction->TransactionType->ShortDescription, false), 'CssClass' => "dtg_column", 'HtmlEntities' => false)));
     $this->dtgInventoryTransaction->AddColumn(new QDataGridColumn(QApplication::Translate('Quantity'), '<?= $_ITEM->Quantity ?>', array('OrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->Quantity), 'ReverseOrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->Quantity, false), 'CssClass' => "dtg_column")));
     $this->dtgInventoryTransaction->AddColumn(new QDataGridColumn(QApplication::Translate('Local Warehouse'), '<?= $_ITEM->LocalWarehouseStock ?>', array('CssClass' => "dtg_column")));
     $this->dtgInventoryTransaction->AddColumn(new QDataGridColumn(QApplication::Translate('Bad Products Warehouse'), '<?= $_ITEM->BadProductsWarehouseStock ?>', array('CssClass' => "dtg_column")));
     /*
     $this->dtgInventoryTransaction->AddColumn(new QDataGridColumn(QApplication::Translate('Sample Warehouse'), '<?= $_ITEM->SampleWarehouseStock ?>', array('CssClass' => "dtg_column")));
     $this->dtgInventoryTransaction->AddColumn(new QDataGridColumn(QApplication::Translate('Repair Warehouse'), '<?= $_ITEM->RepairWarehouseStock ?>', array('CssClass' => "dtg_column")));
     */
     $this->dtgInventoryTransaction->AddColumn(new QDataGridColumn(QApplication::Translate('From'), '<?= $_ITEM->__toStringSourceLocation() ?>', array('OrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->SourceLocation->ShortDescription), 'ReverseOrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->SourceLocation->ShortDescription, false), 'CssClass' => "dtg_column")));
     $this->dtgInventoryTransaction->AddColumn(new QDataGridColumn(QApplication::Translate('To'), '<?= $_ITEM->__toStringDestinationLocation() ?>', array('OrderByClause' => QQ::Orderby(QQN::InventoryTransaction()->DestinationLocation->ShortDescription), 'ReverseOrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->DestinationLocation->ShortDescription, false), 'CssClass' => "dtg_column")));
     $this->dtgInventoryTransaction->AddColumn(new QDataGridColumn(QApplication::Translate('User'), '<?= $_ITEM->Transaction->CreatedByObject->__toStringFullName() ?>', array('OrderByClause' => QQ::Orderby(QQN::InventoryTransaction()->CreatedByObject->LastName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->CreatedByObject->LastName, false), 'CssClass' => "dtg_column")));
     $this->dtgInventoryTransaction->AddColumn(new QDataGridColumn(QApplication::Translate('Date'), '<?= $_ITEM->Transaction->CreationDate->PHPDate("Y-m-d H:i:s"); ?>', array('OrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->Transaction->CreationDate), 'ReverseOrderByClause' => QQ::OrderBy(QQN::InventoryTransaction()->Transaction->CreationDate, false), 'CssClass' => "dtg_column")));
     $this->dtgInventoryTransaction->SortColumnIndex = 7;
     $this->dtgInventoryTransaction->SortDirection = 1;
     $objStyle = $this->dtgInventoryTransaction->RowStyle;
     $objStyle->ForeColor = '#000000';
     $objStyle->BackColor = '#FFFFFF';
     $objStyle->FontSize = 12;
     $objStyle = $this->dtgInventoryTransaction->AlternateRowStyle;
     $objStyle->BackColor = '#EFEFEF';
     $objStyle = $this->dtgInventoryTransaction->HeaderRowStyle;
     $objStyle->ForeColor = '#000000';
     $objStyle->BackColor = '#EFEFEF';
     $objStyle->CssClass = 'dtg_header';
 }
Пример #7
0
 protected function dtgShipmentReceipt_Bind()
 {
     // Get Total Count for Pagination
     $objClauses = array();
     $this->ctlInventoryEdit->dtgShipmentReceipt->TotalItemCount = InventoryTransaction::CountShipmentReceiptByInventoryModelId($this->ctlInventoryEdit->objInventoryModel->InventoryModelId);
     if ($this->ctlInventoryEdit->dtgShipmentReceipt->TotalItemCount === 0) {
         $this->ctlInventoryEdit->lblShipmentReceipt->Display = false;
         $this->ctlInventoryEdit->dtgShipmentReceipt->ShowHeader = false;
     } else {
         $objClauses = array();
         if ($objClause = QQ::OrderBy(QQN::InventoryTransaction()->Transaction->CreationDate, false)) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = $this->ctlInventoryEdit->dtgShipmentReceipt->LimitClause) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::InventoryTransaction()->Transaction->Shipment)) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::InventoryTransaction()->Transaction->Receipt)) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::InventoryTransaction()->SourceLocation)) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::InventoryTransaction()->DestinationLocation)) {
             array_push($objClauses, $objClause);
         }
         $objCondition = QQ::AndCondition(QQ::Equal(QQN::InventoryTransaction()->InventoryLocation->InventoryModelId, $this->ctlInventoryEdit->objInventoryModel->InventoryModelId), QQ::OrCondition(QQ::Equal(QQN::InventoryTransaction()->Transaction->TransactionTypeId, 6), QQ::Equal(QQN::InventoryTransaction()->Transaction->TransactionTypeId, 7)));
         $this->ctlInventoryEdit->dtgShipmentReceipt->DataSource = InventoryTransaction::QueryArray($objCondition, $objClauses);
     }
 }
Пример #8
0
 /**
  * Returns the HTML needed for a receipt datagrid to show asset and inventory icons, with hovertips.
  *
  * @param QDatagrid Object $objControl
  * @return string
  */
 public function __toStringHoverTips($objControl)
 {
     // Create the Asset Image label, with corresponding assets hovertip
     if ($this->Transaction->EntityQtypeId == EntityQtype::AssetInventory || $this->Transaction->EntityQtypeId == EntityQtype::Asset) {
         $lblAssetImage = new QLabelExt($objControl);
         $lblAssetImage->HtmlEntities = false;
         $lblAssetImage->Text = sprintf('<img src="%s/icons/asset_datagrid.png" style="vertical-align:middle;">', __IMAGE_ASSETS__);
         // create
         $objHoverTip = new QHoverTip($lblAssetImage);
         $objHoverTip->Template = __DOCROOT__ . __SUBDIRECTORY__ . '/receiving/hovertip_assets.tpl.php';
         $lblAssetImage->HoverTip = $objHoverTip;
         // Load the AssetTransaction Array on the form so that it can be used by the hovertip panel
         $objClauses = array();
         if ($objClause = QQ::LimitInfo(11, 0)) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::AssetTransaction()->Asset->AssetModel)) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::AssetTransaction()->SourceLocation)) {
         }
         array_push($objClauses, $objClause);
         $objControl->Form->objAssetTransactionArray = AssetTransaction::LoadArrayByTransactionId($this->TransactionId, $objClauses);
         $objClauses = null;
     }
     // Create the Inventory Image label with corresponding inventory hovertip
     if ($this->Transaction->EntityQtypeId == EntityQtype::AssetInventory || $this->Transaction->EntityQtypeId == EntityQtype::Inventory) {
         $lblInventoryImage = new QLabelExt($objControl);
         $lblInventoryImage->HtmlEntities = false;
         $lblInventoryImage->Text = sprintf('<img src="%s/icons/inventory_datagrid.png" style="vertical-align:middle;"', __IMAGE_ASSETS__);
         // Create the inventory hovertip
         $objHoverTip = new QHoverTip($lblInventoryImage);
         $objHoverTip->Template = __DOCROOT__ . __SUBDIRECTORY__ . '/receiving/hovertip_inventory.tpl.php';
         $lblInventoryImage->HoverTip = $objHoverTip;
         // Load the InventoryTransaction Array on the form so that it can be used by the hovertip panel
         $objClauses = array();
         if ($objClause = QQ::LimitInfo(11, 0)) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::InventoryTransaction()->InventoryLocation->InventoryModel)) {
         }
         array_push($objClauses, $objClause);
         $objControl->Form->objInventoryTransactionArray = InventoryTransaction::LoadArrayByTransactionId($this->TransactionId, $objClauses);
         $objClauses = null;
     }
     // Display the appropriate images
     if ($this->Transaction->EntityQtypeId == EntityQtype::AssetInventory) {
         $strToReturn = $lblAssetImage->Render(false) . '&nbsp;' . $lblInventoryImage->Render(false);
     } elseif ($this->Transaction->EntityQtypeId == EntityQtype::Asset) {
         $strToReturn = $lblAssetImage->Render(false);
     } elseif ($this->Transaction->EntityQtypeId == EntityQtype::Inventory) {
         $strToReturn = $lblInventoryImage->Render(false);
     }
     return $strToReturn;
 }
 /**
  * Count InventoryTransactions
  * by ModifiedBy Index(es)
  * @param integer $intModifiedBy
  * @return int
  */
 public static function CountByModifiedBy($intModifiedBy)
 {
     // Call InventoryTransaction::QueryCount to perform the CountByModifiedBy query
     return InventoryTransaction::QueryCount(QQ::Equal(QQN::InventoryTransaction()->ModifiedBy, $intModifiedBy));
 }
 /**
  * Used internally by the Meta-based Add Column tools.
  *
  * Given a QQNode or a Text String, this will return a InventoryTransaction-based QQNode.
  * It will also verify that it is a proper InventoryTransaction-based QQNode, and will throw an exception otherwise.
  *
  * @param mixed $mixContent
  * @return QQNode
  */
 protected function ResolveContentItem($mixContent)
 {
     if ($mixContent instanceof QQNode) {
         if (!$mixContent->_ParentNode) {
             throw new QCallerException('Content QQNode cannot be a Top Level Node');
         }
         if ($mixContent->_RootTableName == 'inventory_transaction') {
             if ($mixContent instanceof QQReverseReferenceNode && !$mixContent->_PropertyName) {
                 throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
             }
             $objCurrentNode = $mixContent;
             while ($objCurrentNode = $objCurrentNode->_ParentNode) {
                 if (!$objCurrentNode instanceof QQNode) {
                     throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
                 }
                 if ($objCurrentNode instanceof QQReverseReferenceNode && !$objCurrentNode->_PropertyName) {
                     throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
                 }
             }
             return $mixContent;
         } else {
             throw new QCallerException('Content QQNode has a root table of "' . $mixContent->_RootTableName . '". Must be a root of "inventory_transaction".');
         }
     } else {
         if (is_string($mixContent)) {
             switch ($mixContent) {
                 case 'InventoryTransactionId':
                     return QQN::InventoryTransaction()->InventoryTransactionId;
                 case 'InventoryLocationId':
                     return QQN::InventoryTransaction()->InventoryLocationId;
                 case 'InventoryLocation':
                     return QQN::InventoryTransaction()->InventoryLocation;
                 case 'TransactionId':
                     return QQN::InventoryTransaction()->TransactionId;
                 case 'Transaction':
                     return QQN::InventoryTransaction()->Transaction;
                 case 'Quantity':
                     return QQN::InventoryTransaction()->Quantity;
                 case 'SourceLocationId':
                     return QQN::InventoryTransaction()->SourceLocationId;
                 case 'SourceLocation':
                     return QQN::InventoryTransaction()->SourceLocation;
                 case 'DestinationLocationId':
                     return QQN::InventoryTransaction()->DestinationLocationId;
                 case 'DestinationLocation':
                     return QQN::InventoryTransaction()->DestinationLocation;
                 case 'CreatedBy':
                     return QQN::InventoryTransaction()->CreatedBy;
                 case 'CreatedByObject':
                     return QQN::InventoryTransaction()->CreatedByObject;
                 case 'CreationDate':
                     return QQN::InventoryTransaction()->CreationDate;
                 case 'ModifiedBy':
                     return QQN::InventoryTransaction()->ModifiedBy;
                 case 'ModifiedByObject':
                     return QQN::InventoryTransaction()->ModifiedByObject;
                 case 'ModifiedDate':
                     return QQN::InventoryTransaction()->ModifiedDate;
                 default:
                     throw new QCallerException('Simple Property not found in InventoryTransactionDataGrid content: ' . $mixContent);
             }
         } else {
             if ($mixContent instanceof QQAssociationNode) {
                 throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
             } else {
                 throw new QCallerException('Invalid Content type');
             }
         }
     }
 }
Пример #11
0
 protected function Form_Create()
 {
     // Call Setup Receipt to either load existing or create new receipt
     $this->SetupReceipt();
     // Create the Header Menu
     $this->ctlHeaderMenu_Create();
     // Create the Shortcut Menu
     $this->ctlShortcutMenu_Create();
     // Create the labels
     $this->lblHeaderReceipt_Create();
     $this->lblFromCompany_Create();
     $this->lblFromContact_Create();
     $this->lblToContact_Create();
     $this->lblToAddress_Create();
     $this->lblReceiptNumber_Create();
     $this->pnlNote_Create();
     $this->lblDueDate_Create();
     $this->lblReceiptDate_Create();
     // Create the inputs
     $this->lstFromCompany_Create();
     $this->lblNewFromCompany_Create();
     $this->lstFromContact_Create();
     $this->lblNewFromContact_Create();
     $this->lstToContact_Create();
     $this->lblNewToContact_Create();
     $this->lstToAddress_Create();
     $this->lblNewToAddress_Create();
     $this->txtNote_Create();
     // Create all custom asset fields - this must be here for tab ordering
     $this->customFields_Create();
     $this->txtNewAssetCode_Create();
     $this->txtNewInventoryModelCode_Create();
     $this->txtQuantity_Create();
     $this->rblAssetType_Create();
     $this->lstAssetModel_Create();
     $this->chkAutoGenerateAssetCode_Create();
     $this->calDueDate_Create();
     if (QApplication::$TracmorSettings->CustomReceiptNumbers) {
         $this->txtReceiptNumber_Create();
     }
     // Create the buttons
     $this->btnSave_Create();
     $this->btnEdit_Create();
     $this->btnCancel_Create();
     $this->btnDelete_Create();
     $this->atcAttach_Create();
     $this->pnlAttachments_Create();
     $this->btnAddAsset_Create();
     $this->btnAddInventory_Create();
     //Set display logic of Built-In Fields
     $this->UpdateBuiltInFields();
     // Set display logic of certain Entities
     $this->UpdateAddressAccess();
     $this->UpdateCompanyAccess();
     $this->UpdateContactAccess();
     // Create the datagrids
     $this->dtgAssetTransact_Create();
     $this->dtgInventoryTransact_Create();
     // New entities Dialog
     $this->dlgNew_Create();
     // Load the objAssetTransactionArray and objInventoryTransactionArray for the first time
     if ($this->blnEditMode) {
         $objClauses = array();
         if ($objClause = $this->dtgAssetTransact->OrderByClause) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = $this->dtgAssetTransact->LimitClause) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::AssetTransaction()->Asset->AssetModel)) {
             array_push($objClauses, $objClause);
         }
         $this->objAssetTransactionArray = AssetTransaction::LoadArrayByTransactionId($this->objReceipt->TransactionId, $objClauses);
         $objClauses = null;
         $objClauses = array();
         if ($objClause = $this->dtgInventoryTransact->OrderByClause) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = $this->dtgInventoryTransact->LimitClause) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::InventoryTransaction()->InventoryLocation->InventoryModel)) {
         }
         array_push($objClauses, $objClause);
         $this->objInventoryTransactionArray = InventoryTransaction::LoadArrayByTransactionId($this->objReceipt->TransactionId, $objClauses);
         $this->DisplayLabels();
     } elseif (!$this->blnEditMode) {
         $this->DisplayInputs();
     }
     // Check if there is an Asset or InventoryModel ID in the query string to automatically add them - they would be coming from AssetEdit or InventoryEdit
     if (!$this->blnEditMode) {
         $intAssetId = QApplication::QueryString('intAssetId');
         // If an Asset was passed in the query string, load the txt in the Asset Code text box and click the add button
         if ($intAssetId) {
             $objAsset = Asset::Load($intAssetId);
             if ($objAsset) {
                 $this->txtNewAssetCode->Text = $objAsset->AssetCode;
                 $this->btnAddAsset_Click($this, null, null);
             }
         }
         $intInventoryModelId = QApplication::QueryString('intInventoryModelId');
         // If an InventoryModel was passed in the query string, load the text in the InventoryModel text box and set the focus to the quantity box
         if ($intInventoryModelId) {
             $objInventoryModel = InventoryModel::Load($intInventoryModelId);
             if ($objInventoryModel) {
                 $this->txtNewInventoryModelCode->Text = $objInventoryModel->InventoryModelCode;
                 QApplication::ExecuteJavaScript(sprintf("document.getElementById('%s').focus()", $this->txtQuantity->ControlId));
             }
         }
     }
 }
Пример #12
0
 protected function Form_Create()
 {
     // Call SetupShipment to either Load/Edit Existing or Create New
     $this->SetupShipment();
     // If the courier is FedEx, load the FedexShipment object
     if ($this->blnEditMode) {
         if ($this->objShipment->CourierId === 1) {
             $this->objFedexShipment = FedexShipment::LoadByShipmentId($this->objShipment->ShipmentId);
         }
     }
     $this->objCompanyArray = Company::LoadAll(QQ::Clause(QQ::OrderBy(QQN::Company()->ShortDescription)));
     // Create the Header Menu
     $this->ctlHeaderMenu_Create();
     // Create the Shortcut Menu
     $this->ctlShortcutMenu_Create();
     // FedEx Shipment Panel
     $this->pnlFedExShipment_Create();
     // Packing List Link
     $this->lblPackingListLink_Create();
     $this->lblFedexShippingLabelLink_Create();
     // Shipping Labels
     $this->lblShipmentNumber_Create();
     $this->lblHeaderShipment_Create();
     // $this->lblHeaderCompleteShipment_Create();
     $this->lblShipDate_Create();
     $this->lblFromCompany_Create();
     $this->lblFromContact_Create();
     $this->lblFromAddress_Create();
     $this->lblFromAddressFull_Create();
     $this->lblToCompany_Create();
     $this->lblToContact_Create();
     $this->lblToAddress_Create();
     $this->lblToAddressFull_Create();
     $this->lblCourier_Create();
     $this->lblToPhone_Create();
     $this->lblBillTransportationTo_Create();
     $this->lblReference_Create();
     $this->lblFedexNotifySenderEmail_Create();
     $this->lblFedexNotifyRecipientEmail_Create();
     $this->lblFedexNotifyOtherEmail_Create();
     $this->lblHoldAtLocationAddress_Create();
     $this->lblHoldAtLocationCity_Create();
     $this->lblHoldAtLocationState_Create();
     $this->lblHoldAtLocationPostalCode_Create();
     $this->pnlNote_Create();
     $this->lblTrackingNumber_Create();
     $this->lblSenderLabel_Create();
     $this->lblPayerAccount_Create();
     $this->lblFxServiceType_Create();
     $this->lblPackageType_Create();
     $this->lblPackageWeight_Create();
     $this->lblPackageLength_Create();
     $this->lblPackageWidth_Create();
     $this->lblPackageHeight_Create();
     $this->lblValue_Create();
     $this->lblWeightUnit_Create();
     $this->lblLengthUnit_Create();
     $this->lblCurrencyUnit_Create();
     // Shipping Inputs
     $this->dlgExchange_Create();
     $this->dlgDueDate_Create();
     $this->calShipDate_Create();
     $this->lstFromCompany_Create();
     $this->lblNewFromCompany_Create();
     $this->lstFromContact_Create();
     $this->lblNewFromContact_Create();
     $this->lstFromAddress_Create();
     $this->lblNewFromAddress_Create();
     $this->lstToCompany_Create();
     $this->lblNewToCompany_Create();
     $this->lstToContact_Create();
     $this->lblNewToContact_Create();
     $this->txtToPhone_Create();
     $this->lstBillTransportationTo_Create();
     $this->lstShippingAccount_Create();
     $this->txtReference_Create();
     $this->txtFedexNotifySenderEmail_Create();
     $this->txtFedexNotifyRecipientEmail_Create();
     $this->txtFedexNotifyOtherEmail_Create();
     $this->chkFedexNotifySenderShipFlag_Create();
     $this->chkFedexNotifySenderExceptionFlag_Create();
     $this->chkFedexNotifySenderDeliveryFlag_Create();
     $this->chkFedexNotifyRecipientShipFlag_Create();
     $this->chkFedexNotifyRecipientExceptionFlag_Create();
     $this->chkFedexNotifyRecipientDeliveryFlag_Create();
     $this->chkFedexNotifyOtherShipFlag_Create();
     $this->chkFedexNotifyOtherExceptionFlag_Create();
     $this->chkFedexNotifyOtherDeliveryFlag_Create();
     $this->lstFxServiceType_Create();
     $this->txtRecipientThirdPartyAccount_Create();
     $this->lstPackageType_Create();
     $this->txtPackageWeight_Create();
     $this->lstWeightUnit_Create();
     $this->txtPackageLength_Create();
     $this->txtPackageWidth_Create();
     $this->txtPackageHeight_Create();
     $this->lstLengthUnit_Create();
     $this->txtValue_Create();
     $this->lstCurrencyUnit_Create();
     $this->chkSaturdayDeliveryFlag_Create();
     $this->chkHoldAtLocationFlag_Create();
     $this->txtHoldAtLocationAddress_Create();
     $this->txtHoldAtLocationCity_Create();
     $this->lstHoldAtLocationState_Create();
     $this->txtHoldAtLocationPostalCode_Create();
     $this->lstToAddress_Create();
     $this->lblNewToAddress_Create();
     if (QApplication::$TracmorSettings->CustomShipmentNumbers) {
         $this->txtShipmentNumber_Create();
     }
     $this->lstCourier_Create();
     $this->txtNote_Create();
     $this->txtNewAssetCode_Create();
     $this->txtNewInventoryModelCode_Create();
     $this->lstSourceLocation_Create();
     $this->txtQuantity_Create();
     $this->txtTrackingNumber_Create();
     //$this->lblAdvanced_Create();
     $this->txtReceiptAssetCode_Create();
     $this->chkAutoGenerateAssetCode_Create();
     $this->dtpScheduleReceiptDueDate_Create();
     $this->rblAssetType_Create();
     $this->chkScheduleReceipt_Create();
     $this->btnAddAsset_Create();
     $this->btnLookup_Create();
     $this->btnAddInventory_Create();
     $this->btnSaveExchange_Create();
     $this->btnCancelExchange_Create();
     $this->btnSaveDueDate_Create();
     $this->btnCancelDueDate_Create();
     $this->pnlAttachments_Create();
     // Create all custom asset fields
     $this->customFields_Create();
     //Set display logic of Built-In Fields
     $this->UpdateBuiltInFields();
     $this->UpdateAddressAccess();
     $this->UpdateCompanyAccess();
     $this->UpdateContactAccess();
     // New entities Dialog
     $this->dlgNew_Create();
     if (!$this->objShipment->ShippedFlag) {
         // Shipping Buttons
         $this->btnSave_Create();
         $this->btnCancel_Create();
         $this->btnEdit_Create();
         $this->btnDelete_Create();
     }
     $this->atcAttach_Create();
     // Complete Shipment Buttons
     $this->btnCompleteShipment_Create();
     $this->btnCancelShipment_Create();
     $this->btnCancelCompleteShipment_Create();
     // Shipping Datagrids
     $this->dtgAssetTransact_Create();
     $this->dtgInventoryTransact_Create();
     // Load the objAssetTransactionArray and objInventoryTransactionArray for the first time
     if ($this->blnEditMode) {
         $objClauses = array();
         if ($objClause = $this->dtgAssetTransact->OrderByClause) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = $this->dtgAssetTransact->LimitClause) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::AssetTransaction()->Asset->AssetModel)) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::AssetTransaction()->SourceLocation)) {
         }
         array_push($objClauses, $objClause);
         $this->objAssetTransactionArray = AssetTransaction::LoadArrayByTransactionId($this->objShipment->TransactionId, $objClauses);
         $objClauses = null;
         $objClauses = array();
         if ($objClause = $this->dtgInventoryTransact->OrderByClause) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = $this->dtgInventoryTransact->LimitClause) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::InventoryTransaction()->InventoryLocation->InventoryModel)) {
         }
         array_push($objClauses, $objClause);
         $this->objInventoryTransactionArray = InventoryTransaction::LoadArrayByTransactionId($this->objShipment->TransactionId, $objClauses);
         // If shipped, display labels. Otherwise, we don't need to call DisplayLabels because only labels are on the QPanel.
         $this->DisplayLabels();
     } elseif (!$this->blnEditMode) {
         $this->DisplayInputs();
     }
     // Check if there is an Asset or InventoryModel ID in the query string to automatically add them - they would be coming from AssetEdit or InventoryEdit
     if (!$this->blnEditMode) {
         $intAssetId = QApplication::QueryString('intAssetId');
         // If an Asset was passed in the query string, load the txt in the Asset Code text box and click the add button
         if ($intAssetId) {
             $objAsset = Asset::Load($intAssetId);
             if ($objAsset) {
                 $this->txtNewAssetCode->Text = $objAsset->AssetCode;
                 $this->btnAddAsset_Click($this, null, null);
             }
         }
         $intInventoryModelId = QApplication::QueryString('intInventoryModelId');
         // If an InventoryModel was passed in the query string, load the text in the InventoryModel text box and set the focus to the quantity box
         if ($intInventoryModelId) {
             $objInventoryModel = InventoryModel::Load($intInventoryModelId);
             if ($objInventoryModel) {
                 $this->txtNewInventoryModelCode->Text = $objInventoryModel->InventoryModelCode;
                 $this->btnLookup_Click($this, null, null);
                 QApplication::ExecuteJavaScript(sprintf("document.getElementById('%s').focus()", $this->lstSourceLocation->ControlId));
             }
         }
     }
 }