public function actionClosingPeriodExecution()
 {
     uJournal::model()->updateAll(array('state_id' => 3, 'updated_date' => time(), 'updated_id' => Yii::app()->user->id), 'state_id !=4 AND yearmonth_periode = ' . Yii::app()->settings->get("System", "cCurrentPeriod"));
     $this->transferNewPeriod();
     $_nextPeriod = sParameter::cBeginDateAfter(Yii::app()->settings->get("System", "cCurrentPeriod"));
     Yii::app()->settings->set("System", "cCurrentPeriod", $_nextPeriod, $toDatabase = true);
 }
 public function loadModel($pk1, $pk2)
 {
     $model = sParameter::model()->find(array('condition' => 'type = "' . $pk1 . '" AND code = ' . $pk2));
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
 public function actionClosingPeriodExecution()
 {
     uJournal::model()->updateAll(array('state_id' => 3, 'updated_date' => time(), 'updated_by' => Yii::app()->user->id), 'state_id !=4 AND yearmonth_periode = ' . Yii::app()->settings->get("System", "cCurrentPeriod"));
     $_curPeriod = Yii::app()->settings->get("System", "cCurrentPeriod");
     $_nextPeriod = sParameter::cBeginDateAfter(Yii::app()->settings->get("System", "cCurrentPeriod"));
     $models = tBalanceSheet::model()->findAll('yearmonth_periode = ' . $_curPeriod);
     foreach ($models as $model) {
         if ($model->account->getTypeValue() == 1) {
             $sql = 'INSERT INTO t_balance_sheet (parent_id, yearmonth_periode, type_balance_id, remark, budget, beginning_balance,debit,credit,end_balance) VALUES (' . $model->parent_id . ',' . $_nextPeriod . ', 1, \'Automated posted\', 0,' . $model->end_balance . ',0,0,' . $model->end_balance . ')';
         } else {
             $sql = 'INSERT INTO t_balance_sheet (parent_id, yearmonth_periode, type_balance_id, remark, budget, beginning_balance,debit,credit,end_balance) VALUES (' . $model->parent_id . ',' . $_nextPeriod . ', 1, \'Automated posted\', 0,0,0,0,0)';
         }
         $command = Yii::app()->db->createCommand($sql);
         $command->execute();
         tBalanceSheet::model()->updateAll(array('type_balance_id' => 2), 'yearmonth_periode = ' . $_curPeriod);
     }
     $_nextPeriod = sParameter::cBeginDateAfter(Yii::app()->settings->get("System", "cCurrentPeriod"));
     Yii::app()->settings->set("System", "cCurrentPeriod", $_nextPeriod, $toDatabase = true);
     Yii::app()->user->setFlash('success', '<strong>Great!</strong> Closing Period has been successful...');
     $this->redirect(array('index'));
 }
예제 #4
0
<?php

$form = $this->beginWidget('BootActiveForm', array('id' => 't-account-form', 'type' => 'horizontal', 'enableAjaxValidation' => false));
?>

<?php 
echo $form->errorSummary($model);
?>

<?php 
echo $form->dropDownListRow($model, 'haschild_id', sParameter::items("cHasChild"), array('disabled' => !empty($model->hasJournal), 'hint' => 'Dropdown will disabled automatically when this account already has journal voucher on current period'));
echo $form->textFieldRow($model, 'account_no', array('class' => 'span3'));
echo $form->textFieldRow($model, 'account_name', array('class' => 'span3'));
echo $form->textAreaRow($model, 'short_description', array('class' => 'span5', 'rows' => 3));
//echo $form->dropDownListRow($model,'currency_id',sParameter::items("cCurrency","*inherited*"));
//echo $form->dropDownListRow($model,'state_id',sParameter::items("cStatus","*inherited*"));
?>

<?php 
$this->widget('ext.appendo.JAppendo', array('id' => 'repeateEnum', 'model' => $model, 'viewName' => '_accountProperties', 'labelDel' => 'Remove Row'));
?>

<div class="form-actions">
	<?php 
echo CHtml::htmlButton('<i class="icon-ok"></i>' . $model->isNewRecord ? 'Create' : 'Save', array('class' => 'btn', 'type' => 'submit'));
?>
</div>

<?php 
$this->endWidget();
?>
예제 #5
0
 public function system_reff()
 {
     $_state = null;
     if ($this->state_id != 1) {
         $_state = " (" . sParameter::item("cStatus", $this->state_id) . ")";
     }
     $_format = $this->system_ref . $_state;
     return $_format;
 }
<?php

$this->breadcrumbs = array('Parameter' => array('index'), 'Manage');
?>

<div class="page-header">
	<h1><?php 
echo CHtml::image(Yii::app()->request->baseUrl . '/images/icon/ms_dos_batch_file.png');
?>
	Data Parameter</h1>
</div>
<?php 
$this->widget('DropDownRedirect', array('data' => sParameter::items3("Any"), 'url' => $this->createUrl($this->route, array_merge($_GET, array('type' => '__value__'))), 'select' => isset($_GET['type']) ? $_GET['type'] : "(ALL)"));
?>

<?php 
//$this->widget('bootstrap.widgets.BootGridView', array(
$this->widget('ext.groupgridview.GroupGridView', array('extraRowColumns' => array('type'), 'id' => 'parameter-grid', 'dataProvider' => $model->search($type), 'itemsCssClass' => 'table table-striped table-bordered', 'template' => '{items}{pager}', 'columns' => array(array('class' => 'bootstrap.widgets.BootButtonColumn', 'template' => '{updated}{delete}', 'deleteButtonUrl' => 'Yii::app()->createUrl("/sParameter/delete",array("pk1"=>$data->type,"pk2"=>$data->code))', 'buttons' => array('updated' => array('label' => 'Update', 'url' => 'Yii::app()->createUrl("/sParameter/update",array("pk1"=>$data->type,"pk2"=>$data->code,"asDialog"=>1,"gridId"=>$this->grid->id))', 'click' => 'function(){$("#cru-frame").attr("src",$(this).attr("href")); $("#cru-dialog").dialog("open");  return false;}'))), 'code', 'name')));
?>

<hr />

<?php 
$this->widget('bootstrap.widgets.BootTabbable', array('type' => 'tabs', 'tabs' => array(array('label' => 'Existing Parameter', 'content' => $this->renderPartial("_formE", array("model" => $modelParameter), true), 'active' => true), array('label' => 'New Parameter', 'content' => $this->renderPartial("_form", array("model" => $modelParameter), true)))));
?>

<?php 
//--------------------- begin new code --------------------------
// add the (closed) dialog for the iframe
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'cru-dialog', 'options' => array('title' => 'Update Detail', 'autoOpen' => false, 'modal' => true, 'width' => '70%', 'height' => '550')));
?>
 function report($periode_date, $report_id)
 {
     $this->myheader($periode_date, $report_id);
     $w = array(130, 20);
     $model1 = tAccountMain::model()->with('account_list')->findAll('type_id= 1');
     $_labarugi = tAccount::labarugiDitahan($periode_date);
     $_s = 3;
     //Reset
     $_total = 0;
     $_subtotal = 0;
     $_grandtotal = 0;
     $_grandtotalA = 0;
     $_grandtotalP = 0;
     $_totalLast = 0;
     $_subtotalLast = 0;
     $_grandtotalLast = 0;
     $_grandtotalALast = 0;
     $_grandtotalPLast = 0;
     //Print/Preview Report
     foreach ($model1 as $mmm) {
         if ($mmm->id == 2) {
             //pasiva
             $_s = $_s + 3;
             $this->SetFont('Arial', 'B', 8);
             $this->Cell($w[0], 4, $mmm->name);
             $this->Cell($w[1], 4, '');
             $this->Ln();
         }
         foreach ($mmm->account_list as $mm) {
             $model2 = tAccount::model()->findByPk((int) $mm->parent_id);
             $this->SetFont('Arial', 'B', 8);
             if ($mmm->id == 2) {
                 $this->Cell(5, 4, '');
             }
             $this->Cell($w[0], 4, $model2->account_concat());
             $this->SetX($this->x0);
             $this->Cell($w[1], 4, '');
             $this->Ln();
             foreach ($model2->childs as $model) {
                 $this->SetFont('Arial', 'B', 8);
                 $this->Cell($_s, 4, '');
                 $this->Cell($w[0], 4, $model->account_concat());
                 $this->SetX($this->x0);
                 $this->Cell($w[1], 4, '');
                 $this->Ln();
                 if ($model->childs) {
                     foreach ($model->childs as $mod) {
                         if ($mod->childs) {
                             $this->SetFont('Arial', 'B', 8);
                         } else {
                             $this->SetFont('Arial', '', 8);
                         }
                         $this->Cell($_s + 3, 4, '');
                         $this->Cell($w[0], 4, $mod->account_concat());
                         $this->SetX($this->x0);
                         $_mod = $mod->balancesheet(array('condition' => 'yearmonth_periode =' . $periode_date));
                         $_periode_date_last = sParameter::cBeginDateBefore($periode_date);
                         $_modLast = $mod->balancesheet(array('condition' => 'yearmonth_periode =' . $_periode_date_last));
                         if (isset($_mod->end_balance)) {
                             $_balance = number_format($_mod->end_balance, 0, ',', '.');
                             $_mmodLast = isset($_modLast->end_balance) ? $_modLast->end_balance : 0;
                             $_balanceLast = number_format($_mmodLast, 0, ',', '.');
                             $_subtotal = $_subtotal + $_mod->end_balance;
                             $_grandtotal = $_grandtotal + $_mod->end_balance;
                             $_subtotalLast = $_subtotalLast + $_mmodLast;
                             $_grandtotalLast = $_grandtotalLast + $_mmodLast;
                         } else {
                             $_balance = 0;
                             $_balanceLast = 0;
                         }
                         if ($mod->childs) {
                             $this->Cell($w[1], 4, '', 0, 0, 'R');
                         } else {
                             $this->Cell($w[1], 4, $_balance, 0, 0, 'R');
                             $this->Cell($w[1] + 20, 4, $_balanceLast, 0, 0, 'R');
                         }
                         $this->Ln();
                         if ($mod->childs) {
                             foreach ($mod->childs as $m) {
                                 if ($m->childs) {
                                     $this->SetFont('Arial', 'B', 8);
                                 } else {
                                     $this->SetFont('Arial', '', 8);
                                 }
                                 $this->Cell($_s + 10, 4, '');
                                 $this->Cell($w[0], 4, $m->account_concat());
                                 $this->SetX($this->x0);
                                 $_m = $m->balancesheet(array('condition' => 'yearmonth_periode =' . $periode_date));
                                 $_mLast = $m->balancesheet(array('condition' => 'yearmonth_periode =' . $_periode_date_last));
                                 if (isset($_m->end_balance)) {
                                     $_balance = number_format($_m->end_balance, 0, ',', '.');
                                     $_mmLast = isset($_mLast->end_balance) ? $_mLast->end_balance : 0;
                                     $_balanceLast = number_format($_mmLast, 0, ',', '.');
                                     $_total = $_total + $_m->end_balance;
                                     $_subtotal = $_subtotal + $_m->end_balance;
                                     $_grandtotal = $_grandtotal + $_m->end_balance;
                                     $_totalLast = $_totalLast + $_mmLast;
                                     $_subtotalLast = $_subtotalLast + $_mmLast;
                                     $_grandtotalLast = $_grandtotalLast + $_mmLast;
                                 } else {
                                     $_balance = 0;
                                     $_balanceLast = 0;
                                 }
                                 if ($m->childs) {
                                     $this->Cell($w[1], 4, '', 0, 0, 'R');
                                 } else {
                                     $this->Cell($w[1], 4, $_balance, 0, 0, 'R');
                                     $this->Cell($w[1] + 20, 4, $_balanceLast, 0, 0, 'R');
                                 }
                                 $this->Ln();
                                 if ($m->childs) {
                                     ////////////////LAST
                                     foreach ($m->childs as $n) {
                                         if ($n->childs) {
                                             $this->SetFont('Arial', 'B', 8);
                                         } else {
                                             $this->SetFont('Arial', '', 8);
                                         }
                                         $this->Cell($_s + 15, 4, '');
                                         $this->Cell($w[0], 4, $n->account_concat());
                                         $this->SetX($this->x0);
                                         $_n = $n->balancesheet(array('condition' => 'yearmonth_periode =' . $periode_date));
                                         $_nLast = $n->balancesheet(array('condition' => 'yearmonth_periode =' . $_periode_date_last));
                                         if (isset($_n->end_balance)) {
                                             $_balance = number_format($_n->end_balance, 0, ',', '.');
                                             $_nnLast = isset($_nLast->end_balance) ? $_nLast->end_balance : 0;
                                             $_balanceLast = number_format($_nnLast, 0, ',', '.');
                                             $_total = $_total + $_n->end_balance;
                                             $_subtotal = $_subtotal + $_n->end_balance;
                                             $_grandtotal = $_grandtotal + $_n->end_balance;
                                             $_totalLast = $_totalLast + $_nnLast;
                                             $_subtotalLast = $_subtotalLast + $_nnLast;
                                             $_grandtotalLast = $_grandtotalLast + $_nnLast;
                                         } else {
                                             $_balance = 0;
                                             $_balanceLast = 0;
                                         }
                                         if ($n->childs) {
                                             $this->Cell($w[1], 4, '', 0, 0, 'R');
                                         } else {
                                             $this->Cell($w[1], 4, $_balance, 0, 0, 'R');
                                             $this->Cell($w[1] + 20, 4, $_balanceLast, 0, 0, 'R');
                                         }
                                         $this->Ln();
                                     }
                                     ///LAST
                                 }
                             }
                         }
                         if ($mod->childs && $mod->childsCount >= 2) {
                             $this->SetFont('Arial', 'B', 8);
                             $this->Cell($_s + 3, 4, '');
                             $this->Cell($w[0], 4, 'TOTAL ' . $mod->account_name);
                             $this->SetX($this->x0);
                             $this->Cell($w[1], 4, number_format($_total, 0, ',', '.'), 'T', 0, 'R');
                             $this->Cell($w[1], 4, '', 0);
                             $this->Cell($w[1], 4, number_format($_totalLast, 0, ',', '.'), 'T', 0, 'R');
                             $this->Ln(5);
                         }
                         if ($mod->childs) {
                             $_total = 0;
                             $_totalLast = 0;
                         }
                         if ($this->GetY() >= 250) {
                             $this->AddPage();
                             $this->myheader($periode_date, $report_id);
                         }
                     }
                 }
                 $this->SetFont('Arial', 'B', 8);
                 $this->Cell($_s, 4, '');
                 $this->Cell($w[0], 4, 'TOTAL ' . $model->account_name);
                 $this->SetX($this->x0 + 20);
                 $this->Cell($w[1], 4, number_format($_subtotal, 0, ',', '.'), 'T', 0, 'R');
                 $this->Cell($w[1], 4, '', 0);
                 $this->Cell($w[1], 4, number_format($_subtotalLast, 0, ',', '.'), 'T', 0, 'R');
                 $this->Ln(5);
                 $_subtotal = 0;
                 $_subtotalLast = 0;
                 if ($this->GetY() >= 250) {
                     $this->AddPage();
                     $this->myheader($periode_date, $report_id);
                 }
             }
             $this->SetFillColor(224, 224, 224);
             $this->SetFont('Arial', 'B', 8);
             if ($mmm->id == 2) {
                 $this->Cell(5, 4, '');
             }
             $this->Cell($w[0], 4, 'TOTAL ' . $model2->account_name, 0, 0, 'L', true);
             $this->SetX($this->x0 + 20);
             $this->Cell($w[1], 4, number_format($_grandtotal, 0, ',', '.'), 0, 0, 'R', true);
             $this->Cell($w[1] + 20, 4, number_format($_grandtotalLast, 0, ',', '.'), 0, 0, 'R', true);
             $this->Cell($w[1], 4, '');
             $this->Ln(8);
             if ($mmm->id == 1) {
                 //Aktiva
                 $_grandtotalA = $_grandtotal;
                 $_grandtotalALast = $_grandtotalLast;
             } else {
                 $_grandtotalP = $_grandtotalP + $_grandtotal;
                 $_grandtotalPLast = $_grandtotalPLast + $_grandtotalLast;
             }
             $_grandtotal = 0;
             $_grandtotalLast = 0;
         }
         if ($mmm->id == 2) {
             //Pasiva
             $_s = $_s + 3;
             $this->SetFont('Arial', 'B', 8);
             $this->Cell($w[0], 4, $mmm->name, 0, 0, 'L', true);
             $this->SetX($this->x0 + 20);
             $this->Cell($w[1], 4, number_format($_grandtotalP, 0, ',', '.'), 0, 0, 'R', true);
             $this->Cell($w[1] + 20, 4, number_format($_grandtotalPLast, 0, ',', '.'), 0, 0, 'R', true);
             $this->Ln();
         }
     }
 }

