コード例 #1
0
    /**
     * Load all TransactionTypes
     * @param string $strOrderBy
     * @param string $strLimit
     * @param array $objExpansionMap map of referenced columns to be immediately expanded via early-binding
     * @return TransactionType[]
     */
    public static function LoadArrayByAssetFlag($blnAssetFlag, $strOrderBy = null, $strLimit = null, $objExpansionMap = null)
    {
        // Call to ArrayQueryHelper to Get Database Object and Get SQL Clauses
        TransactionType::ArrayQueryHelper($strOrderBy, $strLimit, $strLimitPrefix, $strLimitSuffix, $strExpandSelect, $strExpandFrom, $objExpansionMap, $objDatabase);
        $blnAssetFlag = $objDatabase->SqlVariable($blnAssetFlag, true);
        // Setup the SQL Query
        $strQuery = sprintf('
				SELECT
				%s
					`transaction_type`.`transaction_type_id` AS `transaction_type_id`,
					`transaction_type`.`short_description` AS `short_description`,
					`transaction_type`.`asset_flag` AS `asset_flag`,
					`transaction_type`.`inventory_flag` AS `inventory_flag`
					%s
				FROM
					`transaction_type` AS `transaction_type`
					%s
				WHERE
					`asset_flag` %s
				%s
				%s', $strLimitPrefix, $strExpandSelect, $strExpandFrom, $blnAssetFlag, $strOrderBy, $strLimitSuffix);
        // Perform the Query and Instantiate the Result
        $objDbResult = $objDatabase->Query($strQuery);
        return TransactionType::InstantiateDbResult($objDbResult);
    }
コード例 #2
0
 protected function SetupTransactionType()
 {
     // Lookup Object PK information from Query String (if applicable)
     // Set mode to Edit or New depending on what's found
     $intTransactionTypeId = QApplication::QueryString('intTransactionTypeId');
     if ($intTransactionTypeId) {
         $this->objTransactionType = TransactionType::Load($intTransactionTypeId);
         if (!$this->objTransactionType) {
             throw new Exception('Could not find a TransactionType object with PK arguments: ' . $intTransactionTypeId);
         }
         $this->strTitleVerb = QApplication::Translate('Edit');
         $this->blnEditMode = true;
     } else {
         $this->objTransactionType = new TransactionType();
         $this->strTitleVerb = QApplication::Translate('Create');
         $this->blnEditMode = false;
     }
 }
コード例 #3
0
 protected function dtgTransactionType_Bind()
 {
     // Because we want to enable pagination AND sorting, we need to setup the $objClauses array to send to LoadAll()
     // Remember!  We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below
     $this->dtgTransactionType->TotalItemCount = TransactionType::CountAll();
     // Setup the $objClauses Array
     $objClauses = array();
     // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
     // the OrderByClause to the $objClauses array
     if ($objClause = $this->dtgTransactionType->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->dtgTransactionType->LimitClause) {
         array_push($objClauses, $objClause);
     }
     // Set the DataSource to be the array of all TransactionType objects, given the clauses above
     $this->dtgTransactionType->DataSource = TransactionType::LoadAll($objClauses);
 }
コード例 #4
0
 /**
  * Main utility method to aid with data binding.  It is used by the default BindAllRows() databinder but
  * could and should be used by any custom databind methods that would be used for instances of this
  * MetaDataGrid, by simply passing in a custom QQCondition and/or QQClause. 
  *
  * If a paginator is set on this DataBinder, it will use it.  If not, then no pagination will be used.
  * It will also perform any sorting (if applicable).
  *
  * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself
  * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query		 
  * @return void
  */
 public function MetaDataBinder(QQCondition $objCondition = null, $objOptionalClauses = null)
 {
     // Setup input parameters to default values if none passed in
     if (!$objCondition) {
         $objCondition = QQ::All();
     }
     $objClauses = $objOptionalClauses ? $objOptionalClauses : array();
     // We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below
     if ($this->Paginator) {
         $this->TotalItemCount = TransactionType::QueryCount($objCondition, $objClauses);
     }
     // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
     // the OrderByClause to the $objClauses array
     if ($objClause = $this->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->LimitClause) {
         array_push($objClauses, $objClause);
     }
     // Set the DataSource to be a Query result from TransactionType, given the clauses above
     $this->DataSource = TransactionType::QueryArray($objCondition, $objClauses);
 }
コード例 #5
0
 public function actionAddbuild()
 {
     if (isset($_POST['goods_id'])) {
         $components = GoodsBuild::model()->findAllByAttributes(array('goods_id' => $_POST['goods_id']));
         $type = TransactionType::model()->findByPk(1);
         $arModels = array();
         foreach ($components as $model) {
             $arModels[] = array('component_id' => $model->component_id, 'component_name' => $model->component->component_name, 'warehouse_from' => $model->warehouse->warehouse_from, 'warehouse_to' => $model->warehouse->warehouse_to, 'component_qty' => $model->component_qty, 'type' => $type->type);
         }
         echo CJSON::encode($arModels);
     }
 }
コード例 #6
0
ファイル: DomainHRM.php プロジェクト: xander-mbaka/momentum
 function __construct($ledgerId, $employeeId, $type)
 {
     parent::__construct("Employee Benefit - " . $type);
     $this->drAccounts[] = Account::GetAccountByNo($employeeId, 'employees', 'PAYROLL');
     $this->drRatios[] = 1;
     $this->crAccounts[] = Account::GetLedger($ledgerId);
     $this->crRatios[] = 1;
 }
コード例 #7
0
 /**
  * Static Helper Method to Create using PK arguments
  * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
  * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
  * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
  * edit, or if we are also allowed to create a new one, etc.
  * 
  * @param mixed $objParentObject QForm or QPanel which will be using this TransactionTypeMetaControl
  * @param integer $intTransactionTypeId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing TransactionType object creation - defaults to CreateOrEdit
  * @return TransactionTypeMetaControl
  */
 public static function Create($objParentObject, $intTransactionTypeId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intTransactionTypeId)) {
         $objTransactionType = TransactionType::Load($intTransactionTypeId);
         // TransactionType was found -- return it!
         if ($objTransactionType) {
             return new TransactionTypeMetaControl($objParentObject, $objTransactionType);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a TransactionType object with PK arguments: ' . $intTransactionTypeId);
             }
         }
         // If EditOnly is specified, throw an exception
     } else {
         if ($intCreateType == QMetaControlCreateType::EditOnly) {
             throw new QCallerException('No PK arguments specified');
         }
     }
     // If we are here, then we need to create a new record
     return new TransactionTypeMetaControl($objParentObject, new TransactionType());
 }
