bug fix in person generate codes

This commit is contained in:
Hesabix 2025-05-13 12:45:44 +00:00
parent 8618f90274
commit 78f296cdcf
4 changed files with 45 additions and 7 deletions

View file

@ -123,7 +123,17 @@ class PersonsController extends AbstractController
//check exist before
if (!$person) {
$person = new Person();
$person->setCode($provider->getAccountingCode($acc['bid'], 'person'));
$code = $provider->getAccountingCode($acc['bid'], 'person');
$exist = $entityManager->getRepository(Person::class)->findOneBy([
'code' => $code
]);
while ($exist) {
$code = $provider->getAccountingCode($acc['bid'], 'person');
$exist = $entityManager->getRepository(Person::class)->findOneBy([
'code' => $code
]);
}
$person->setCode($code);
}
} else {
@ -259,7 +269,17 @@ class PersonsController extends AbstractController
//check exist before
if (!$person) {
$person = new Person();
$person->setCode($provider->getAccountingCode($acc['bid'], 'person'));
$code = $provider->getAccountingCode($acc['bid'], 'person');
$exist = $entityManager->getRepository(Person::class)->findOneBy([
'code' => $code
]);
while ($exist) {
$code = $provider->getAccountingCode($acc['bid'], 'person');
$exist = $entityManager->getRepository(Person::class)->findOneBy([
'code' => $code
]);
}
$person->setCode($code);
}
} else {
@ -1397,7 +1417,17 @@ class PersonsController extends AbstractController
//check exist before
if (!$person) {
$person = new Person();
$person->setCode($provider->getAccountingCode($acc['bid'], 'person'));
$code = $provider->getAccountingCode($acc['bid'], 'person');
$exist = $entityManager->getRepository(Person::class)->findOneBy([
'code' => $code
]);
while ($exist) {
$code = $provider->getAccountingCode($acc['bid'], 'person');
$exist = $entityManager->getRepository(Person::class)->findOneBy([
'code' => $code
]);
}
$person->setCode($code);
$person->setNikename($item[0]);
$person->setBid($acc['bid']);

View file

@ -77,10 +77,7 @@ class Access
if (!$money) { return false; }
}
else{
$money = $this->em->getRepository(Money::class)->findOneBy([
'name' => $bid->getMoney(),
]);
if (!$money) { return false; }
$money = $bid->getMoney();
}
$accessArray = [

View file

@ -96,6 +96,7 @@ class Provider
return $count;
}
/**
* @throws ReflectionException
*/

View file

@ -3,6 +3,7 @@
<v-tabs v-model="activeTab" color="primary" grow>
<v-tab value="personal" :text="$t('tabs.personal_info')"></v-tab>
<v-tab value="marketing" :text="$t('tabs.marketing_info')"></v-tab>
<v-tab value="suggestions">{{ $t('tabs.suggestions') }}</v-tab>
</v-tabs>
<v-window v-model="activeTab">
@ -108,6 +109,15 @@
</v-card-text>
</v-card>
</v-window-item>
<!-- تب پیشنهادات -->
<v-window-item value="suggestions">
<v-card class="ma-4">
<v-card-text>
<!-- این بخش فعلاً خالی است -->
</v-card-text>
</v-card>
</v-window-item>
</v-window>
<!-- دیالوگها -->