<?php 
Yii::app()->clientScript->registerScript('myCap' . $data->id, "\n\n\t\t\$('#myCap'+{$data->id}).click(function(){\n\t\t\$(this).slideUp();\n\t\t\$.ajax({\n\t\ttype : 'get',\n\t\turl  : \$(this).attr('href'),\n\t\tdata: '',\n\t\tsuccess : function(r){\n\t\t\$('#mydialog').dialog('open');\n\t\t\$('#list-'+{$data->id}).slideUp('slow');\n\t\tsetTimeout(\"\$('#mydialog').dialog('close') \",1200);\n}\n})\n\t\treturn false;\n});\n\n\n\t\t");
?>


<div id="list-<?php 
echo $data->id;
?>
" class="well">

	<b><?php 
echo CHtml::encode($data->system_ref);
if ($data->state_id != 1) {
    echo " (" . sParameter::item("cStatus", $data->state_id) . ")";
}
?>
 </b>

	<?php 
echo CHtml::link('detail<i class="icon-chevron-right"></i>', '#', array('class' => 'hide-info' . $data->id));
?>

	<br />
	<br />
	<div class="list<?php 
echo $data->id;
?>
" style="display: none">
	
 function pRequestR1($id)
 {
     $this->myheader4($id);
     $criteria = new CDbCriteria();
     $criteria->compare('parent_id', $id);
     $models = aPorderDetail::model()->findAll($criteria);
     $_counter = 1;
     $_countert = 1;
     $_totalc = 0;
     $_totals = 0;
     $w = array(6, 65, 40, 10, 10, 20, 20, 25, 15, 10, 10, 10, 10, 20);
     $x = $this->GetX();
     $y = $this->GetY();
     foreach ($models as $mod) {
         $this->SetFont('Arial', '', 8);
         $x0 = $this->GetX();
         $y0 = $this->GetY();
         $this->Cell($w[0], 4, number_format($_countert, 0, ',', '.'), 'L', 0, 'R');
         $y1 = $this->GetY();
         $this->MultiCell($w[1], 4, aBudget::model()->findByPk($mod->budget_id)->code . " " . $mod->description, 'LB');
         $y2 = $this->GetY();
         $yH = $y2 - $y1;
         $yC = $this->GetY();
         $this->SetXY($x0, $y0);
         $this->Cell($w[0], $yH, '', 'LB');
         //Garis samping
         $this->SetXY($x + $w[0] + $w[1], $yC - $yH);
         $this->Cell($w[2], $yH, $mod->user, 'LB');
         $this->Cell($w[3], $yH, $mod->uom, 'LB');
         $this->Cell($w[4], $yH, $mod->qty, 'LB', 0, 'R');
         $this->Cell($w[5], $yH, '', 'LB', 0, 'R');
         $this->Cell($w[6], $yH, sParameter::cDateDisplay(strtotime($mod->need_date)), 'LB', 0, 'R');
         $this->Cell($w[7], $yH, '', 'LB', 0, 'R');
         $this->Cell($w[8], $yH, '', 'LB', 0, 'R');
         $this->Cell($w[9], $yH, '', 'LB', 0, 'R');
         $this->Cell($w[10], $yH, '', 'LB', 0, 'R');
         $this->Cell($w[11], $yH, '', 'LB', 0, 'R');
         $this->Cell($w[12], $yH, '', 'LB', 0, 'R');
         $this->Cell($w[13], $yH, '', 'LBR', 0, 'R');
         $this->Ln();
         $_totalc = $_totalc + $mod->qty;
         $_totals = $_totals + aBudget::model()->findByPk($mod->budget_id)->amount;
         $_counter++;
         $_countert++;
         //if ($_counter==34) {
         //	$this->AddPage();
         //	$this->myheader4($id);
         //	$_counter = 1;
         //}
     }
     //Closure line
     $this->Cell(array_sum($w), 0, '', 'T');
     $this->Ln(2);
     $this->SetFont('Arial', 'B', 8);
     $this->Cell($w[0], 5, '', 'TLB');
     $this->Cell($w[1], 5, 'T O T A L', 'TLB', 0, 'C');
     $this->Cell($w[2], 5, '', 'TLB');
     $this->Cell($w[3], 5, '', 'TLB');
     $this->Cell($w[4], 5, number_format($_totalc, 0, ',', '.'), 'TLBR', 0, 'R');
     $this->Cell($w[5], 5, '', 'TLBR', 0, 'R');
     $this->Cell($w[6], 5, '', 'TLB');
     $this->Cell($w[7], 5, '', 'TLB');
     $this->Cell($w[8], 5, '', 'TLB');
     $this->Cell($w[9], 5, '', 'TLB');
     $this->Cell($w[10], 5, '', 'TLB');
     $this->Cell($w[11], 5, '', 'TLB');
     $this->Cell($w[12], 5, '', 'TLB');
     $this->Cell($w[13], 5, '', 1);
     $this->Ln(10);
     $this->SetFont('Arial', '', 8);
     $this->Cell(30, 6, 'Keterangan:');
     $this->Ln(4);
     $this->Cell(0, 6, aPorder::model()->findByPk($mod->parent_id)->remark);
     $this->Ln(14);
     $this->SetFont('Arial', '', 10);
     $this->Cell($w[0], 6, '', 'LT');
     $this->Cell($w[1], 6, 'Requested By', 'TR', 0, 'C');
     $this->Cell($w[2], 6, '', 'T', 0, 'C');
     $this->Cell($w[3], 6, '', 'T', 0, 'C');
     $this->Cell($w[4], 6, '', 'T', 0, 'C');
     $this->Cell($w[5], 6, '', 'T', 0, 'C');
     $this->Cell($w[6], 6, '', 'T', 0, 'C');
     $this->Cell($w[7], 6, 'Acknowledge By:', 'T', 0, 'C');
     $this->Cell($w[8], 6, '', 'T', 0, 'C');
     $this->Cell($w[9], 6, '', 'T', 0, 'C');
     $this->Cell($w[10], 6, '', 'T', 0, 'C');
     $this->Cell($w[11], 6, '', 'T', 0, 'C');
     $this->Cell($w[12], 6, '', 'T', 0, 'C');
     $this->Cell($w[13], 6, '', 'TR', 0, 'C');
     $this->Ln();
     $this->Cell($w[0], 18, '', 'L');
     $this->Cell($w[1], 18, '', 'R');
     $this->Cell($w[2], 18);
     $this->Cell($w[3], 18);
     $this->Cell($w[4], 18);
     $this->Cell($w[5], 18);
     $this->Cell($w[6], 18);
     $this->Cell($w[7], 18);
     $this->Cell($w[8], 18);
     $this->Cell($w[9], 18);
     $this->Cell($w[10], 18);
     $this->Cell($w[11], 18);
     $this->Cell($w[12], 18);
     $this->Cell($w[13], 18, '', 'R');
     $this->Ln();
     $this->Cell($w[0], 6, '', 'L');
     $this->Cell($w[1], 6, 'Silvia Theresia', 'R', 0, 'C');
     $this->Cell($w[2], 6, '', 0, 0, 'C');
     $this->Cell($w[3], 6, '', 0, 0, 'C');
     $this->Cell($w[4] + $w[5], 6, 'Hadi Sutanto', 0, 0, 'C');
     $this->Cell($w[6], 6, '', 0, 0, 'C');
     $this->Cell($w[7], 6, '', 0, 0, 'C');
     $this->Cell($w[8], 6, '', 0, 0, 'C');
     $this->Cell($w[9] + $w[10] + $w[11], 6, 'Indra W. Antono', 0, 0, 'C');
     $this->Cell($w[12], 6, '', 0, 0, 'C');
     $this->Cell($w[13], 6, '', 'R', 'C');
     $this->Ln(3);
     $this->SetFont('Arial', '', 8);
     $this->Cell($w[0], 6, '', 'LB');
     $this->Cell($w[1], 6, 'Office Support Manager', 'BR', 0, 'C');
     $this->Cell($w[2], 6, '', 'B', 0, 'C');
     $this->Cell($w[3], 6, '', 'B', 0, 'C');
     $this->Cell($w[4] + $w[5], 6, 'Fin & Acc Deputy Director', 'B', 0, 'C');
     $this->Cell($w[6], 6, '', 'B', 0, 'C');
     $this->Cell($w[7], 6, '', 'B', 0, 'C');
     $this->Cell($w[8], 6, '', 'B', 0, 'C');
     $this->Cell($w[9] + $w[10] + $w[11], 6, 'Marketing Director', 'B', 0, 'C');
     $this->Cell($w[12], 6, '', 'B', 0, 'C');
     $this->Cell($w[13], 6, '', 'BR', 'C');
     $this->Ln();
     $this->SetFont('Arial', 'BI', 8);
     $this->Cell(0, 6, aPorder::model()->findByPk($mod->parent_id)->no_ref . "         ", 0, 0, 'R');
     $this->Ln();
 }
예제 #10
0
<?php

$this->breadcrumbs = array('Notification' => array('index'), 'Manage');
Yii::app()->clientScript->registerScript('search', "\n\t\t\$('.search-button').click(function(){\n\t\t\$('.search-form').toggle();\n\t\treturn false;\n});\n\t\t\$('.search-form form').submit(function(){\n\t\t\$.fn.yiiGridView.update('sNotification-grid', {\n\t\tdata: \$(this).serialize()\n});\n\t\treturn false;\n});\n\t\t");
?>

<div class="page-header">
	<h1>
		<?php 
echo CHtml::image(Yii::app()->request->baseUrl . '/images/icon/preferences_desktop_notification.png');
?>
		Notification Manager
	</h1>
</div>
<?php 
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'advancedsearch_dialog', 'options' => array('title' => 'Advanced Search', 'width' => 'auto', 'autoOpen' => false)));
$this->renderPartial('_search', array('model' => $model));
$this->endWidget('zii.widgets.jui.CJuiDialog');
?>

<div class="mymenu">
	<?php 
echo CHtml::link('Add New', array('create'));
echo CHtml::label(' | ', '#');
echo CHtml::link('Search', '#', array('onclick' => '$("#advancedsearch_dialog").dialog("open"); return false;'));
?>
</div>

<?php 
$this->widget('bootstrap.widgets.BootGridView', array('id' => 'sNotification-grid', 'dataProvider' => $model->search(), 'itemsCssClass' => 'table table-striped table-bordered', 'template' => '{items}{pager}', 'columns' => array(array('class' => 'CButtonColumn', 'template' => '{view}{update}{delete}{archive}', 'buttons' => array('archive' => array('label' => 'archive', 'url' => 'Yii::app()->createUrl("sNotification/markarchive", array("id"=>$data->id))', 'visible' => '$data->read_id != 6'))), array('name' => 'type_id', 'value' => 'sParameter::item("cNotifType",$data->type_id)', 'filter' => sParameter::items("cNotifType")), 'broadcast_code', array('name' => 'sender_date', 'value' => '$data->sender_date'), array('name' => 'sender_id', 'value' => 'sUser::model()->findName($data->sender_id)', 'filter' => sUser::model()->allUsers()), array('name' => 'receiver_date', 'value' => '$data->receiver_date'), array('name' => 'receiver_id', 'value' => 'sUser::model()->findName($data->receiver_id)', 'filter' => sUser::model()->allUsers('all')), array('name' => 'category_id', 'value' => 'sParameter::item("cCategory",$data->category_id)', 'filter' => sParameter::items("cCategory")), array('name' => 'long_desc', 'filter' => false), array('name' => 'read_id', 'value' => 'sParameter::item("cRead",$data->read_id)', 'filter' => sParameter::items("cRead")))));
		<?php 