コード例 #8
0
 /**
  * Internally called method to assist with early binding of objects
  * on load methods.  Can only early-bind references that this class owns in the database.
  * @param string $strParentAlias the alias of the parent (if any)
  * @param string $strAlias the alias of this object
  * @param array $objExpansionMap map of referenced columns to be immediately expanded via early-binding
  * @param QueryExpansion an already instantiated QueryExpansion object (used as a utility object to assist with object expansion)
  */
 public static function ExpandQuery($strParentAlias, $strAlias, $objExpansionMap, QQueryExpansion $objQueryExpansion)
 {
     if ($strAlias) {
         $objQueryExpansion->AddFromItem(sprintf('LEFT JOIN `role_transaction_type_authorization` AS `%s__%s` ON `%s`.`%s` = `%s__%s`.`role_transaction_type_authorization_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`role_transaction_type_authorization_id` AS `%s__%s__role_transaction_type_authorization_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`role_id` AS `%s__%s__role_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`transaction_type_id` AS `%s__%s__transaction_type_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`authorization_level_id` AS `%s__%s__authorization_level_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`created_by` AS `%s__%s__created_by`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`creation_date` AS `%s__%s__creation_date`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`modified_by` AS `%s__%s__modified_by`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`modified_date` AS `%s__%s__modified_date`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $strParentAlias = $strParentAlias . '__' . $strAlias;
     }
     if (is_array($objExpansionMap)) {
         foreach ($objExpansionMap as $strKey => $objValue) {
             switch ($strKey) {
                 case 'role_id':
                     try {
                         Role::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
                         break;
                     } catch (QCallerException $objExc) {
                         $objExc->IncrementOffset();
                         throw $objExc;
                     }
                 case 'transaction_type_id':
                     try {
                         TransactionType::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
                         break;
                     } catch (QCallerException $objExc) {
                         $objExc->IncrementOffset();
                         throw $objExc;
                     }
                 case 'authorization_level_id':
                     try {
                         AuthorizationLevel::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
                         break;
                     } catch (QCallerException $objExc) {
                         $objExc->IncrementOffset();
                         throw $objExc;
                     }
                 case 'created_by':
                     try {
                         UserAccount::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
                         break;
                     } catch (QCallerException $objExc) {
                         $objExc->IncrementOffset();
                         throw $objExc;
                     }
                 case 'modified_by':
                     try {
                         UserAccount::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
                         break;
                     } catch (QCallerException $objExc) {
                         $objExc->IncrementOffset();
                         throw $objExc;
                     }
                 default:
                     throw new QCallerException(sprintf('Unknown Object to Expand in %s: %s', $strParentAlias, $strKey));
             }
         }
     }
 }
コード例 #9
0
 public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects)
 {
     if ($objObject->objTransactionType) {
         $objObject->objTransactionType = TransactionType::GetSoapObjectFromObject($objObject->objTransactionType, false);
     } else {
         if (!$blnBindRelatedObjects) {
             $objObject->intTransactionTypeId = null;
         }
     }
     if ($objObject->objCreatedByObject) {
         $objObject->objCreatedByObject = UserAccount::GetSoapObjectFromObject($objObject->objCreatedByObject, false);
     } else {
         if (!$blnBindRelatedObjects) {
             $objObject->intCreatedBy = null;
         }
     }
     if ($objObject->dttCreationDate) {
         $objObject->dttCreationDate = $objObject->dttCreationDate->__toString(QDateTime::FormatSoap);
     }
     if ($objObject->objModifiedByObject) {
         $objObject->objModifiedByObject = UserAccount::GetSoapObjectFromObject($objObject->objModifiedByObject, false);
     } else {
         if (!$blnBindRelatedObjects) {
             $objObject->intModifiedBy = null;
         }
     }
     return $objObject;
 }
 /**
  * Refresh this MetaControl with Data from the local RoleTransactionTypeAuthorization object.
  * @param boolean $blnReload reload RoleTransactionTypeAuthorization from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objRoleTransactionTypeAuthorization->Reload();
     }
     if ($this->lblRoleTransactionTypeAuthorizationId) {
         if ($this->blnEditMode) {
             $this->lblRoleTransactionTypeAuthorizationId->Text = $this->objRoleTransactionTypeAuthorization->RoleTransactionTypeAuthorizationId;
         }
     }
     if ($this->lstRole) {
         $this->lstRole->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstRole->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objRoleArray = Role::LoadAll();
         if ($objRoleArray) {
             foreach ($objRoleArray as $objRole) {
                 $objListItem = new QListItem($objRole->__toString(), $objRole->RoleId);
                 if ($this->objRoleTransactionTypeAuthorization->Role && $this->objRoleTransactionTypeAuthorization->Role->RoleId == $objRole->RoleId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstRole->AddItem($objListItem);
             }
         }
     }
     if ($this->lblRoleId) {
         $this->lblRoleId->Text = $this->objRoleTransactionTypeAuthorization->Role ? $this->objRoleTransactionTypeAuthorization->Role->__toString() : null;
     }
     if ($this->lstTransactionType) {
         $this->lstTransactionType->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstTransactionType->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objTransactionTypeArray = TransactionType::LoadAll();
         if ($objTransactionTypeArray) {
             foreach ($objTransactionTypeArray as $objTransactionType) {
                 $objListItem = new QListItem($objTransactionType->__toString(), $objTransactionType->TransactionTypeId);
                 if ($this->objRoleTransactionTypeAuthorization->TransactionType && $this->objRoleTransactionTypeAuthorization->TransactionType->TransactionTypeId == $objTransactionType->TransactionTypeId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstTransactionType->AddItem($objListItem);
             }
         }
     }
     if ($this->lblTransactionTypeId) {
         $this->lblTransactionTypeId->Text = $this->objRoleTransactionTypeAuthorization->TransactionType ? $this->objRoleTransactionTypeAuthorization->TransactionType->__toString() : null;
     }
     if ($this->lstAuthorizationLevel) {
         $this->lstAuthorizationLevel->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstAuthorizationLevel->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objAuthorizationLevelArray = AuthorizationLevel::LoadAll();
         if ($objAuthorizationLevelArray) {
             foreach ($objAuthorizationLevelArray as $objAuthorizationLevel) {
                 $objListItem = new QListItem($objAuthorizationLevel->__toString(), $objAuthorizationLevel->AuthorizationLevelId);
                 if ($this->objRoleTransactionTypeAuthorization->AuthorizationLevel && $this->objRoleTransactionTypeAuthorization->AuthorizationLevel->AuthorizationLevelId == $objAuthorizationLevel->AuthorizationLevelId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstAuthorizationLevel->AddItem($objListItem);
             }
         }
     }
     if ($this->lblAuthorizationLevelId) {
         $this->lblAuthorizationLevelId->Text = $this->objRoleTransactionTypeAuthorization->AuthorizationLevel ? $this->objRoleTransactionTypeAuthorization->AuthorizationLevel->__toString() : null;
     }
     if ($this->lstCreatedByObject) {
         $this->lstCreatedByObject->RemoveAllItems();
         $this->lstCreatedByObject->AddItem(QApplication::Translate('- Select One -'), null);
         $objCreatedByObjectArray = UserAccount::LoadAll();
         if ($objCreatedByObjectArray) {
             foreach ($objCreatedByObjectArray as $objCreatedByObject) {
                 $objListItem = new QListItem($objCreatedByObject->__toString(), $objCreatedByObject->UserAccountId);
                 if ($this->objRoleTransactionTypeAuthorization->CreatedByObject && $this->objRoleTransactionTypeAuthorization->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstCreatedByObject->AddItem($objListItem);
             }
         }
     }
     if ($this->lblCreatedBy) {
         $this->lblCreatedBy->Text = $this->objRoleTransactionTypeAuthorization->CreatedByObject ? $this->objRoleTransactionTypeAuthorization->CreatedByObject->__toString() : null;
     }
     if ($this->calCreationDate) {
         $this->calCreationDate->DateTime = $this->objRoleTransactionTypeAuthorization->CreationDate;
     }
     if ($this->lblCreationDate) {
         $this->lblCreationDate->Text = sprintf($this->objRoleTransactionTypeAuthorization->CreationDate) ? $this->objRoleTransactionTypeAuthorization->__toString($this->strCreationDateDateTimeFormat) : null;
     }
     if ($this->lstModifiedByObject) {
         $this->lstModifiedByObject->RemoveAllItems();
         $this->lstModifiedByObject->AddItem(QApplication::Translate('- Select One -'), null);
         $objModifiedByObjectArray = UserAccount::LoadAll();
         if ($objModifiedByObjectArray) {
             foreach ($objModifiedByObjectArray as $objModifiedByObject) {
                 $objListItem = new QListItem($objModifiedByObject->__toString(), $objModifiedByObject->UserAccountId);
                 if ($this->objRoleTransactionTypeAuthorization->ModifiedByObject && $this->objRoleTransactionTypeAuthorization->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstModifiedByObject->AddItem($objListItem);
             }
         }
     }
     if ($this->lblModifiedBy) {
         $this->lblModifiedBy->Text = $this->objRoleTransactionTypeAuthorization->ModifiedByObject ? $this->objRoleTransactionTypeAuthorization->ModifiedByObject->__toString() : null;
     }
     if ($this->lblModifiedDate) {
         if ($this->blnEditMode) {
             $this->lblModifiedDate->Text = $this->objRoleTransactionTypeAuthorization->ModifiedDate;
         }
     }
 }
コード例 #11
0
ファイル: journal.php プロジェクト: hkhateb/linet3
<?php

/***********************************************************************************
 * The contents of this file are subject to the Mozilla Public License Version 2.0
 * ("License"); You may not use this file except in compliance with the Mozilla Public License Version 2.0
 * The Original Code is:  Linet 3.0 Open Source
 * The Initial Developer of the Original Code is Adam Ben Hur.
 * All portions are Copyright (C) Adam Ben Hur.
 * All Rights Reserved.
 ************************************************************************************/
$dateisOn = $this->widget('zii.widgets.jui.CJuiDatePicker', array('name' => 'Transactions[from_date]', 'language' => substr(Yii::app()->language, 0, 2), 'value' => $model->from_date, 'options' => array('showAnim' => 'fold', 'dateFormat' => Yii::app()->locale->getDateFormat('short'), 'changeMonth' => 'true', 'changeYear' => 'true', 'constrainInput' => 'false'), 'htmlOptions' => array('placeholder' => Yii::t('app', 'From Date'))), true) . $this->widget('zii.widgets.jui.CJuiDatePicker', array('name' => 'Transactions[to_date]', 'language' => substr(Yii::app()->language, 0, 2), 'value' => $model->to_date, 'options' => array('showAnim' => 'fold', 'dateFormat' => Yii::app()->locale->getDateFormat('short'), 'changeMonth' => 'true', 'changeYear' => 'true', 'constrainInput' => 'false'), 'htmlOptions' => array('placeholder' => Yii::t('app', 'To Date'))), true);
$this->beginWidget('MiniForm', array('header' => Yii::t('app', "Transactions")));
$yiidbdatetime = Yii::app()->locale->getDateFormat('yiidbdatetime');
$phpdatetime = Yii::app()->locale->getDateFormat('phpdatetime');
$this->widget('EExcelView', array('id' => 'transactions-grid', 'dataProvider' => $model->search(), 'ajaxUpdate' => true, 'ajaxType' => 'POST', 'afterAjaxUpdate' => "function() {\n\t\t\t\t\t\tjQuery('#Transactions_from_date').datepicker(jQuery.extend({showMonthAfterYear:false}, jQuery.datepicker.regional['" . substr(Yii::app()->language, 0, 2) . "'], {'showAnim':'fold','dateFormat':'" . Yii::app()->locale->getDateFormat('short') . "','changeMonth':'true','showButtonPanel':'true','changeYear':'true','constrainInput':'false'}));\n\t\t\t\t\t\tjQuery('#Transactions_to_date').datepicker(jQuery.extend({showMonthAfterYear:false}, jQuery.datepicker.regional['" . substr(Yii::app()->language, 0, 2) . "'], {'showAnim':'fold','dateFormat':'" . Yii::app()->locale->getDateFormat('short') . "','changeMonth':'true','showButtonPanel':'true','changeYear':'true','constrainInput':'false'}));\n                                }", 'filter' => $model, 'columns' => array(array('name' => 'num', 'htmlOptions' => array('style' => 'width:8%;')), array('name' => 'type', 'filter' => CHtml::listData(TransactionType::model()->findAll(), 'id', 'name'), 'value' => 'Yii::t("app",$data->Type->name)', 'htmlOptions' => array('style' => 'width:15%;')), array('name' => 'account_id', 'filter' => CHtml::listData(Accounts::model()->findAll(), 'id', 'name'), 'value' => 'CHtml::link(CHtml::encode(isset($data->Account)?$data->Account->name:$data->account_id),Yii::app()->createAbsoluteUrl("/accounts/transaction/".$data->account_id))', 'type' => 'raw', 'htmlOptions' => array('style' => 'width:15%;')), array('name' => 'refnum1', 'value' => '$data->refnumDocsLink()', 'filter' => '', 'type' => 'raw'), array('name' => 'refnum2', 'value' => 'CHtml::encode($data->refnum2)', 'type' => 'raw'), 'details', array('name' => 'valuedate', 'filter' => $dateisOn, 'value' => 'date("' . $phpdatetime . '",CDateTimeParser::parse($data->valuedate,"' . $yiidbdatetime . '"))', 'htmlOptions' => array('style' => 'width:8%;')), array('name' => 'reg_date', 'filter' => '', 'value' => 'date("' . $phpdatetime . '",CDateTimeParser::parse($data->reg_date,"' . $yiidbdatetime . '"))', 'htmlOptions' => array('style' => 'width:8%;')), array('header' => Yii::t('app', 'Debit'), 'cssClassExpression' => "'number'", 'name' => 'sum', 'filter' => '', 'value' => '($data->sum<0)?$data->sum:""'), array('header' => Yii::t('app', 'Credit'), 'cssClassExpression' => "'number'", 'name' => 'sum', 'filter' => '', 'value' => '($data->sum>0)?$data->sum:""'))));
?>
<div class="row form-actions">
    <?php 
$this->widget('bootstrap.widgets.TbButton', array('type' => 'primary', 'buttonType' => 'ajaxButton', "icon" => "glyphicon glyphicon-print", 'label' => Yii::t('app', "Print")));
?>
    

</div>
<?php 
$this->endWidget();
//miniform
?>

<script type="text/javascript">
    jQuery(document).ready(function() {
        $("#yt0").click(function(e) {
コード例 #12
0
ファイル: Transaction.php プロジェクト: junjinZ/wealthbot
 /**
  * Is transaction type is buy
  *
  * @return bool
  */
 public function isTypeBuy()
 {
     return $this->transactionType->getName() === self::TYPE_BUY;
 }
コード例 #13
0
ファイル: DomainCRM.php プロジェクト: xander-mbaka/momentum
 function __construct($ledgerId, $clientId)
 {
     parent::__construct("Sales Receipt");
     $this->drAccounts[] = Account::GetLedger($ledgerId);
     $this->drRatios[] = 1;
     $this->crAccounts[] = Account::GetAccountByNo($clientId, 'clients', 'Debtors');
     $this->crRatios[] = 1;
     //this info should originate from the database, insert ignore protocol included
     //$this->code = self::GetCode('PayPal');
     //parent::__construct();
 }
コード例 #14
0
 /**
  * Refresh this MetaControl with Data from the local Shortcut object.
  * @param boolean $blnReload reload Shortcut from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objShortcut->Reload();
     }
     if ($this->lblShortcutId) {
         if ($this->blnEditMode) {
             $this->lblShortcutId->Text = $this->objShortcut->ShortcutId;
         }
     }
     if ($this->lstModule) {
         $this->lstModule->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstModule->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objModuleArray = Module::LoadAll();
         if ($objModuleArray) {
             foreach ($objModuleArray as $objModule) {
                 $objListItem = new QListItem($objModule->__toString(), $objModule->ModuleId);
                 if ($this->objShortcut->Module && $this->objShortcut->Module->ModuleId == $objModule->ModuleId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstModule->AddItem($objListItem);
             }
         }
     }
     if ($this->lblModuleId) {
         $this->lblModuleId->Text = $this->objShortcut->Module ? $this->objShortcut->Module->__toString() : null;
     }
     if ($this->lstAuthorization) {
         $this->lstAuthorization->RemoveAllItems();
         $this->lstAuthorization->AddItem(QApplication::Translate('- Select One -'), null);
         $objAuthorizationArray = Authorization::LoadAll();
         if ($objAuthorizationArray) {
             foreach ($objAuthorizationArray as $objAuthorization) {
                 $objListItem = new QListItem($objAuthorization->__toString(), $objAuthorization->AuthorizationId);
                 if ($this->objShortcut->Authorization && $this->objShortcut->Authorization->AuthorizationId == $objAuthorization->AuthorizationId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstAuthorization->AddItem($objListItem);
             }
         }
     }
     if ($this->lblAuthorizationId) {
         $this->lblAuthorizationId->Text = $this->objShortcut->Authorization ? $this->objShortcut->Authorization->__toString() : null;
     }
     if ($this->lstTransactionType) {
         $this->lstTransactionType->RemoveAllItems();
         $this->lstTransactionType->AddItem(QApplication::Translate('- Select One -'), null);
         $objTransactionTypeArray = TransactionType::LoadAll();
         if ($objTransactionTypeArray) {
             foreach ($objTransactionTypeArray as $objTransactionType) {
                 $objListItem = new QListItem($objTransactionType->__toString(), $objTransactionType->TransactionTypeId);
                 if ($this->objShortcut->TransactionType && $this->objShortcut->TransactionType->TransactionTypeId == $objTransactionType->TransactionTypeId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstTransactionType->AddItem($objListItem);
             }
         }
     }
     if ($this->lblTransactionTypeId) {
         $this->lblTransactionTypeId->Text = $this->objShortcut->TransactionType ? $this->objShortcut->TransactionType->__toString() : null;
     }
     if ($this->txtShortDescription) {
         $this->txtShortDescription->Text = $this->objShortcut->ShortDescription;
     }
     if ($this->lblShortDescription) {
         $this->lblShortDescription->Text = $this->objShortcut->ShortDescription;
     }
     if ($this->txtLink) {
         $this->txtLink->Text = $this->objShortcut->Link;
     }
     if ($this->lblLink) {
         $this->lblLink->Text = $this->objShortcut->Link;
     }
     if ($this->txtImagePath) {
         $this->txtImagePath->Text = $this->objShortcut->ImagePath;
     }
     if ($this->lblImagePath) {
         $this->lblImagePath->Text = $this->objShortcut->ImagePath;
     }
     if ($this->lstEntityQtype) {
         $this->lstEntityQtype->SelectedValue = $this->objShortcut->EntityQtypeId;
     }
     if ($this->lblEntityQtypeId) {
         $this->lblEntityQtypeId->Text = $this->objShortcut->EntityQtypeId ? EntityQtype::$NameArray[$this->objShortcut->EntityQtypeId] : null;
     }
     if ($this->chkCreateFlag) {
         $this->chkCreateFlag->Checked = $this->objShortcut->CreateFlag;
     }
     if ($this->lblCreateFlag) {
         $this->lblCreateFlag->Text = $this->objShortcut->CreateFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
 }
コード例 #15
0
 public function dtgTransactionType_Bind()
 {
     // Get Total Count b/c of Pagination
     $this->dtgTransactionType->TotalItemCount = TransactionType::CountAll();
     $objClauses = array();
     if ($objClause = $this->dtgTransactionType->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     if ($objClause = $this->dtgTransactionType->LimitClause) {
         array_push($objClauses, $objClause);
     }
     $this->dtgTransactionType->DataSource = TransactionType::LoadAll($objClauses);
 }
コード例 #16
0
 /**
  * Internally called method to assist with early binding of objects
  * on load methods.  Can only early-bind references that this class owns in the database.
  * @param string $strParentAlias the alias of the parent (if any)
  * @param string $strAlias the alias of this object
  * @param array $objExpansionMap map of referenced columns to be immediately expanded via early-binding
  * @param QueryExpansion an already instantiated QueryExpansion object (used as a utility object to assist with object expansion)
  */
 public static function ExpandQuery($strParentAlias, $strAlias, $objExpansionMap, QQueryExpansion $objQueryExpansion)
 {
     if ($strAlias) {
         $objQueryExpansion->AddFromItem(sprintf('LEFT JOIN `shortcut` AS `%s__%s` ON `%s`.`%s` = `%s__%s`.`shortcut_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`shortcut_id` AS `%s__%s__shortcut_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`module_id` AS `%s__%s__module_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`authorization_id` AS `%s__%s__authorization_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`transaction_type_id` AS `%s__%s__transaction_type_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`short_description` AS `%s__%s__short_description`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`link` AS `%s__%s__link`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`image_path` AS `%s__%s__image_path`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`entity_qtype_id` AS `%s__%s__entity_qtype_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`create_flag` AS `%s__%s__create_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
         $strParentAlias = $strParentAlias . '__' . $strAlias;
     }
     if (is_array($objExpansionMap)) {
         foreach ($objExpansionMap as $strKey => $objValue) {
             switch ($strKey) {
                 case 'module_id':
                     try {
                         Module::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
                         break;
                     } catch (QCallerException $objExc) {
                         $objExc->IncrementOffset();
                         throw $objExc;
                     }
                 case 'authorization_id':
                     try {
                         Authorization::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
                         break;
                     } catch (QCallerException $objExc) {
                         $objExc->IncrementOffset();
                         throw $objExc;
                     }
                 case 'transaction_type_id':
                     try {
                         TransactionType::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
                         break;
                     } catch (QCallerException $objExc) {
                         $objExc->IncrementOffset();
                         throw $objExc;
                     }
                 default:
                     throw new QCallerException(sprintf('Unknown Object to Expand in %s: %s', $strParentAlias, $strKey));
             }
         }
     }
 }
コード例 #17
0
 function __construct($entries, $amount, $classifier)
 {
     parent::__construct("Direct Posting - " . $classifier);
     foreach ($entries as $entry) {
         if ($entry['effect'] == "dr") {
             $this->drAccounts[] = Account::GetLedger($entry['lid']);
             $this->drRatios[] = floatval(floatval($entry['amount']) / floatval($amount));
         } elseif ($entry['effect'] == "cr") {
             $this->crAccounts[] = Account::GetLedger($entry['lid']);
             $this->crRatios[] = floatval(floatval($entry['amount']) / floatval($amount));
         }
     }
 }
コード例 #18
0
 function __construct($name)
 {
     parent::__construct($name);
 }
コード例 #19
0
ファイル: Inventory.php プロジェクト: xander-mbaka/momentum
 function __construct()
 {
     parent::__construct();
 }
コード例 #20
0
 protected function lstTransactionType_Create()
 {
     $this->lstTransactionType = new QListBox($this);
     $this->lstTransactionType->Name = QApplication::Translate('Transaction Type');
     $this->lstTransactionType->Required = true;
     if (!$this->blnEditMode) {
         $this->lstTransactionType->AddItem(QApplication::Translate('- Select One -'), null);
     }
     $objTransactionTypeArray = TransactionType::LoadAll();
     if ($objTransactionTypeArray) {
         foreach ($objTransactionTypeArray as $objTransactionType) {
             $objListItem = new QListItem($objTransactionType->__toString(), $objTransactionType->TransactionTypeId);
             if ($this->objTransaction->TransactionType && $this->objTransaction->TransactionType->TransactionTypeId == $objTransactionType->TransactionTypeId) {
                 $objListItem->Selected = true;
             }
             $this->lstTransactionType->AddItem($objListItem);
         }
     }
 }
コード例 #21
0
 /**
  * Refresh this MetaControl with Data from the local Transaction object.
  * @param boolean $blnReload reload Transaction from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objTransaction->Reload();
     }
     if ($this->lblTransactionId) {
         if ($this->blnEditMode) {
             $this->lblTransactionId->Text = $this->objTransaction->TransactionId;
         }
     }
     if ($this->lstEntityQtype) {
         $this->lstEntityQtype->SelectedValue = $this->objTransaction->EntityQtypeId;
     }
     if ($this->lblEntityQtypeId) {
         $this->lblEntityQtypeId->Text = $this->objTransaction->EntityQtypeId ? EntityQtype::$NameArray[$this->objTransaction->EntityQtypeId] : null;
     }
     if ($this->lstTransactionType) {
         $this->lstTransactionType->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstTransactionType->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objTransactionTypeArray = TransactionType::LoadAll();
         if ($objTransactionTypeArray) {
             foreach ($objTransactionTypeArray as $objTransactionType) {
                 $objListItem = new QListItem($objTransactionType->__toString(), $objTransactionType->TransactionTypeId);
                 if ($this->objTransaction->TransactionType && $this->objTransaction->TransactionType->TransactionTypeId == $objTransactionType->TransactionTypeId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstTransactionType->AddItem($objListItem);
             }
         }
     }
     if ($this->lblTransactionTypeId) {
         $this->lblTransactionTypeId->Text = $this->objTransaction->TransactionType ? $this->objTransaction->TransactionType->__toString() : null;
     }
     if ($this->txtNote) {
         $this->txtNote->Text = $this->objTransaction->Note;
     }
     if ($this->lblNote) {
         $this->lblNote->Text = $this->objTransaction->Note;
     }
     if ($this->lstCreatedByObject) {
         $this->lstCreatedByObject->RemoveAllItems();
         $this->lstCreatedByObject->AddItem(QApplication::Translate('- Select One -'), null);
         $objCreatedByObjectArray = UserAccount::LoadAll();
         if ($objCreatedByObjectArray) {
             foreach ($objCreatedByObjectArray as $objCreatedByObject) {
                 $objListItem = new QListItem($objCreatedByObject->__toString(), $objCreatedByObject->UserAccountId);
                 if ($this->objTransaction->CreatedByObject && $this->objTransaction->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstCreatedByObject->AddItem($objListItem);
             }
         }
     }
     if ($this->lblCreatedBy) {
         $this->lblCreatedBy->Text = $this->objTransaction->CreatedByObject ? $this->objTransaction->CreatedByObject->__toString() : null;
     }
     if ($this->calCreationDate) {
         $this->calCreationDate->DateTime = $this->objTransaction->CreationDate;
     }
     if ($this->lblCreationDate) {
         $this->lblCreationDate->Text = sprintf($this->objTransaction->CreationDate) ? $this->objTransaction->__toString($this->strCreationDateDateTimeFormat) : null;
     }
     if ($this->lstModifiedByObject) {
         $this->lstModifiedByObject->RemoveAllItems();
         $this->lstModifiedByObject->AddItem(QApplication::Translate('- Select One -'), null);
         $objModifiedByObjectArray = UserAccount::LoadAll();
         if ($objModifiedByObjectArray) {
             foreach ($objModifiedByObjectArray as $objModifiedByObject) {
                 $objListItem = new QListItem($objModifiedByObject->__toString(), $objModifiedByObject->UserAccountId);
                 if ($this->objTransaction->ModifiedByObject && $this->objTransaction->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstModifiedByObject->AddItem($objListItem);
             }
         }
     }
     if ($this->lblModifiedBy) {
         $this->lblModifiedBy->Text = $this->objTransaction->ModifiedByObject ? $this->objTransaction->ModifiedByObject->__toString() : null;
     }
     if ($this->lblModifiedDate) {
         if ($this->blnEditMode) {
             $this->lblModifiedDate->Text = $this->objTransaction->ModifiedDate;
         }
     }
     if ($this->lstReceipt) {
         $this->lstReceipt->RemoveAllItems();
         $this->lstReceipt->AddItem(QApplication::Translate('- Select One -'), null);
         $objReceiptArray = Receipt::LoadAll();
         if ($objReceiptArray) {
             foreach ($objReceiptArray as $objReceipt) {
                 $objListItem = new QListItem($objReceipt->__toString(), $objReceipt->ReceiptId);
                 if ($objReceipt->TransactionId == $this->objTransaction->TransactionId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstReceipt->AddItem($objListItem);
             }
         }
         // Because Receipt's Receipt is not null, if a value is already selected, it cannot be changed.
         if ($this->lstReceipt->SelectedValue) {
             $this->lstReceipt->Enabled = false;
         } else {
             $this->lstReceipt->Enabled = true;
         }
     }
     if ($this->lblReceipt) {
         $this->lblReceipt->Text = $this->objTransaction->Receipt ? $this->objTransaction->Receipt->__toString() : null;
     }
     if ($this->lstShipment) {
         $this->lstShipment->RemoveAllItems();
         $this->lstShipment->AddItem(QApplication::Translate('- Select One -'), null);
         $objShipmentArray = Shipment::LoadAll();
         if ($objShipmentArray) {
             foreach ($objShipmentArray as $objShipment) {
                 $objListItem = new QListItem($objShipment->__toString(), $objShipment->ShipmentId);
                 if ($objShipment->TransactionId == $this->objTransaction->TransactionId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstShipment->AddItem($objListItem);
             }
         }
         // Because Shipment's Shipment is not null, if a value is already selected, it cannot be changed.
         if ($this->lstShipment->SelectedValue) {
             $this->lstShipment->Enabled = false;
         } else {
             $this->lstShipment->Enabled = true;
         }
     }
     if ($this->lblShipment) {
         $this->lblShipment->Text = $this->objTransaction->Shipment ? $this->objTransaction->Shipment->__toString() : null;
     }
 }
コード例 #22
0
 public static function GetSoapArrayFromArray($objArray)
 {
     if (!$objArray) {
         return null;
     }
     $objArrayToReturn = array();
     foreach ($objArray as $objObject) {
         array_push($objArrayToReturn, TransactionType::GetSoapObjectFromObject($objObject, true));
     }
     return unserialize(serialize($objArrayToReturn));
 }
コード例 #23
0
ファイル: DomainSCM.php プロジェクト: xander-mbaka/momentum
 function __construct($ledgerId, $supplierId)
 {
     parent::__construct("Purchases Payment");
     $this->drAccounts[] = Account::GetAccountByNo($supplierId, 'suppliers', 'Creditors');
     $this->drRatios[] = 1;
     $this->crAccounts[] = Account::GetLedger($ledgerId);
     $this->crRatios[] = 1;
     //this info should originate from the database, insert ignore protocol included
     //$this->code = self::GetCode('PayPal');
     //parent::__construct();
 }
コード例 #24
0
<div class="form">

	<div class="row">	 
	<label>Transaction Type</label>
	<?php 
echo CHtml::dropDownList('transaction_type', '', CHtml::listData(TransactionType::model()->findAll(), 'id', 'type'), array('empty' => '-- select transcation type --'));
?>
	</div>
	<div class="row">
	<label>Component Name</label>
	<?php 
$this->widget('zii.widgets.jui.CJuiAutoComplete', array('model' => new Components(), 'attribute' => 'component_name', 'sourceUrl' => array('/transactions/componentstransaction/cekcomponents'), 'options' => array('minLength' => '1', 'search' => 'js:function(event, ui){
                        $(\'#hospital_id\').val(-1);
                       }', 'select' => 'js:function(event, ui){
                        	document.getElementById(\'keterangan\').innerHTML = \'Code : \'+ui.item.code;
                        	document.getElementById(\'component_id\').value = ui.item.id;
                        }'), 'htmlOptions' => array('style' => 'height:25px;width:200px;padding:0px 5px;', 'class' => 'mf'), 'htmlOptions' => array('style' => 'width:50%;')));
?>
		<input type="hidden" name="component_id" id="component_id">
		</div>
	
	<div class="row">
	<b id="keterangan">
	</b></div>	
	
	<div class="row">	 
		<label>From Warehouse</label>
		<?php 
echo CHtml::dropDownList('warehouse_from', '', CHtml::listData(Warehouse::model()->findAll(), 'id', 'name_warehouse'), array('empty' => '-- select warehouse --'));
?>
	</div>
コード例 #25
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = TransactionType::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }