本文整理汇总了PHP中Shipment::LoadByTransactionId方法的典型用法代码示例。如果您正苦于以下问题:PHP Shipment::LoadByTransactionId方法的具体用法?PHP Shipment::LoadByTransactionId怎么用?PHP Shipment::LoadByTransactionId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shipment
的用法示例。
在下文中一共展示了Shipment::LoadByTransactionId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __toStringWithLink
public function __toStringWithLink()
{
// Shipment
if ($this->TransactionTypeId == 6) {
$objShipment = Shipment::LoadByTransactionId($this->TransactionId);
if ($objShipment) {
$strToReturn = sprintf('<a href="../shipping/shipment_edit.php?intShipmentId=%s">Ship</a>', $objShipment->ShipmentId);
} else {
$strToReturn = '';
}
} elseif ($this->TransactionTypeId == 7) {
$objReceipt = Receipt::LoadByTransactionId($this->TransactionId);
if ($objReceipt) {
$strToReturn = sprintf('<a href="../receiving/receipt_edit.php?intReceiptId=%s">Receipt</a>', $objReceipt->ReceiptId);
} else {
$strToReturn = '';
}
} else {
$strToReturn = sprintf('<a href="../common/transaction_edit.php?intTransactionId=%s">%s</a>', $this->TransactionId, $this->TransactionType->__toString());
}
return $strToReturn;
}
示例2: __get
/**
* 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 'TransactionId':
// Gets the value for intTransactionId (Read-Only PK)
// @return integer
return $this->intTransactionId;
case 'EntityQtypeId':
// Gets the value for intEntityQtypeId (Not Null)
// @return integer
return $this->intEntityQtypeId;
case 'TransactionTypeId':
// Gets the value for intTransactionTypeId (Not Null)
// @return integer
return $this->intTransactionTypeId;
case 'Note':
// Gets the value for strNote
// @return string
return $this->strNote;
case 'CreatedBy':
// Gets the value for intCreatedBy
// @return integer
return $this->intCreatedBy;
case 'CreationDate':
// Gets the value for dttCreationDate
// @return QDateTime
return $this->dttCreationDate;
case 'ModifiedBy':
// Gets the value for intModifiedBy
// @return integer
return $this->intModifiedBy;
case 'ModifiedDate':
// Gets the value for strModifiedDate (Read-Only Timestamp)
// @return string
return $this->strModifiedDate;
///////////////////
// Member Objects
///////////////////
///////////////////
// Member Objects
///////////////////
case 'TransactionType':
// Gets the value for the TransactionType object referenced by intTransactionTypeId (Not Null)
// @return TransactionType
try {
if (!$this->objTransactionType && !is_null($this->intTransactionTypeId)) {
$this->objTransactionType = TransactionType::Load($this->intTransactionTypeId);
}
return $this->objTransactionType;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case 'CreatedByObject':
// Gets the value for the UserAccount object referenced by intCreatedBy
// @return UserAccount
try {
if (!$this->objCreatedByObject && !is_null($this->intCreatedBy)) {
$this->objCreatedByObject = UserAccount::Load($this->intCreatedBy);
}
return $this->objCreatedByObject;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case 'ModifiedByObject':
// Gets the value for the UserAccount object referenced by intModifiedBy
// @return UserAccount
try {
if (!$this->objModifiedByObject && !is_null($this->intModifiedBy)) {
$this->objModifiedByObject = UserAccount::Load($this->intModifiedBy);
}
return $this->objModifiedByObject;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case 'Receipt':
// Gets the value for the Receipt object that uniquely references this Transaction
// by objReceipt (Unique)
// @return Receipt
try {
if ($this->objReceipt === false) {
// We've attempted early binding -- and the reverse reference object does not exist
return null;
}
if (!$this->objReceipt) {
$this->objReceipt = Receipt::LoadByTransactionId($this->intTransactionId);
}
return $this->objReceipt;
//.........这里部分代码省略.........
示例3: __toStringVerbWithLink
public function __toStringVerbWithLink()
{
if ($this->TransactionTypeId == 6) {
$objShipment = Shipment::LoadByTransactionId($this->TransactionId);
if ($objShipment) {
if ($objShipment->ShippedFlag) {
$verb = 'shipped';
} else {
$verb = 'scheduled shipment';
}
$strToReturn = sprintf('<a href="../shipping/shipment_edit.php?intShipmentId=%s">%s</a>', $objShipment->ShipmentId, $verb);
} else {
$strToReturn = '';
}
} elseif ($this->TransactionTypeId == 7) {
$objReceipt = Receipt::LoadByTransactionId($this->TransactionId);
if ($objReceipt) {
if ($objReceipt->ReceivedFlag) {
$verb = 'received';
} else {
$verb = 'scheduled receipt';
}
$strToReturn = sprintf('<a href="../receiving/receipt_edit.php?intReceiptId=%s">%s</a>', $objReceipt->ReceiptId, $verb);
} else {
$strToReturn = '';
}
} else {
$verb = strtolower($this->TransactionType->__toString());
if (str_word_count($verb) > 1) {
$verb = explode(" ", $verb);
$verb = $verb[0] . 'ed ' . $verb[1];
} else {
$verb = $verb . 'd';
}
$strToReturn = sprintf('<a href="../common/transaction_edit.php?intTransactionId=%s">%s</a>', $this->TransactionId, $verb);
}
return $strToReturn;
return '';
}
示例4: __toStringData
public function __toStringData()
{
switch ($this->Transaction->TransactionTypeId) {
case 1:
return sprintf('from %s to %s', $this->__toStringSourceLocation(), $this->__toStringDestinationLocation());
break;
case 2:
if ($this->Transaction->ModifiedByObject instanceof UserAccount) {
$user = $this->Transaction->ModifiedByObject->__toStringFullName();
} else {
$user = $this->Transaction->CreatedByObject->__toStringFullName();
}
return sprintf('from %s to %s', $user, $this->__toStringDestinationLocation());
break;
case 3:
if ($this->AssetTransactionCheckout) {
if ($this->AssetTransactionCheckout->ToContactId) {
$strToReturn = $this->AssetTransactionCheckout->ToContact->__toStringWithLink();
} else {
$strToReturn = $this->AssetTransactionCheckout->ToUser->__toStringFullName();
}
} else {
$strToReturn = $this->Transaction->CreatedByObject->__toStringFullName();
}
return sprintf('from %s to %s', $this->__toStringSourceLocation(), $strToReturn);
break;
case 6:
$this->Transaction->Shipment = Shipment::LoadByTransactionId($this->TransactionId);
return sprintf('from %s to %s', $this->__toStringSourceLocation(), $this->Transaction->ToStringCompanyWithLink());
break;
case 7:
$this->Transaction->Receipt = Receipt::LoadByTransactionId($this->TransactionId);
if ($this->Transaction->Receipt->ReceivedFlag) {
return sprintf('from %s to %s', $this->Transaction->ToStringCompanyWithLink(), $this->__toStringDestinationLocation());
} else {
return sprintf('from %s', $this->Transaction->ToStringCompanyWithLink());
}
break;
default:
return '';
break;
}
}
示例5: btnAddInventory_Click
public function btnAddInventory_Click($strFormId, $strControlId, $strParameter)
{
$blnError = false;
// Assign the values from the user submitted form input
$intNewInventoryLocationId = $this->lstSourceLocation->SelectedValue;
$intTransactionQuantity = $this->txtQuantity->Text;
if ($intNewInventoryLocationId) {
// Begin error checking
if ($this->objInventoryTransactionArray) {
foreach ($this->objInventoryTransactionArray as $objInventoryTransaction) {
if ($objInventoryTransaction && $objInventoryTransaction->InventoryLocation->InventoryLocationId == $intNewInventoryLocationId) {
$blnError = true;
$this->txtNewInventoryModelCode->Warning = "That Inventory has already been added.";
}
}
}
if (!$blnError) {
$objNewInventoryLocation = InventoryLocation::LoadLocations($intNewInventoryLocationId);
// This should not be possible because the list is populated with existing InventoryLocations
if (!$objNewInventoryLocation instanceof InventoryLocation) {
$this->txtNewInventoryModelCode->Warning = "That Inventory location does not exist.";
$blnError = true;
} elseif (!$intTransactionQuantity || !ctype_digit($intTransactionQuantity) || $intTransactionQuantity <= 0) {
$this->txtQuantity->Warning = "That is not a valid quantity.";
$blnError = true;
} elseif ($objNewInventoryLocation->Quantity < $intTransactionQuantity) {
$this->txtQuantity->Warning = "Quantity shipped cannot exceed quantity available.";
$blnError = true;
} elseif (!QApplication::AuthorizeEntityBoolean($objNewInventoryLocation->InventoryModel, 2)) {
$blnError = true;
$this->txtQuantity->Warning = "You do not have authorization to perform a transaction on this inventory model.";
} else {
$objExpansionMap[InventoryTransaction::ExpandTransaction] = true;
$objInventoryTransactionArray = InventoryTransaction::LoadArrayByInventoryLocationId($objNewInventoryLocation->InventoryLocationId, null, null, $objExpansionMap);
if ($objInventoryTransactionArray) {
$intQuantityScheduled = 0;
foreach ($objInventoryTransactionArray as $objInventoryTransaction) {
// If there is a pending shipment
if ($objInventoryTransaction->Transaction->TransactionTypeId == 6) {
/*
QCodo Beta3 is not generating a LoadArrayByTransactionId method anymore. Instead, it generates LoadByTransactionId.
That is actually better, so we will use that from now on.
$objShipmentArray = Shipment::LoadArrayByTransactionId($objInventoryTransaction->TransactionId);
if ($objShipmentArray) {
foreach ($objShipmentArray as $objShipment) {
if (!$objShipment->ShippedFlag) {
$intQuantityScheduled += $objInventoryTransaction->Quantity;
}
}
}*/
$objShipment = Shipment::LoadByTransactionId($objInventoryTransaction->TransactionId);
if ($objShipment && !$objShipment->ShippedFlag) {
$intQuantityScheduled += $objInventoryTransaction->Quantity;
}
}
}
if ($intTransactionQuantity > $objNewInventoryLocation->Quantity - $intQuantityScheduled) {
$blnError = true;
$this->txtNewInventoryModelCode->Warning = sprintf("That inventory has %s units already scheduled for shipment. Not enough available inventory.", $intQuantityScheduled);
}
}
}
$this->dtgInventoryTransact->Refresh();
}
} else {
$this->txtNewInventoryModelCode->Warning = "Please select a source location.";
$blnError = true;
}
if (!$blnError && $objNewInventoryLocation instanceof InventoryLocation) {
$objInventoryTransaction = new InventoryTransaction();
$objInventoryTransaction->InventoryLocationId = $objNewInventoryLocation->InventoryLocationId;
// $objInventoryTransaction->InventoryLocation = $objNewInventoryLocation;
$objInventoryTransaction->Quantity = $intTransactionQuantity;
$objInventoryTransaction->SourceLocationId = $objNewInventoryLocation->LocationId;
$this->objInventoryTransactionArray[] = $objInventoryTransaction;
$this->txtNewInventoryModelCode->Text = null;
$this->lstSourceLocation->SelectedIndex = 0;
$this->txtQuantity->Text = null;
$this->lstSourceLocation->Enabled = false;
$this->txtQuantity->Enabled = false;
$this->blnModifyInventory = true;
}
}