$this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'end_date', 'options' => array('showAnim' => 'fold', 'dateFormat' => 'dd-mm-yy'), 'htmlOptions' => array('style' => 'height:28px;')));
?>
	</div>
</div>
<div class="control-group">
	<?php 
echo $form->labelEx($model, 'reminder', array('class' => 'control-label'));
?>
	<div class="controls">
		<?php 
$this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'reminder', 'options' => array('showAnim' => 'fold', 'dateFormat' => 'dd-mm-yy'), 'htmlOptions' => array('style' => 'height:28px;')));
?>
	</div>
</div>

<?php 
echo $form->dropDownListRow($model, 'status_id', sParameter::items("cStatusTask"));
echo $form->dropDownListRow($model, 'priority_id', sParameter::items("cPriority"));
echo $form->dropDownListRow($model, 'category_id', sParameter::items("cTaskCategory"));
echo $form->textAreaRow($model, 'notes', array('rows' => 3, 'class' => 'span4'));
?>

<div class="form-actions">
	<?php 
echo CHtml::htmlButton('<i class="icon-ok"></i> Submit', array('class' => 'btn', 'type' => 'submit'));
?>
</div>

<?php 
$this->endWidget();
<?php

$form = $this->beginWidget('BootActiveForm', array('id' => 'parameter-form', 'type' => 'horizontal', 'enableAjaxValidation' => false));
?>

<?php 
echo $form->dropDownListRow($model, 'type', sParameter::items2("ALL"));
?>

<?php 
echo $form->textFieldRow($model, 'code');
?>

<?php 
echo $form->textFieldRow($model, 'name', array('class' => 'span3'));
?>

<div class="form-actions">
	<?php 
echo CHtml::htmlButton($model->isNewRecord ? '<i class="icon-ok"></i> Create' : '<i class="icon-ok"></i> Save', array('class' => 'btn', 'type' => 'submit'));
?>
</div>


<?php 
$this->endWidget();
예제 #13
0
<?php

$form = $this->beginWidget('BootActiveForm', array('id' => 'c-jemaat-form', 'type' => 'horizontal', 'enableAjaxValidation' => false));
?>

<?php 
echo $form->errorSummary($model);
?>


<?php 
echo $form->textFieldRow($model, 'branch_code', array('class' => 'span3'));
echo $form->dropDownListRow($model, 'structure_id', sParameter::items("cStructure"));
echo $form->textFieldRow($model, 'name', array('class' => 'span3'));
echo $form->textFieldRow($model, 'address', array('class' => 'span3'));
echo $form->textFieldRow($model, 'address2', array('class' => 'span3'));
echo $form->textFieldRow($model, 'address3', array('class' => 'span3'));
echo $form->textFieldRow($model, 'address4', array('class' => 'span3'));
?>

