Finish version/v.0.0.87
This commit is contained in:
commit
955e00c369
@ -1,3 +1,5 @@
|
|||||||
|
-0.0.87
|
||||||
|
- add console command fix ticket installment request target time
|
||||||
-0.0.86
|
-0.0.86
|
||||||
- add inventory "load sold count" for item fix
|
- add inventory "load sold count" for item fix
|
||||||
- Detstat file > transfer type cash on failed
|
- Detstat file > transfer type cash on failed
|
||||||
|
|||||||
@ -5,7 +5,7 @@ return [
|
|||||||
'supportEmail' => 'rocho02@gmail.com',
|
'supportEmail' => 'rocho02@gmail.com',
|
||||||
'infoEmail' => 'info@rocho-net.hu',
|
'infoEmail' => 'info@rocho-net.hu',
|
||||||
'user.passwordResetTokenExpire' => 3600,
|
'user.passwordResetTokenExpire' => 3600,
|
||||||
'version' => 'v0.0.86',
|
'version' => 'v0.0.87',
|
||||||
'company' => 'movar',//gyor
|
'company' => 'movar',//gyor
|
||||||
'company_name' => "Freimann Kft.",
|
'company_name' => "Freimann Kft.",
|
||||||
'product_visiblity' => 'account',// on reception which products to display. account or global
|
'product_visiblity' => 'account',// on reception which products to display. account or global
|
||||||
|
|||||||
@ -132,7 +132,6 @@ class TicketInstallmentRequest extends \yii\db\ActiveRecord
|
|||||||
public function getTicketExpirationDate(){
|
public function getTicketExpirationDate(){
|
||||||
$contract = $this->contract;
|
$contract = $this->contract;
|
||||||
|
|
||||||
|
|
||||||
$started_at = $contract->started_at;
|
$started_at = $contract->started_at;
|
||||||
$date = \DateTime::createFromFormat("Y-m-d H:i:s", $started_at, new \DateTimeZone( 'UTC'));
|
$date = \DateTime::createFromFormat("Y-m-d H:i:s", $started_at, new \DateTimeZone( 'UTC'));
|
||||||
$date = DateUtil::addMonth( $date,$this->priority + 1 );
|
$date = DateUtil::addMonth( $date,$this->priority + 1 );
|
||||||
|
|||||||
@ -2,11 +2,14 @@
|
|||||||
namespace console\controllers;
|
namespace console\controllers;
|
||||||
|
|
||||||
|
|
||||||
|
use common\components\DateUtil;
|
||||||
use common\components\giro\GiroDETSTA;
|
use common\components\giro\GiroDETSTA;
|
||||||
use common\components\giro\GiroDETSTAFej;
|
use common\components\giro\GiroDETSTAFej;
|
||||||
use common\components\giro\GiroDETSTALab;
|
use common\components\giro\GiroDETSTALab;
|
||||||
use common\components\giro\GiroDETSTATetel;
|
use common\components\giro\GiroDETSTATetel;
|
||||||
|
use common\models\Contract;
|
||||||
use common\models\Ugiro;
|
use common\models\Ugiro;
|
||||||
|
use Faker\Provider\DateTime;
|
||||||
use yii\console\Controller;
|
use yii\console\Controller;
|
||||||
use frontend\models\ContractForm;
|
use frontend\models\ContractForm;
|
||||||
use common\models\TicketType;
|
use common\models\TicketType;
|
||||||
@ -14,10 +17,12 @@ use common\models\Customer;
|
|||||||
use common\models\Transfer;
|
use common\models\Transfer;
|
||||||
|
|
||||||
|
|
||||||
class DetstaConsoleController extends Controller{
|
class DetstaConsoleController extends Controller
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
public function actionCreateContract(){
|
public function actionCreateContract()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
$contractForm = new ContractForm(
|
$contractForm = new ContractForm(
|
||||||
@ -32,7 +37,7 @@ class DetstaConsoleController extends Controller{
|
|||||||
$contractForm->payment_method = Transfer::PAYMENT_METHOD_TRANSFER;
|
$contractForm->payment_method = Transfer::PAYMENT_METHOD_TRANSFER;
|
||||||
|
|
||||||
|
|
||||||
$contractForm->ticketType = TicketType::find()->andWhere(['status' => TicketType::STATUS_ACTIVE ,'installment_enabled' => '1'])->one();
|
$contractForm->ticketType = TicketType::find()->andWhere(['status' => TicketType::STATUS_ACTIVE, 'installment_enabled' => '1'])->one();
|
||||||
|
|
||||||
|
|
||||||
$start = new \DateTime();
|
$start = new \DateTime();
|
||||||
@ -47,7 +52,8 @@ class DetstaConsoleController extends Controller{
|
|||||||
/**
|
/**
|
||||||
* @param integer $id_ugiro
|
* @param integer $id_ugiro
|
||||||
*/
|
*/
|
||||||
public function actionDetstaAnswer($id_ugiro,$accepted = 1){
|
public function actionDetstaAnswer($id_ugiro, $accepted = 1)
|
||||||
|
{
|
||||||
|
|
||||||
/** @var \common\models\Ugiro $ugiro */
|
/** @var \common\models\Ugiro $ugiro */
|
||||||
$ugiro = Ugiro::findOne($id_ugiro);
|
$ugiro = Ugiro::findOne($id_ugiro);
|
||||||
@ -58,27 +64,26 @@ class DetstaConsoleController extends Controller{
|
|||||||
|
|
||||||
|
|
||||||
$detsta->fej->jelentesJelzo = 8;
|
$detsta->fej->jelentesJelzo = 8;
|
||||||
$detsta->fej->kezdemenyezoAzonosito =\Yii::$app->params['ugiro_kezdemenyezo_azonosito'];
|
$detsta->fej->kezdemenyezoAzonosito = \Yii::$app->params['ugiro_kezdemenyezo_azonosito'];
|
||||||
$detsta->fej->csoportosUzenetSorszam->osszeallitasDatuma = $ugiro->datum;
|
$detsta->fej->csoportosUzenetSorszam->osszeallitasDatuma = $ugiro->datum;
|
||||||
$detsta->fej->csoportosUzenetSorszam->sorszam = $ugiro->number;
|
$detsta->fej->csoportosUzenetSorszam->sorszam = $ugiro->number;
|
||||||
$detsta->fej->detstaUzenetSorszam->osszeallitasDatuma = $ugiro->datum;
|
$detsta->fej->detstaUzenetSorszam->osszeallitasDatuma = $ugiro->datum;
|
||||||
$detsta->fej->detstaUzenetSorszam->sorszam = $ugiro->number;
|
$detsta->fej->detstaUzenetSorszam->sorszam = $ugiro->number;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$detsta->lab = new GiroDETSTALab();
|
$detsta->lab = new GiroDETSTALab();
|
||||||
|
|
||||||
$tetelek = $ugiro->requests;
|
$tetelek = $ugiro->requests;
|
||||||
/** @var \common\models\TicketInstallmentRequest $tetel */
|
/** @var \common\models\TicketInstallmentRequest $tetel */
|
||||||
foreach ($tetelek as $tetel ){
|
foreach ($tetelek as $tetel) {
|
||||||
$detstaTetel = new GiroDETSTATetel();
|
$detstaTetel = new GiroDETSTATetel();
|
||||||
|
|
||||||
$detstaTetel->tetelSorszam = $tetel->number;
|
$detstaTetel->tetelSorszam = $tetel->number;
|
||||||
$detstaTetel->osszeg = $tetel->money;
|
$detstaTetel->osszeg = $tetel->money;
|
||||||
$detstaTetel->eredetiTetelElszamolasiDatuma = $ugiro->datum;
|
$detstaTetel->eredetiTetelElszamolasiDatuma = $ugiro->datum;
|
||||||
if ( $accepted == "1"){
|
if ($accepted == "1") {
|
||||||
$detstaTetel->visszajelzesInformacio = GiroDETSTATetel::$INFORMACIO_TELJESITETT;
|
$detstaTetel->visszajelzesInformacio = GiroDETSTATetel::$INFORMACIO_TELJESITETT;
|
||||||
}else{
|
} else {
|
||||||
$detstaTetel->visszajelzesInformacio = '50';
|
$detstaTetel->visszajelzesInformacio = '50';
|
||||||
}
|
}
|
||||||
$detstaTetel->feldolgozasDatum = $ugiro->datum;
|
$detstaTetel->feldolgozasDatum = $ugiro->datum;
|
||||||
@ -94,9 +99,58 @@ class DetstaConsoleController extends Controller{
|
|||||||
|
|
||||||
$content = $detsta->toString();
|
$content = $detsta->toString();
|
||||||
|
|
||||||
file_put_contents('c:\tmp\detsta.txt',$content);
|
file_put_contents('c:\tmp\detsta.txt', $content);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recalculate the request target time at filed for ticket_installment_requests,
|
||||||
|
* where request status is pending and contract is active
|
||||||
|
*/
|
||||||
|
public function actionFixContracts()
|
||||||
|
{
|
||||||
|
$query = Contract::find();
|
||||||
|
/** @var /common/models/Contract[] $contracts */
|
||||||
|
$contracts = $query->all();
|
||||||
|
|
||||||
|
/** @var /common/models/Contract $contract */
|
||||||
|
foreach ($contracts as $contract) {
|
||||||
|
if ($contract->isFlagActive()) {
|
||||||
|
|
||||||
|
$requests = $contract->requests;
|
||||||
|
$started_at = $contract->started_at;
|
||||||
|
|
||||||
|
for ( $i = 0; $i < 11; $i++ ){
|
||||||
|
$request = $requests[$i];
|
||||||
|
/** @var /common/models/TicketInstallmentRequest $request */
|
||||||
|
$pending = $request->isStatusPending();
|
||||||
|
if ($pending) {
|
||||||
|
echo "\nContract: ".$contract->id_contract."; Priority:" . $request->priority . "\n";
|
||||||
|
|
||||||
|
$date = \DateTime::createFromFormat("Y-m-d H:i:s", $started_at, new \DateTimeZone( 'UTC'));
|
||||||
|
$date = DateUtil::addMonth($date, $request->priority);
|
||||||
|
$date->setTime(0,0,0);
|
||||||
|
|
||||||
|
echo "\t".$started_at ." - " . $request->priority . " - ".$request->request_target_time_at . " -> " . $date->format ( 'Y-m-d H:i:s' );
|
||||||
|
|
||||||
|
$request->request_target_time_at = $date->format ( 'Y-m-d H:i:s' );
|
||||||
|
|
||||||
|
$saved = $request->save(false);
|
||||||
|
|
||||||
|
if ( $saved ){
|
||||||
|
echo " done" ;
|
||||||
|
}else{
|
||||||
|
echo " failed";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user