protected function SetupShippingAccount()
 {
     // Lookup Object PK information from Query String (if applicable)
     // Set mode to Edit or New depending on what's found
     $intShippingAccountId = QApplication::QueryString('intShippingAccountId');
     if ($intShippingAccountId) {
         $this->objShippingAccount = ShippingAccount::Load($intShippingAccountId);
         if (!$this->objShippingAccount) {
             throw new Exception('Could not find a ShippingAccount object with PK arguments: ' . $intShippingAccountId);
         }
         $this->strTitleVerb = QApplication::Translate('Edit');
         $this->blnEditMode = true;
     } else {
         $this->objShippingAccount = new ShippingAccount();
         $this->strTitleVerb = QApplication::Translate('Create');
         $this->blnEditMode = false;
     }
 }
예제 #2
0
 /**
  * Override method to perform a property "Get"
  * This will get the value of $strName
  *
  * @param string $strName Name of the property to get
  * @return mixed
  */
 public function __get($strName)
 {
     switch ($strName) {
         ///////////////////
         // Member Variables
         ///////////////////
         case 'FedexShipmentId':
             /**
              * Gets the value for intFedexShipmentId (Read-Only PK)
              * @return integer
              */
             return $this->intFedexShipmentId;
         case 'ShipmentId':
             /**
              * Gets the value for intShipmentId (Not Null)
              * @return integer
              */
             return $this->intShipmentId;
         case 'PackageTypeId':
             /**
              * Gets the value for intPackageTypeId 
              * @return integer
              */
             return $this->intPackageTypeId;
         case 'ShippingAccountId':
             /**
              * Gets the value for intShippingAccountId 
              * @return integer
              */
             return $this->intShippingAccountId;
         case 'FedexServiceTypeId':
             /**
              * Gets the value for intFedexServiceTypeId 
              * @return integer
              */
             return $this->intFedexServiceTypeId;
         case 'CurrencyUnitId':
             /**
              * Gets the value for intCurrencyUnitId 
              * @return integer
              */
             return $this->intCurrencyUnitId;
         case 'WeightUnitId':
             /**
              * Gets the value for intWeightUnitId 
              * @return integer
              */
             return $this->intWeightUnitId;
         case 'LengthUnitId':
             /**
              * Gets the value for intLengthUnitId 
              * @return integer
              */
             return $this->intLengthUnitId;
         case 'ToPhone':
             /**
              * Gets the value for strToPhone 
              * @return string
              */
             return $this->strToPhone;
         case 'PayType':
             /**
              * Gets the value for intPayType 
              * @return integer
              */
             return $this->intPayType;
         case 'PayerAccountNumber':
             /**
              * Gets the value for strPayerAccountNumber 
              * @return string
              */
             return $this->strPayerAccountNumber;
         case 'PackageWeight':
             /**
              * Gets the value for fltPackageWeight 
              * @return double
              */
             return $this->fltPackageWeight;
         case 'PackageLength':
             /**
              * Gets the value for fltPackageLength 
              * @return double
              */
             return $this->fltPackageLength;
         case 'PackageWidth':
             /**
              * Gets the value for fltPackageWidth 
              * @return double
              */
             return $this->fltPackageWidth;
         case 'PackageHeight':
             /**
              * Gets the value for fltPackageHeight 
              * @return double
              */
             return $this->fltPackageHeight;
         case 'DeclaredValue':
             /**
              * Gets the value for fltDeclaredValue 
              * @return double
              */
             return $this->fltDeclaredValue;
         case 'Reference':
             /**
              * Gets the value for strReference 
              * @return string
              */
             return $this->strReference;
         case 'SaturdayDeliveryFlag':
             /**
              * Gets the value for blnSaturdayDeliveryFlag 
              * @return boolean
              */
             return $this->blnSaturdayDeliveryFlag;
         case 'NotifySenderEmail':
             /**
              * Gets the value for strNotifySenderEmail 
              * @return string
              */
             return $this->strNotifySenderEmail;
         case 'NotifySenderShipFlag':
             /**
              * Gets the value for blnNotifySenderShipFlag 
              * @return boolean
              */
             return $this->blnNotifySenderShipFlag;
         case 'NotifySenderExceptionFlag':
             /**
              * Gets the value for blnNotifySenderExceptionFlag 
              * @return boolean
              */
             return $this->blnNotifySenderExceptionFlag;
         case 'NotifySenderDeliveryFlag':
             /**
              * Gets the value for blnNotifySenderDeliveryFlag 
              * @return boolean
              */
             return $this->blnNotifySenderDeliveryFlag;
         case 'NotifyRecipientEmail':
             /**
              * Gets the value for strNotifyRecipientEmail 
              * @return string
              */
             return $this->strNotifyRecipientEmail;
         case 'NotifyRecipientShipFlag':
             /**
              * Gets the value for blnNotifyRecipientShipFlag 
              * @return boolean
              */
             return $this->blnNotifyRecipientShipFlag;
         case 'NotifyRecipientExceptionFlag':
             /**
              * Gets the value for blnNotifyRecipientExceptionFlag 
              * @return boolean
              */
             return $this->blnNotifyRecipientExceptionFlag;
         case 'NotifyRecipientDeliveryFlag':
             /**
              * Gets the value for blnNotifyRecipientDeliveryFlag 
              * @return boolean
              */
             return $this->blnNotifyRecipientDeliveryFlag;
         case 'NotifyOtherEmail':
             /**
              * Gets the value for strNotifyOtherEmail 
              * @return string
              */
             return $this->strNotifyOtherEmail;
         case 'NotifyOtherShipFlag':
             /**
              * Gets the value for blnNotifyOtherShipFlag 
              * @return boolean
              */
             return $this->blnNotifyOtherShipFlag;
         case 'NotifyOtherExceptionFlag':
             /**
              * Gets the value for blnNotifyOtherExceptionFlag 
              * @return boolean
              */
             return $this->blnNotifyOtherExceptionFlag;
         case 'NotifyOtherDeliveryFlag':
             /**
              * Gets the value for blnNotifyOtherDeliveryFlag 
              * @return boolean
              */
             return $this->blnNotifyOtherDeliveryFlag;
         case 'HoldAtLocationFlag':
             /**
              * Gets the value for blnHoldAtLocationFlag 
              * @return boolean
              */
             return $this->blnHoldAtLocationFlag;
         case 'HoldAtLocationAddress':
             /**
              * Gets the value for strHoldAtLocationAddress 
              * @return string
              */
             return $this->strHoldAtLocationAddress;
         case 'HoldAtLocationCity':
             /**
              * Gets the value for strHoldAtLocationCity 
              * @return string
              */
             return $this->strHoldAtLocationCity;
         case 'HoldAtLocationState':
             /**
              * Gets the value for intHoldAtLocationState 
              * @return integer
              */
             return $this->intHoldAtLocationState;
         case 'HoldAtLocationPostalCode':
             /**
              * Gets the value for strHoldAtLocationPostalCode 
              * @return string
              */
             return $this->strHoldAtLocationPostalCode;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'Shipment':
             /**
              * Gets the value for the Shipment object referenced by intShipmentId (Not Null)
              * @return Shipment
              */
             try {
                 if (!$this->objShipment && !is_null($this->intShipmentId)) {
                     $this->objShipment = Shipment::Load($this->intShipmentId);
                 }
                 return $this->objShipment;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'PackageType':
             /**
              * Gets the value for the PackageType object referenced by intPackageTypeId 
              * @return PackageType
              */
             try {
                 if (!$this->objPackageType && !is_null($this->intPackageTypeId)) {
                     $this->objPackageType = PackageType::Load($this->intPackageTypeId);
                 }
                 return $this->objPackageType;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ShippingAccount':
             /**
              * Gets the value for the ShippingAccount object referenced by intShippingAccountId 
              * @return ShippingAccount
              */
             try {
                 if (!$this->objShippingAccount && !is_null($this->intShippingAccountId)) {
                     $this->objShippingAccount = ShippingAccount::Load($this->intShippingAccountId);
                 }
                 return $this->objShippingAccount;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'FedexServiceType':
             /**
              * Gets the value for the FedexServiceType object referenced by intFedexServiceTypeId 
              * @return FedexServiceType
              */
             try {
                 if (!$this->objFedexServiceType && !is_null($this->intFedexServiceTypeId)) {
                     $this->objFedexServiceType = FedexServiceType::Load($this->intFedexServiceTypeId);
                 }
                 return $this->objFedexServiceType;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'CurrencyUnit':
             /**
              * Gets the value for the CurrencyUnit object referenced by intCurrencyUnitId 
              * @return CurrencyUnit
              */
             try {
                 if (!$this->objCurrencyUnit && !is_null($this->intCurrencyUnitId)) {
                     $this->objCurrencyUnit = CurrencyUnit::Load($this->intCurrencyUnitId);
                 }
                 return $this->objCurrencyUnit;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'WeightUnit':
             /**
              * Gets the value for the WeightUnit object referenced by intWeightUnitId 
              * @return WeightUnit
              */
             try {
                 if (!$this->objWeightUnit && !is_null($this->intWeightUnitId)) {
                     $this->objWeightUnit = WeightUnit::Load($this->intWeightUnitId);
                 }
                 return $this->objWeightUnit;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'LengthUnit':
             /**
              * Gets the value for the LengthUnit object referenced by intLengthUnitId 
              * @return LengthUnit
              */
             try {
                 if (!$this->objLengthUnit && !is_null($this->intLengthUnitId)) {
                     $this->objLengthUnit = LengthUnit::Load($this->intLengthUnitId);
                 }
                 return $this->objLengthUnit;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'HoldAtLocationStateObject':
             /**
              * Gets the value for the StateProvince object referenced by intHoldAtLocationState 
              * @return StateProvince
              */
             try {
                 if (!$this->objHoldAtLocationStateObject && !is_null($this->intHoldAtLocationState)) {
                     $this->objHoldAtLocationStateObject = StateProvince::Load($this->intHoldAtLocationState);
                 }
                 return $this->objHoldAtLocationStateObject;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             ////////////////////////////
             // Virtual Object References (Many to Many and Reverse References)
             // (If restored via a "Many-to" expansion)
             ////////////////////////////
         ////////////////////////////
         // Virtual Object References (Many to Many and Reverse References)
         // (If restored via a "Many-to" expansion)
         ////////////////////////////
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
예제 #3
0
 protected function FedExCancel()
 {
     // Create the new Fedex object
     if ($this->objFedexShipment->ShippingAccountId) {
         $fed = new FedExDC($this->objFedexShipment->ShippingAccount->AccessId, $this->objFedexShipment->ShippingAccount->AccessCode);
     } else {
         // if not billing to a sender account, use the default fedex account from admin_setting for FedEx communication
         $objFedexAccount = ShippingAccount::Load(QApplication::$TracmorSettings->FedexAccountId);
         $fed = new FedExDC($objFedexAccount->AccessId, $objFedexAccount->AccessCode);
     }
     // create new FedExDC object
     //$fed = new FedExDC($this->objShipment->ShippingAccount->Value, QApplication::$TracmorSettings->FedexMeterNumber);
     // Populate an array with the necessary information
     $fdx_arr = array(1 => $this->objShipment->ShipmentNumber, 29 => $this->objShipment->TrackingNumber);
     // If ground service
     // if($this->objShipment->FedexServiceType->Value	== '92')
     if ($this->objFedexShipment->FedexServiceType->Value == '92') {
         $cancel_Ret = $fed->ground_cancel($fdx_arr);
     } else {
         $cancel_Ret = $fed->express_cancel($fdx_arr);
     }
     // If there is an error, display it and return false
     if ($error = $fed->getError()) {
         $this->btnCancelCompleteShipment->Warning = $error;
         return false;
     } else {
         return true;
     }
 }
예제 #4
0
 protected function btnSave_Click()
 {
     $intCompanyId = $this->lstCompany->SelectedValue;
     $objCompany = Company::Load($intCompanyId);
     $intAccountId = $this->lstFedexAccount->SelectedValue;
     $objAccount = ShippingAccount::Load($intAccountId);
     if ($objCompany && !$objCompany->Telephone) {
         $this->lstCompany->Warning = "The Shipping/Receiving company must have a valid telephone number.";
     } elseif ($objAccount && (!$objAccount->AccessId || !$objAccount->AccessCode)) {
         $this->lstFedexAccount->Warning = "The FedEx Account must have a valid account number and meter number.";
     } else {
         // Altered $TracmorSettings __set() method so that just setting a value will save it in the database.
         QApplication::$TracmorSettings->CompanyId = $intCompanyId;
         QApplication::$TracmorSettings->FedexAccountId = $intAccountId;
         QApplication::$TracmorSettings->FedexGatewayUri = $this->txtFedexGatewayUri->Text;
         QApplication::$TracmorSettings->PackingListTerms = $this->fckPackingListTerms->Text;
         QApplication::$TracmorSettings->AutodetectTrackingNumbers = $this->chkAutoDetectTrackingNumbers->Checked;
         QApplication::$TracmorSettings->ReceiveToLastLocation = $this->chkReceiveToLastLocation->Checked;
         // Show saved notification
         $this->pnlSaveNotification->Display = true;
     }
 }
 public function btnEdit_Click($strFormId, $strControlId, $strParameter)
 {
     $strParameterArray = explode(',', $strParameter);
     $objShippingAccount = ShippingAccount::Load($strParameterArray[0]);
     $objEditPanel = new ShippingAccountEditPanel($this, $this->strCloseEditPanelMethod, $objShippingAccount);
     $strMethodName = $this->strSetEditPanelMethod;
     $this->objForm->{$strMethodName}($objEditPanel);
 }