<?php 
/*
<?php echo $form->labelEx($model,'propinsi_id'); ?>
<?php
echo $form->dropDownList($model,'propinsi_id',sKabupatenPropinsi::items("Any"),
		array(
				'empty'=>'select Propinsi:',
				'ajax' => array(
						'type'=>'POST',
						'url'=>CController::createUrl('/m1/aOrganization/kabupatenUpdate'),
						'update'=>'#'.CHtml::activeId($model,'kabupaten_id'),
예제 #14
0
<?php

$this->breadcrumbs = array('Account Payable' => array('index'), $model->system_ref);
$this->menu = array(array('label' => 'Home', 'url' => array('/mAccpayable/')), array('label' => 'Approval', 'url' => array('/mAccpayable/', 'id' => 1)), array('label' => 'Payment', 'url' => array('/mAccpayable/', 'id' => 2)), array('label' => 'Paid', 'url' => array('/mAccpayable/', 'id' => 3)), array('label' => 'Show All', 'url' => array('/mAccpayable/', 'id' => 0)), array('label' => 'Print', 'url' => array('print', 'id' => $model->id)));
$this->menu1 = bPorder::getTopUpdated(1);
$this->menu2 = bPorder::getTopCreated(1);
//$this->menu3=uJournal::getTopRelated($model->user_ref);
?>

<div class="page-header">
	<h1>
		Account Payable:
		<?php 
echo $model->system_ref;
if ($model->state_id != 1) {
    echo " (" . sParameter::item("cStatus", $model->state_id) . ")";
}
?>
	</h1>
</div>

<?php 
$this->widget('bootstrap.widgets.BootDetailView', array('data' => $model, 'attributes' => array('input_date', 'yearmonth_periode', 'user_ref', 'system_ref', 'remark')));
?>

<br />

<?php 
echo $this->renderPartial('/uJournal/_viewDetail', array('id' => $model->id));
?>
예제 #15
0
?>

<?php 
echo $form->dropDownListRow($model, 'receiver_id', sUser::model()->allUsers());
?>


<?php 
echo $form->dropDownListRow($model, 'category_id', sParameter::items("cCategory"));
?>

<?php 
echo $form->textAreaRow($model, 'long_desc', array('class' => 'span6', 'rows' => 6));
//$this->widget('application.extensions.tinymce.ETinyMce',
//	array('name'=>'html','model'=>$model,'attribute'=>'long_desc'));
?>



<?php 
echo $form->dropDownListRow($model, 'read_id', sParameter::items("cRead"));
?>

<div class="form-actions">
	<?php 
echo CHtml::htmlButton('<i class="icon-ok"></i> Send', array('class' => 'btn', 'type' => 'submit'));
?>
</div>

<?php 
$this->endWidget();
예제 #16
0
<?php

$form = $this->beginWidget('BootActiveForm', array('id' => 't-account-form', 'type' => 'horizontal', 'enableAjaxValidation' => false));
?>

<?php 
//echo $form->errorSummary($model);
?>

<?php 
echo $form->dropDownListRow($model, 'haschild_id', sParameter::items("cHasChild"));
echo $form->textFieldRow($model, 'account_no', array('class' => 'span3'));
echo $form->textFieldRow($model, 'account_name', array('class' => 'span3'));
echo $form->textAreaRow($model, 'short_description', array('class' => 'span4', 'rows' => 3));
//echo $form->dropDownListRow($model,'currency_id',sParameter::items("cCurrency","*inherited*"));
echo $form->textFieldRow($model, 'beginning_balance', array('class' => 'span3', 'hint' => 'This field must be filled, otherwise record cannot be saved..'));
//echo $form->dropDownListRow($model,'state_id',sParameter::items("cStatus","*inherited*"));
?>

<div class="form-actions">
	<?php 
echo CHtml::htmlButton($model->isNewRecord ? '<i class="icon-ok"></i> Create' : '<i class="icon-ok"></i> Save', array('class' => 'btn', 'type' => 'submit'));
?>
</div>


<?php 
$this->endWidget();
 function report($periode_date, $report_id)
 {
     $this->myheader($periode_date, $report_id);
     $w = array(100, 20);
     $model1 = tAccountMain::model()->with('account_list')->findAll('type_id= 2');
     $_s = 3;
     //Reset
     $_total = 0;
     $_subtotal = 0;
     $_grandtotal = 0;
     $_grandtotalI = 0;
     $_grandtotalH = 0;
     $_grandtotalE = 0;
     $_totalLast = 0;
     $_subtotalLast = 0;
     $_grandtotalLast = 0;
     $_grandtotalILast = 0;
     $_grandtotalHLast = 0;
     $_grandtotalELast = 0;
     //Print/Preview Report
     foreach ($model1 as $mmm) {
         foreach ($mmm->account_list as $mm) {
             $model2 = tAccount::model()->findByPk((int) $mm->parent_id);
             $this->SetFont('Arial', 'B', 8);
             if ($mmm->id == 2) {
                 $this->Cell(5, 4, '');
             }
             $this->Cell($w[0], 4, $model2->account_concat());
             $this->SetX($this->x0);
             $this->Cell($w[1], 4, '');
             $this->Ln();
             foreach ($model2->childs as $model) {
                 if ($model->childs) {
                     $this->SetFont('Arial', 'B', 8);
                 } else {
                     $this->SetFont('Arial', '', 8);
                 }
                 $this->Cell($_s, 4, '');
                 $this->Cell($w[0], 4, $model->account_concat());
                 $this->SetX($this->x0);
                 $_model = $model->balancesheet(array('condition' => 'yearmonth_periode =' . $periode_date));
                 $_periode_date_last = sParameter::cBeginDateBefore($periode_date);
                 $_modelLast = $model->balancesheet(array('condition' => 'yearmonth_periode =' . $_periode_date_last));
                 if (isset($_model->end_balance)) {
                     $_balance = number_format($_model->end_balance, 0, ',', '.');
                     $_mmodelLast = isset($_modelLast->end_balance) ? $_modelLast->end_balance : 0;
                     $_balanceLast = number_format($_mmodelLast, 0, ',', '.');
                     $_subtotal = $_subtotal + $_model->end_balance;
                     $_grandtotal = $_grandtotal + $_model->end_balance;
                     $_subtotalLast = $_subtotalLast + $_mmodelLast;
                     $_grandtotalLast = $_grandtotalLast + $_mmodelLast;
                 } else {
                     $_balance = 0;
                     $_balanceLast = 0;
                 }
                 if ($model->childs) {
                     $this->Cell($w[1], 4, '', 0, 0, 'R');
                 } else {
                     $this->Cell($w[1], 4, $_balance, 0, 0, 'R');
                     $this->Cell($w[1] + 20, 4, $_balanceLast, 0, 0, 'R');
                 }
                 $this->Ln();
                 if ($model->childs) {
                     foreach ($model->childs as $mod) {
                         if ($mod->childs) {
                             $this->SetFont('Arial', 'B', 8);
                         } else {
                             $this->SetFont('Arial', '', 8);
                         }
                         $this->Cell($_s + 3, 4, '');
                         $this->Cell($w[0], 4, $mod->account_concat());
                         $this->SetX($this->x0);
                         $_mod = $mod->balancesheet(array('condition' => 'yearmonth_periode =' . $periode_date));
                         $_modLast = $mod->balancesheet(array('condition' => 'yearmonth_periode =' . $_periode_date_last));
                         if (isset($_mod->end_balance)) {
                             $_balance = number_format($_mod->end_balance, 0, ',', '.');
                             $_mmodLast = isset($_modLast->end_balance) ? $_modLast->end_balance : 0;
                             $_balanceLast = number_format($_mmodLast, 0, ',', '.');
                             $_subtotal = $_subtotal + $_mod->end_balance;
                             $_grandtotal = $_grandtotal + $_mod->end_balance;
                             $_subtotalLast = $_subtotalLast + $_mmodLast;
                             $_grandtotalLast = $_grandtotalLast + $_mmodLast;
                         } else {
                             $_balance = 0;
                             $_balanceLast = 0;
                         }
                         if ($mod->childs) {
                             $this->Cell($w[1], 4, '', 0, 0, 'R');
                         } else {
                             $this->Cell($w[1], 4, $_balance, 0, 0, 'R');
                             $this->Cell($w[1] + 20, 4, $_balanceLast, 0, 0, 'R');
                         }
                         $this->Ln();
                         if ($mod->childs) {
                             foreach ($mod->childs as $m) {
                                 $this->SetFont('Arial', '', 8);
                                 $this->Cell($_s + 10, 4, '');
                                 $this->Cell($w[0], 4, $m->account_concat());
                                 $this->SetX($this->x0);
                                 $_m = $m->balancesheet(array('condition' => 'yearmonth_periode =' . $periode_date));
                                 $_mLast = $m->balancesheet(array('condition' => 'yearmonth_periode =' . $_periode_date_last));
                                 $_mmLast = isset($_mLast->end_balance) ? $_mLast->end_balance : 0;
                                 if (isset($_m->end_balance)) {
                                     $_balance = number_format($_m->end_balance, 0, ',', '.');
                                     $_balanceLast = number_format($_mmLast, 0, ',', '.');
                                     $_total = $_total + $_m->end_balance;
                                     $_subtotal = $_subtotal + $_m->end_balance;
                                     $_grandtotal = $_grandtotal + $_m->end_balance;
                                     $_totalLast = $_totalLast + $_mmLast;
                                     $_subtotalLast = $_subtotalLast + $_mmLast;
                                     $_grandtotalLast = $_grandtotalLast + $_mmLast;
                                 } else {
                                     $_balance = 0;
                                     $_balanceLast = 0;
                                 }
                                 if ($m->childs) {
                                     $this->Cell($w[1], 4, '', 0, 0, 'R');
                                 } else {
                                     $this->Cell($w[1], 4, $_balance, 0, 0, 'R');
                                     $this->Cell($w[1] + 20, 4, $_balanceLast, 0, 0, 'R');
                                 }
                                 $this->Ln();
                             }
                         }
                         if ($mod->childs) {
                             $this->SetFont('Arial', 'B', 8);
                             $this->Cell($_s + 3, 4, '');
                             $this->Cell($w[0], 4, 'TOTAL ' . $mod->account_name);
                             $this->SetX($this->x0);
                             $this->Cell($w[1], 4, number_format($_total, 0, ',', '.'), 'T', 0, 'R');
                             $this->Cell($w[1], 4, '', '');
                             $this->Cell($w[1], 4, number_format($_totalLast, 0, ',', '.'), 'T', 0, 'R');
                             $this->Ln(5);
                             $_total = 0;
                             $_totalLast = 0;
                             if ($this->GetY() >= 250) {
                                 $this->AddPage();
                                 $this->myheader($periode_date, $report_id);
                             }
                         }
                     }
                 }
                 if ($model->childs && $model->childsCount >= 2) {
                     $this->SetFont('Arial', 'B', 8);
                     $this->Cell($_s, 4, '');
                     $this->Cell($w[0], 4, 'TOTAL ' . $model->account_name);
                     $this->SetX($this->x0);
                     $this->Cell($w[1], 4, number_format($_subtotal, 0, ',', '.'), 'T', 0, 'R');
                     $this->Cell($w[1], 4, '', 0);
                     $this->Cell($w[1], 4, number_format($_subtotalLast, 0, ',', '.'), 'T', 0, 'R');
                     $this->Ln(5);
                 }
                 $_subtotal = 0;
                 $_subtotalLast = 0;
                 if ($this->GetY() >= 250) {
                     $this->AddPage();
                     $this->myheader($periode_date, $report_id);
                 }
             }
             $this->SetFont('Arial', 'B', 8);
             if ($mmm->id == 2) {
                 $this->Cell(5, 4, '');
             }
             $this->Cell($w[0], 4, 'TOTAL ' . $model2->account_name);
             $this->SetX($this->x0 + 20);
             $this->Cell($w[1], 4, number_format($_grandtotal, 0, ',', '.'), 0, 0, 'R');
             $this->Cell($w[1] + 20, 4, number_format($_grandtotalLast, 0, ',', '.'), 0, 0, 'R');
             $this->Cell($w[1], 4, '');
             $this->Ln(8);
             if ($mmm->id == 3) {
                 //income
                 $_grandtotalI = $_grandtotal;
                 $_grandtotalILast = $_grandtotalLast;
             } elseif ($mmm->id == 4) {
                 //HPP
                 $_grandtotalH = $_grandtotal;
                 $_grossprofit = $_grandtotalI - $_grandtotalH;
                 $_grandtotalHLast = $_grandtotalLast;
                 $_grossprofitLast = $_grandtotalILast - $_grandtotalHLast;
             } else {
                 //Expenses
                 $_grandtotalE = $_grandtotal;
                 $_netprofit = $_grossprofit - $_grandtotalE;
                 $_grandtotalELast = $_grandtotalLast;
                 $_netprofitLast = $_grossprofitLast - $_grandtotalELast;
             }
             $_grandtotal = 0;
             $_grandtotalLast = 0;
         }
         if ($mmm->id == 4) {
             //GROSS PROFIT
             //$_s=$_s+3;
             $this->SetFont('Arial', 'B', 8);
             $this->Cell(array_sum($w), 4, 'GROSS PROFIT', 'T');
             $this->SetX($this->x0 + 20);
             $this->Cell($w[1], 4, number_format($_grossprofit, 0, ',', '.'), 'T', 0, 'R');
             $this->Cell($w[1], 4, '');
             $this->Cell($w[1], 4, number_format($_grossprofitLast, 0, ',', '.'), 'T', 0, 'R');
             $this->Ln(8);
         }
     }
     $_s = $_s + 3;
     $this->SetFont('Arial', 'B', 8);
     $this->Cell(array_sum($w), 4, 'INCOME OPERATION', 'T');
     $this->SetX($this->x0 + 20);
     $this->Cell($w[1], 4, number_format($_netprofit, 0, ',', '.'), 'T', 0, 'R');
     $this->Cell($w[1] + 20, 4, number_format($_netprofitLast, 0, ',', '.'), 'T', 0, 'R');
     $this->Ln(8);
     //Other Income and Other Expenses
     $model1 = tAccountMain::model()->with('account_list')->findAll('type_id= 3');
     $_grandtotalOI = 0;
     $_grandtotalOE = 0;
     $_netprofitFinal = 0;
     $_grandtotalOILast = 0;
     $_grandtotalOELast = 0;
     $_netprofitFinalLast = 0;
     foreach ($model1 as $mmm) {
         foreach ($mmm->account_list as $mm) {
             $model2 = tAccount::model()->findByPk((int) $mm->parent_id);
             $this->SetFont('Arial', 'B', 8);
             if ($mmm->id == 2) {
                 $this->Cell(5, 4, '');
             }
             $this->Cell($w[0], 4, $model2->account_concat());
             $this->SetX($this->x0);
             $this->Cell($w[1], 4, '');
             $this->Ln();
             foreach ($model2->childs as $model) {
                 if ($model->childs) {
                     $this->SetFont('Arial', 'B', 8);
                 } else {
                     $this->SetFont('Arial', '', 8);
                 }
                 $this->Cell($_s, 4, '');
                 $this->Cell($w[0], 4, $model->account_concat());
                 $this->SetX($this->x0);
                 $_model = $model->balancesheet(array('condition' => 'yearmonth_periode =' . $periode_date));
                 $_periode_date_last = sParameter::cBeginDateBefore($periode_date);
                 $_modelLast = $model->balancesheet(array('condition' => 'yearmonth_periode =' . $_periode_date_last));
                 if (isset($_model->end_balance)) {
                     $_balance = number_format($_model->end_balance, 0, ',', '.');
                     $_mmodelLast = isset($_modelLast->end_balance) ? $_modelLast->end_balance : 0;
                     $_balanceLast = number_format($_mmodelLast, 0, ',', '.');
                     $_subtotal = $_subtotal + $_model->end_balance;
                     $_grandtotal = $_grandtotal + $_model->end_balance;
                     $_subtotalLast = $_subtotalLast + $_mmodelLast;
                     $_grandtotalLast = $_grandtotalLast + $_mmodelLast;
                 } else {
                     $_balance = 0;
                     $_balanceLast = 0;
                 }
                 if ($model->childs) {
                     $this->Cell($w[1], 4, '', 0, 0, 'R');
                 } else {
                     $this->Cell($w[1], 4, $_balance, 0, 0, 'R');
                     $this->Cell($w[1] + 20, 4, $_balanceLast, 0, 0, 'R');
                 }
                 $this->Ln();
                 if ($model->childs) {
                     foreach ($model->childs as $mod) {
                         if ($mod->childs) {
                             $this->SetFont('Arial', 'B', 8);
                         } else {
                             $this->SetFont('Arial', '', 8);
                         }
                         $this->Cell($_s + 3, 4, '');
                         $this->Cell($w[0], 4, $mod->account_concat());
                         $this->SetX($this->x0);
                         $_mod = $mod->balancesheet(array('condition' => 'yearmonth_periode =' . $periode_date));
                         $_modLast = $mod->balancesheet(array('condition' => 'yearmonth_periode =' . $_periode_date_last));
                         $_mmodLast = isset($_modLast->end_balance) ? $_modLast->end_balance : 0;
                         if (isset($_mod->end_balance)) {
                             if ($mod->reverse) {
                                 $_balanceR = -$_mod->end_balance;
                                 $_balanceRLast = -$_mmodLast;
                             } else {
                                 $_balanceR = $_mod->end_balance;
                                 $_balanceRLast = $_mmodLast;
                             }
                             $_balance = number_format($_balanceR, 0, ',', '.');
                             $_subtotal = $_subtotal + $_balanceR;
                             $_grandtotal = $_grandtotal + $_balanceR;
                             $_balanceLast = number_format($_balanceRLast, 0, ',', '.');
                             $_subtotalLast = $_subtotalLast + $_balanceRLast;
                             $_grandtotalLast = $_grandtotalLast + $_balanceRLast;
                         } else {
                             $_balance = 0;
                             $_balanceLast = 0;
                         }
                         if ($mod->childs) {
                             $this->Cell($w[1], 4, '', 0, 0, 'R');
                         } else {
                             $this->Cell($w[1], 4, $_balance, 0, 0, 'R');
                             $this->Cell($w[1] + 20, 4, $_balanceLast, 0, 0, 'R');
                         }
                         $this->Ln();
                         if ($mod->childs) {
                             foreach ($mod->childs as $m) {
                                 $this->SetFont('Arial', '', 8);
                                 $this->Cell($_s + 10, 4, '');
                                 $this->Cell($w[0], 4, $m->account_concat());
                                 $this->SetX($this->x0);
                                 $_m = $m->balancesheet(array('condition' => 'yearmonth_periode =' . $periode_date));
                                 $_mLast = $m->balancesheet(array('condition' => 'yearmonth_periode =' . $_periode_date_last));
                                 $_mmLast = isset($_mLast->end_balance) ? $_mLast->end_balance : 0;
                                 if (isset($_m->end_balance)) {
                                     if ($mod->reverse) {
                                         $_balanceR = -$_m->end_balance;
                                         $_balanceRLast = -$_mmLast;
                                     } else {
                                         $_balanceR = $_m->end_balance;
                                         $_balanceRLast = $_mmLast;
                                     }
                                     $_balance = number_format($_balanceR, 0, ',', '.');
                                     $_total = $_total + $_balanceR;
                                     $_subtotal = $_subtotal + $_balanceR;
                                     $_grandtotal = $_grandtotal + $_balanceR;
                                     $_balanceLast = number_format($_balanceRLast, 0, ',', '.');
                                     $_totalLast = $_totalLast + $_balanceRLast;
                                     $_subtotalLast = $_subtotalLast + $_balanceRLast;
                                     $_grandtotalLast = $_grandtotalLast + $_balanceRLast;
                                 } else {
                                     $_balance = 0;
                                     $_balanceLast = 0;
                                 }
                                 if ($m->childs) {
                                     $this->Cell($w[1], 4, '', 0, 0, 'R');
                                 } else {
                                     $this->Cell($w[1], 4, $_balance, 0, 0, 'R');
                                     $this->Cell($w[1], 4, $_balanceLast, 0, 0, 'R');
                                 }
                                 $this->Ln();
                             }
                         }
                         if ($mod->childs) {
                             $this->SetFont('Arial', 'B', 8);
                             $this->Cell($_s + 3, 4, '');
                             $this->Cell($w[0], 4, 'TOTAL ' . $mod->account_name);
                             $this->SetX($this->x0);
                             $this->Cell($w[1], 4, number_format($_total, 0, ',', '.'), 'T', 0, 'R');
                             $this->Cell($w[1], 4, '', 0);
                             $this->Cell($w[1], 4, number_format($_totalLast, 0, ',', '.'), 'T', 0, 'R');
                             $this->Ln(5);
                             $_total = 0;
                         }
                     }
                 }
                 if ($model->childs && $model->childsCount >= 2) {
                     $this->SetFont('Arial', 'B', 8);
                     $this->Cell($_s, 4, '');
                     $this->Cell($w[0], 4, 'TOTAL ' . $model->account_name);
                     $this->SetX($this->x0);
                     $this->Cell($w[1], 4, number_format($_subtotal, 0, ',', '.'), 'T', 0, 'R');
                     $this->Cell($w[1], 4, '', 0);
                     $this->Cell($w[1], 4, number_format($_subtotalLast, 0, ',', '.'), 'T', 0, 'R');
                     $this->Ln(5);
                 }
                 if ($_grandtotalOI == 0) {
                     //other Income
                     $_grandtotalOI = $_subtotal;
                     $_grandtotalOILast = $_subtotalLast;
                 } else {
                     //Expenses
                     $_grandtotalOE = $_subtotal;
                     $_grandtotalOELast = $_subtotalLast;
                 }
                 $_subtotal = 0;
                 $_subtotalLast = 0;
             }
             $this->SetFont('Arial', 'B', 8);
             if ($mmm->id == 2) {
                 $this->Cell(5, 4, '');
             }
             $this->Cell($w[0], 4, 'TOTAL ' . $model2->account_name);
             $this->SetX($this->x0 + 20);
             $this->Cell($w[1], 4, number_format($_grandtotal, 0, ',', '.'), 0, 0, 'R');
             $this->Cell($w[1], 4, '');
             $this->Cell($w[1], 4, number_format($_grandtotalLast, 0, ',', '.'), 0, 0, 'R');
             $this->Ln(8);
             $_grandtotalOIE = $_grandtotal;
             $_grandtotal = 0;
             $_grandtotalOIELast = $_grandtotalLast;
             $_grandtotalLast = 0;
         }
         $_netprofitFinal = $_netprofit + $_grandtotalOIE;
         $_netprofitFinalLast = $_netprofitLast + $_grandtotalOIELast;
         //$_s=$_s+3;
         $this->SetFont('Arial', 'B', 8);
         $this->Cell(array_sum($w), 4, 'NET INCOME', 'T');
         $this->SetX($this->x0 + 20);
         $this->Cell($w[1], 4, number_format($_netprofitFinal, 0, ',', '.'), 'T', 0, 'R');
         $this->Cell($w[1], 4, '');
         $this->Cell($w[1], 4, number_format($_netprofitFinalLast, 0, ',', '.'), 'T', 0, 'R');
         $this->Ln(8);
     }
 }
예제 #18
0
		<?php 
echo $model->sender_ref;
?>
	</h1>
</div>

<div class="row-fluid">
	<div class="span12">
		<div class="well">
			<h4><span class="icon fam-note"></span>
				<?php 
echo sUser::model()->findName($model->sender_id) . ' to ' . sUser::model()->findName($model->receiver_id);
?>
				|
				<?php 
echo sParameter::item("cCategory", $model->category_id);
?>
			</h4>
			<br />
			<?php 
echo $model->long_desc;
?>

			<h6>
				<?php 
echo Yii::app()->dateFormatter->format("dd-MM-yyyy HH:mm", $model->sender_date);
?>
			</h6>

			<?php 
$comment = sNotificationDetail::model()->findAll(array('condition' => 'parent_id = ' . $model->id));
echo $form->textFieldRow($model, 'begindate');
?>
	<?php 
echo $form->textFieldRow($model, 'enddate');
?>

<?php 
/*
$this->widget('ext.monthpicker.MonthPicker', array(
    'model'=>$model,
    'name'=>'begindate',
));
*/
?>

<?php 
echo $form->dropDownListRow($model, 'type_report_id', array('1' => 'Summary Style', '2' => 'Detail Style'));
?>

<?php 
echo $form->dropDownListRow($model, 'post_id', sParameter::items("cStatus", 2));
?>

<div class="form-actions">
	<?php 
echo CHtml::htmlButton('<i class="icon-ok"></i> Report', array('class' => 'btn', 'type' => 'submit'));
?>
</div>

<?php 
$this->endWidget();
<div class="comment">
	<div class="author">
		<b><?php 
echo sParameter::item("cCategory", $data->category_id);
?>
 </b>
	</div>

	<div class="time">
		<?php 
echo CHtml::encode($data->sender_date, 1);
?>
	</div>

	<div class="content">
		<?php 
echo CHtml::encode($data->long_desc);
?>
	</div>
</div>

예제 #21
0
<?php

$this->breadcrumbs = array('Event Management' => array('index'), $model->id);
?>

<div class="page-header">
	<h1>
		<?php 
echo $model->issue;
?>
	</h1>
</div>
<?php 
$this->widget('ext.JuiButtonSet.JuiButtonSet', array('items' => array(array('label' => 'List View', 'icon-position' => 'left', 'url' => array('admin')), array('label' => 'Update', 'icon-position' => 'left', 'url' => array('update', 'id' => $model->id))), 'htmlOptions' => array('style' => 'clear: both;')));
?>

<?php 
//$this->widget('bootstrap.widgets.BootDetailView', array(
$this->widget('ext.XDetailView', array('ItemColumns' => 2, 'data' => $model, 'attributes' => array(array('name' => 'event_id', 'value' => sParameter::item("cEvent", $model->event_id)), 'id', array('name' => 'category_id', 'value' => sParameter::item("cEventCat", $model->category_id)), 'issue', 'person_incharge', 'todo', 'progress', 'incomplete_exp', 'remark')));
 function pRequestR2($id)
 {
     $this->myheader4($id);
     $criteria = new CDbCriteria();
     $criteria->compare('parent_id', $id);
     $criteria->compare('tcredit>', 0);
     $criteria->order = 'periode_date, id';
     $models = aBudgetDetail::model()->findAll($criteria);
     $_counter = 1;
     $_countert = 1;
     $_totalc = 0;
     $_totals = 0;
     $w = array(8, 25, 50, 30, 30, 30, 40, 50);
     //Saldo Awal
     $criteria1 = new CDbCriteria();
     $criteria1->compare('parent_id', $id);
     $criteria1->compare('tdebt>', 0);
     $criteria1->order = 'periode_date, id';
     $modelt = aBudgetDetail::model()->find($criteria1);
     $this->SetFont('Arial', '', 8);
     $this->Cell($w[0], 6, $_counter, 'LB', 0, 'R');
     $this->Cell($w[1], 6, $modelt->input_date, 'LB');
     $this->Cell($w[2], 6, $modelt->no_ref, 'LB');
     $this->Cell($w[3], 6, $modelt->periode_date, 'LB');
     $this->Cell($w[4], 6, '', 'LB', 0, 'R');
     $this->SetFont('Arial', 'B', 8);
     $this->Cell($w[5], 6, number_format($modelt->tdebt, 0, ',', '.'), 'LB', 0, 'R');
     $this->Cell($w[6], 6, '', 'LB');
     $this->SetFont('Arial', '', 8);
     $this->Cell($w[7], 6, $modelt->remark, 'LBR');
     $this->Ln();
     //End of Saldo Awal
     $_counter++;
     foreach ($models as $mod) {
         $this->SetFont('Arial', '', 8);
         $this->Cell($w[0], 6, $_counter, 'LB', 0, 'R');
         $this->Cell($w[1], 6, $mod->input_date, 'LB');
         $this->Cell($w[2], 6, $mod->no_ref, 'LB');
         $this->Cell($w[3], 6, sParameter::BulanTahun1($mod->periode_date), 'LB');
         $this->Cell($w[4], 6, number_format($mod->tcredit, 0, ',', '.'), 'LB', 0, 'R');
         $this->Cell($w[4], 6, number_format($mod->balance, 0, ',', '.'), 'LB', 0, 'R');
         $this->Cell($w[6], 6, aPorder::model()->issuerBy((int) $mod->prequest_id), 'LB');
         $this->Cell($w[7], 6, $mod->remark, 'LBR');
         $this->Ln();
         $_totalc = $_totalc + $mod->tcredit;
         $_counter++;
         $_countert++;
         //if ($_counter==34) {
         //	$this->AddPage();
         //	$this->myheader4($id);
         //	$_counter = 1;
         //}
     }
     //Closure line
     $this->Cell(array_sum($w), 0, '', 'T');
     $this->Ln(2);
     $w = array(8, 25, 50, 30, 30, 30, 40, 50);
     $this->SetFont('Arial', 'B', 8);
     $this->Cell($w[0], 6, '', 1);
     $this->Cell($w[1], 6, '', 1, 0, 'C');
     $this->Cell($w[2], 6, '', 1, 0, 'C');
     $this->Cell($w[3], 6, '', 1, 0, 'C');
     $this->Cell($w[4], 6, number_format($_totalc, 0, ',', '.'), 1, 0, 'R');
     $this->Cell($w[5], 6, number_format($mod->balance, 0, ',', '.'), 1, 0, 'R');
     $this->Cell($w[6], 6, '', 1, 0, 'C');
     $this->Cell($w[7], 6, '', 1, 0, 'C');
     $this->Ln();
     /*		$this->SetFont('Arial','',8);
     		 $this->Cell(30,6,'Keterangan');
     		$this->Ln();
     		$this->Cell(0,6,aBudgetDetail::model()->findByPk($mod->parent_id)->remark);
     		$this->Ln(10);
     
     		$this->SetFont('Arial','',10);
     		$this->Cell($w[0],6,'','LT');
     		$this->Cell($w[1],6,'Requested By','TR',0,'C');
     		$this->Cell($w[2],6,'','T',0,'C');
     		$this->Cell($w[3],6,'','T',0,'C');
     		$this->Cell($w[4],6,'','T',0,'C');
     		$this->Cell($w[5],6,'','T',0,'C');
     		$this->Cell($w[6],6,'','T',0,'C');
     		$this->Cell($w[7],6,'Acknowledge By:','T',0,'C');
     		$this->Cell($w[8],6,'','T',0,'C');
     		$this->Cell($w[9],6,'','T',0,'C');
     		$this->Cell($w[10],6,'','T',0,'C');
     		$this->Cell($w[11],6,'','T',0,'C');
     		$this->Cell($w[12],6,'','T',0,'C');
     		$this->Cell($w[13],6,'','TR',0,'C');
     		$this->Ln();
     		$this->Cell($w[0],18,'','L');
     		$this->Cell($w[1],18,'','R');
     		$this->Cell($w[2],18);
     		$this->Cell($w[3],18);
     		$this->Cell($w[4],18);
     		$this->Cell($w[5],18);
     		$this->Cell($w[6],18);
     		$this->Cell($w[7],18);
     		$this->Cell($w[8],18);
     		$this->Cell($w[9],18);
     		$this->Cell($w[10],18);
     		$this->Cell($w[11],18);
     		$this->Cell($w[12],18);
     		$this->Cell($w[13],18,'','R');
     		$this->Ln();
     		$this->Cell($w[0],6,'','L');
     		$this->Cell($w[1],6,'Silvia Theresia','R',0,'C');
     		$this->Cell($w[2],6,'',0,0,'C');
     		$this->Cell($w[3],6,'',0,0,'C');
     		$this->Cell($w[4]+$w[5],6,'Hadi Sutanto',0,0,'C');
     		$this->Cell($w[6],6,'',0,0,'C');
     		$this->Cell($w[7],6,'',0,0,'C');
     		$this->Cell($w[8],6,'',0,0,'C');
     		$this->Cell($w[9]+$w[10]+$w[11],6,'Indra W. Antono',0,0,'C');
     		$this->Cell($w[12],6,'',0,0,'C');
     		$this->Cell($w[13],6,'','R','C');
     		$this->Ln(3);
     		$this->SetFont('Arial','',8);
     		$this->Cell($w[0],6,'','LB');
     		$this->Cell($w[1],6,'Office Support Manager','BR',0,'C');
     		$this->Cell($w[2],6,'','B',0,'C');
     		$this->Cell($w[3],6,'','B',0,'C');
     		$this->Cell($w[4]+$w[5],6,'Fin & Acc Deputy Director','B',0,'C');
     		$this->Cell($w[6],6,'','B',0,'C');
     		$this->Cell($w[7],6,'','B',0,'C');
     		$this->Cell($w[8],6,'','B',0,'C');
     		$this->Cell($w[9]+$w[10]+$w[11],6,'Marketing Director','B',0,'C');
     		$this->Cell($w[12],6,'','B',0,'C');
     		$this->Cell($w[13],6,'','BR','C');
     		$this->Ln();
     		$this->SetFont('Arial','BI',8);
     		$this->Cell(0,6,aBudgetDetail::model()->findByPk($mod->parent_id)->no_ref . "         ",0,0,'R');
     		$this->Ln();
     		*/
 }
예제 #23
0
$form = $this->beginWidget('BootActiveForm', array('id' => 'user-module-form', 'type' => 'horizontal', 'enableAjaxValidation' => false));
?>

<?php 
echo $form->errorSummary($model);
?>

<?php 
echo $form->textFieldRow($model, 'username', array('class' => 'span3'));
?>

<?php 
echo $form->passwordFieldRow($model, 'password', array('class' => 'span3'));
?>

<?php 
echo $form->dropDownListRow($model, 'default_group', aOrganization::model()->getRootList());
?>

<?php 
echo $form->dropDownListRow($model, 'status_id', sParameter::items("cStatusP"));
?>

<div class="form-actions">
	<?php 
echo CHtml::htmlButton($model->isNewRecord ? '<i class="icon-ok"></i> Create' : '<i class="icon-ok"></i> Save', array('class' => 'btn', 'type' => 'submit'));
?>
</div>

<?php 
$this->endWidget();
<?php 
echo $form->textFieldRow($model, 'input_date');
?>

<?php 
echo $form->textFieldRow($model, 'no_ref', array('class' => 'span3'));
echo $form->textFieldRow($model, 'periode_date');
?>

<?php 
echo $form->dropDownListRow($model, 'budgetcomp_id', aBudget::mainComponent(), array());
?>


<?php 
echo $form->textAreaRow($model, 'remark', array('rows' => 2, 'cols' => 50));
?>


<?php 
echo $form->dropDownListRow($model, 'issuer_id', sParameter::items("cIssuer"));
$this->widget('ext.appendo.JAppendo', array('id' => 'repeateEnum', 'model' => $model, 'viewName' => '_detailPorder', 'labelDel' => 'Remove Row'));
?>
<div class="form-actions">
	<?php 
echo CHtml::htmlButton('<i class="icon-ok"></i>' . $model->isNewRecord ? 'Create' : 'Save', array('class' => 'btn', 'type' => 'submit'));
?>
</div>

<?php 
$this->endWidget();
<?php

$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'mydialog', 'options' => array('title' => 'Sick, Absence, Leave', 'autoOpen' => false, 'modal' => true)));
echo 'Day Status Complete...';
$this->endWidget('zii.widgets.jui.CJuiDialog');
?>

<?php 
//$this->renderPartial('_formAbsence', array('model'=>$modelAbsence));
?>

<hr />

<?php 
$this->widget('bootstrap.widgets.BootMenu', array('type' => 'pills', 'stacked' => false, 'items' => array(array('label' => '<< Previous Month', 'url' => Yii::app()->createUrl("/m1/cAbsence/view", array("id" => $model->id, "month" => $month - 1))), array('label' => sParameter::BulanTahun(date("Ym", strtotime(date("Y-m", strtotime($month . " month")) . "-01"))), 'url' => Yii::app()->createUrl("/m1/cAbsence/view", array("id" => $model->id, "month" => $month))), array('label' => 'Next Month >>', 'url' => Yii::app()->createUrl("/m1/cAbsence/view", array("id" => $model->id, "month" => $month + 1))))));
?>


<?php 
$this->widget('bootstrap.widgets.BootGridView', array('id' => 'cpersonalia-absence-grid', 'dataProvider' => gPersonAbsence::model()->search((int) $model->id, $month), 'template' => '{items}', 'itemsCssClass' => 'table table-striped table-bordered', 'template' => '{items}{pager}{summary}', 'columns' => array(array('class' => 'BootButtonColumn', 'template' => '{sakit}{alpha}{permission}', 'buttons' => array('sakit' => array('label' => 'Sakit', 'imageUrl' => Yii::app()->request->baseUrl . '/images/icon/sakit.png', 'url' => 'Yii::app()->createUrl("/m1/cAbsence//setSakit", array("id"=>$data->id))', 'options' => array('ajax' => array('type' => 'GET', 'url' => "js:\$(this).attr('href')", 'success' => 'js:function(data){$("#mydialog").dialog("open");
														$.fn.yiiGridView.update("cpersonalia-absence-grid", {
														data: $(this).serialize()
});
}'))), 'alpha' => array('label' => 'Absence', 'imageUrl' => Yii::app()->request->baseUrl . '/images/icon/alpha.png', 'url' => 'Yii::app()->createUrl("/m1/cAbsence//setAlpha", array("id"=>$data->id))', 'options' => array('ajax' => array('type' => 'GET', 'url' => "js:\$(this).attr('href')", 'success' => 'js:function(data){$("#mydialog").dialog("open");
														$.fn.yiiGridView.update("cpersonalia-absence-grid", {
														data: $(this).serialize()
});
}'))), 'permission' => array('label' => 'Update', 'imageUrl' => Yii::app()->request->baseUrl . '/images/icon/ijin.png', 'url' => '$this->grid->controller->createUrl("/CAbsence/updateAbsence", array("id"=>$data->id,"pid"=>$data->parent_id,"asDialog"=>1,"gridId"=>$this->grid->id))', 'click' => 'function(){$("#cru-frame").attr("src",$(this).attr("href")); $("#cru-dialog").dialog("open"); return false;}'))), array('name' => 'cdate', 'value' => '$data->cdate'), array('name' => 'realpattern_id', 'value' => '$data->timeBlock->code'), array('header' => 'Sched In', 'value' => 'Yii::app()->dateFormatter->formatDateTime($data->timeBlock->in,null,"medium")'), array('header' => 'Sched Out', 'value' => 'Yii::app()->dateFormatter->formatDateTime($data->timeBlock->out,null,"medium")'), array('name' => 'in', 'value' => 'Yii::app()->dateFormatter->formatDateTime($data->in,null,"medium")'), array('name' => 'out', 'value' => 'Yii::app()->dateFormatter->formatDateTime($data->out,null,"medium")'), array('header' => 'In Status', 'value' => '$data->lateIn'), array('header' => 'Out Status', 'value' => '$data->EarlyOut'), 'remark', array('name' => 'daystatus1_id', 'value' => '$data->daystatus1_id == 0 ? "" : $data->dayCategory->name'))));
?>

<?php 
    ?>
			</td>
			<td><?php 
    echo CHtml::textField('text[]', '');
    ?>
			</td>
		</tr>
		<?php 
} else {
    ?>
		<?php 
    for ($i = 0; $i < sizeof($model->account_properties); ++$i) {
        ?>
		<tr>
			<td><?php 
        echo CHtml::dropDownList('account_properties[]', $model->account_properties[$i], sParameter::itemsOther("cAccProperties"));
        ?>
			</td>
			<td><?php 
        echo CHtml::dropDownList('value[]', $model->value[$i], array('0' => '*Inherited*', '1' => 'Set Yes (or Set No Child)', '2' => 'Has Child'));
        ?>
			</td>
			<td><?php 
        echo CHtml::textField('text[]', $model->text[$i], array());
        ?>
			</td>
		</tr>
		<?php 
    }
    ?>
		<?php 
    public function actionUnposting($id)
    {
        $_curPeriod = Yii::app()->settings->get("System", "cCurrentPeriod");
        $_lastPeriod = sParameter::cBeginDateBefore(Yii::app()->settings->get("System", "cCurrentPeriod"));
        $locked = uJournal::model()->updateByPk((int) $id, array('state_id' => 2, 'updated_date' => time(), 'updated_id' => Yii::app()->user->id));
        $models = uJournalDetail::model()->with('journal')->findAll(array('condition' => 'parent_id =' . $id));
        foreach ($models as $model) {
            $modelBalanceCurrent = tBalanceSheet::model()->find(array('condition' => 'parent_id =' . $model->account_no_id . ' AND yearmonth_periode = ' . $_curPeriod));
            $_debit = $model->debit;
            $_credit = $model->credit;
            $_curdebit = $modelBalanceCurrent->debit - $_debit;
            $_curcredit = $modelBalanceCurrent->credit - $_credit;
            $_curbalance = $modelBalanceCurrent->end_balance;
            if ($model->account->getSideValue() == 1 || isset($model->account->reverse)) {
                //Asset, Expense
                $_endbalance = $_curbalance - $_debit + $_credit;
            } else {
                //Pasiva, Income
                $_endbalance = $_curbalance - $_credit + $_debit;
            }
            $command = Yii::app()->db->createCommand('
					UPDATE  t_balance_sheet SET
					debit = ' . $_curdebit . ',
					credit = ' . $_curcredit . ',
					end_balance = ' . $_endbalance . '
					WHERE yearmonth_periode = ' . $_curPeriod . ' AND parent_id = ' . $model->account_no_id);
            $command->execute();
        }
    }
    public function actionUnposting($id)
    {
        $_curPeriod = Yii::app()->settings->get("System", "cCurrentPeriod");
        $_lastPeriod = sParameter::cBeginDateBefore(Yii::app()->settings->get("System", "cCurrentPeriod"));
        $locked = uJournal::model()->updateByPk((int) $id, array('state_id' => 2, 'updated_date' => time(), 'updated_by' => Yii::app()->user->id));
        $models = uJournalDetail::model()->with('journal')->findAll(array('condition' => 'parent_id = :id', 'params' => array(':id' => $id)));
        foreach ($models as $model) {
            $modelBalanceCurrent = tBalanceSheet::model()->find(array('condition' => 'parent_id = :accid AND yearmonth_periode = :period', 'params' => array(':accid' => $model->account_no_id, ':period' => $_curPeriod)));
            $_debit = $model->debit;
            $_credit = $model->credit;
            $_endbalance = 0;
            $_curdebit = $modelBalanceCurrent->debit - $_debit;
            $_curcredit = $modelBalanceCurrent->credit - $_credit;
            $_curbalance = $modelBalanceCurrent->end_balance;
            if ($model->account->getSideValue() == 1 || isset($model->account->reverse)) {
                //Asset, Expense
                $_endbalance = $_curbalance - $_debit + $_credit;
            } else {
                //Pasiva, Income
                $_endbalance = $_curbalance - $_credit + $_debit;
            }
            $command = Yii::app()->db->createCommand('
					UPDATE  t_balance_sheet SET
					debit = ' . $_curdebit . ',
					credit = ' . $_curcredit . ',
					end_balance = ' . $_endbalance . '
					WHERE yearmonth_periode = ' . $_curPeriod . ' AND parent_id = ' . $model->account_no_id);
            $command->execute();
            //LOG
            $commandLog = Yii::app()->db->createCommand('
					INSERT INTO t_balance_sheet_log (journal_id, yearmonth_periode, type_balance_id, remark, budget, account_no_id, beginning_balance,debit,credit,end_balance) VALUES (' . $model->parent_id . ',' . $_curPeriod . ', 1, \'UNPOSTING LOG\', 0,' . $model->account_no_id . ',' . $_curbalance . ',' . $_debit . ',' . $_credit . ',' . $_endbalance . ')
					');
            $commandLog->execute();
        }
    }