Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2024-01-29 11:40:57 +01:00
commit 0815df6bdf
11 changed files with 70 additions and 72 deletions

View file

@ -50,7 +50,7 @@ RUN echo 'xdebug.idekey="netbeans-xdebug"' >> ${PHP_INI_DIR}/php.ini
# set up sendmail config, to use maildev
RUN echo "account default" > /etc/msmtprc
RUN echo "auth off" >> /etc/msmtprc
RUN echo "port 25" >> /etc/msmtprc
RUN echo "port 1025" >> /etc/msmtprc
RUN echo "host mail" >> /etc/msmtprc
RUN echo "from local@localdomain.com" >> /etc/msmtprc
RUN echo "domain localhost.localdomain" >> /etc/msmtprc

View file

@ -55,8 +55,8 @@ services:
mail:
image: maildev/maildev
ports:
- "8081:80"
- "25:25"
- "8081:1080"
- "25:1025"
networks:
- internal-pod
- external-pod

View file

@ -966,7 +966,7 @@ if ($socid > 0) {
print '<td class="nowrap">'.$langs->trans("ConsumedBy").'</td>';
print '<td class="right">'.$langs->trans("AmountHT").'</td>';
if (isModEnabled('multicompany')) {
print '<td class="right toverflowmax125" title="'.dol_escape_htmltag($langs->trans("MulticurrencyAmountHT")).'">'.$langs->trans("MulticurrencyAmountHT").'</td>';
print '<td class="right tdoverflowmax125" title="'.dol_escape_htmltag($langs->trans("MulticurrencyAmountHT")).'">'.$langs->trans("MulticurrencyAmountHT").'</td>';
}
print '<td class="right">'.$langs->trans("VATRate").'</td>';
print '<td class="right">'.$langs->trans("AmountTTC").'</td>';

View file

@ -1644,9 +1644,9 @@ class CMailFile
$filename_list_size = count($filename_list);
for ($i = 0; $i < $filename_list_size; $i++) {
if ($filename_list[$i]) {
dol_syslog("CMailFile::write_files: i=$i");
dol_syslog("CMailFile::write_files: i=$i ".$filename_list[$i]);
$encoded = $this->_encode_file($filename_list[$i]);
if ($encoded >= 0) {
if ($encoded !== -1) {
if ($mimefilename_list[$i]) {
$filename_list[$i] = $mimefilename_list[$i];
}

View file

@ -534,6 +534,9 @@ class Conf extends stdClass
}
// For mycompany storage
$this->mycompany->multidir_output = array($this->entity => $rootfordata."/mycompany");
$this->mycompany->multidir_temp = array($this->entity => $rootfortemp."/mycompany/temp");
// For backward compatibility
$this->mycompany->dir_output = $rootfordata."/mycompany";
$this->mycompany->dir_temp = $rootfortemp."/mycompany/temp";

View file

@ -996,7 +996,7 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0,
/**
* Show footer of page for PDF generation
*
* @param TCPDF $pdf The PDF factory
* @param TCPDF $pdf The PDF factory
* @param Translate $outputlangs Object lang for output
* @param string $paramfreetext Constant name of free text
* @param Societe $fromcompany Object company
@ -1245,7 +1245,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { // by default
$pdf->MultiCell(0, 3, $line, 0, $align, 0);
} else {
$pdf->writeHTMLCell($pdf->page_largeur - $pdf->margin_left - $pdf->margin_right, $freetextheight, $dims['lm'], $dims['hk'] - $marginwithfooter, dol_htmlentitiesbr($line, 1, 'UTF-8', 0));
$pdf->writeHTMLCell($dims['wk'] - $dims['lm'] - $dims['rm'], $freetextheight, $dims['lm'], $dims['hk'] - $marginwithfooter, dol_htmlentitiesbr($line, 1, 'UTF-8', 0));
}
$posy -= $freetextheight;
}
@ -1270,7 +1270,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
if (getDolGlobalInt('PDF_FOOTER_DISABLE_PAGEBREAK') === 1) {
$pdf->SetAutoPageBreak(0, 0);
} // Option for disable auto pagebreak
$pdf->writeHTMLCell($pdf->page_largeur - $pdf->margin_left - $pdf->margin_right, $mycustomfooterheight, $dims['lm'], $dims['hk'] - $posy, dol_htmlentitiesbr($mycustomfooter, 1, 'UTF-8', 0));
$pdf->writeHTMLCell($dims['wk'] - $dims['lm'] - $dims['rm'], $mycustomfooterheight, $dims['lm'], $dims['hk'] - $posy, dol_htmlentitiesbr($mycustomfooter, 1, 'UTF-8', 0));
if (getDolGlobalInt('PDF_FOOTER_DISABLE_PAGEBREAK') === 1) {
$pdf->SetAutoPageBreak(1, 0);
} // Restore pagebreak
@ -1297,7 +1297,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { // by default
$pdf->MultiCell(0, 3, $line, 0, $align, 0);
} else {
$pdf->writeHTMLCell($pdf->page_largeur - $pdf->margin_left - $pdf->margin_right, $freetextheight, $dims['lm'], $dims['hk'] - $marginwithfooter, dol_htmlentitiesbr($line, 1, 'UTF-8', 0));
$pdf->writeHTMLCell($dims['wk'] - $dims['lm'] - $dims['rm'], $freetextheight, $dims['lm'], $dims['hk'] - $marginwithfooter, dol_htmlentitiesbr($line, 1, 'UTF-8', 0));
}
$posy -= $freetextheight;
}

View file

@ -264,11 +264,11 @@ class pdf_crabe extends ModelePDFFactures
// Definition of $dir and $file
if ($object->specimen) {
$dir = empty($conf->facture->multidir_output[$conf->entity]) ? $conf->facture->dir_output : $conf->facture->multidir_output[$conf->entity];
$dir = empty($conf->facture->multidir_output[$object->entity]) ? $conf->facture->dir_output : $conf->facture->multidir_output[$object->entity];
$file = $dir."/SPECIMEN.pdf";
} else {
$objectref = dol_sanitizeFileName($object->ref);
$dir = (empty($conf->facture->multidir_output[$conf->entity]) ? $conf->facture->dir_output : $conf->facture->multidir_output[$conf->entity])."/".$objectref;
$dir = (empty($conf->facture->multidir_output[$object->entity]) ? $conf->facture->dir_output : $conf->facture->multidir_output[$object->entity])."/".$objectref;
$file = $dir."/".$objectref.".pdf";
}
if (!file_exists($dir)) {

View file

@ -2192,7 +2192,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
print '<tr class="oddeven">';
print "<td>".$staticsoc->getNomUrl(1)."</td>";
print '<td class="tdoverflowmax125">'.$staticsoc->getNomUrl(1)."</td>";
print '<td>'.$line->ref_customer.'</td>';
print "<td>".dol_print_date($line->datec, "dayhour", 'tzuserrel')."</td>";
print '<td class="center">'.$langs->trans($line->price_base_type)."</td>";
@ -2308,10 +2308,10 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
$pu = $object->price_ttc;
}
// Local tax was not saved into table llx_product on old version. So we will use value linked to VAT code.
// Local tax was not saved into table llx_product on old versions. So we will use the value linked to the VAT code.
$localtaxarray = getLocalTaxesFromRate($object->tva_tx.($object->default_vat_code ? ' ('.$object->default_vat_code.')' : ''), 0, $mysoc, $mysoc);
// Define part of HT, VAT, TTC
$resultarray = calcul_price_total(1, $pu, 0, $object->tva_tx, 1, 1, 0, $object->price_base_type, $object->recuperableonly, $object->type, $mysoc, $localtaxarray);
$resultarray = calcul_price_total(1, $pu, 0, $object->tva_tx, 1, 1, 0, $object->price_base_type, 0, $object->type, $mysoc, $localtaxarray);
// Calcul du total ht sans remise
$total_ht = $resultarray[0];
$total_vat = $resultarray[1];
@ -2399,7 +2399,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
print '<tr class="oddeven">';
print "<td>".$staticsoc->getNomUrl(1)."</td>";
print '<td class="tdoverflowmax125">'.$staticsoc->getNomUrl(1)."</td>";
print '<td>'.dol_escape_htmltag($line->ref_customer).'</td>';
print "<td>".dol_print_date($line->datec, "dayhour", 'tzuserrel')."</td>";
print '<td class="center">'.$langs->trans($line->price_base_type)."</td>";

View file

@ -158,36 +158,6 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
// Definition of fields for list
$arrayfields = array();
$arrayfields['t.element_date'] = array('label'=>$langs->trans("Date"), 'checked'=>1);
$arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1','checked'=>1);
$arrayfields['s.name_alias'] = array('label'=>$langs->trans("AliasNameShort"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1');
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
if (! empty($allprojectforuser)) {
$arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1];
$arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1];
}
$arrayfields['t.element_ref'] = array('label'=>$langs->trans("RefTask"), 'checked'=>1);
$arrayfields['t.element_label'] = array('label'=>$langs->trans("LabelTask"), 'checked'=>1);
}
$arrayfields['author'] = array('label' => $langs->trans("By"), 'checked' => 1);
$arrayfields['t.note'] = array('label' => $langs->trans("Note"), 'checked' => 1);
if (!getDolGlobalInt('PROJECT_HIDE_TASKS') && getDolGlobalInt('PROJECT_BILL_TIME_SPENT') && !$projectstatic->usage_bill_time ) {
$projectstatic->usage_bill_time=1;
}
if (isModEnabled('service') && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) {
$arrayfields['t.fk_product'] = array('label' => $langs->trans("Product"), 'checked' => 1);
}
$arrayfields['t.element_duration'] = array('label'=>$langs->trans("Duration"), 'checked'=>1);
$arrayfields['value'] = array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>isModEnabled("salaries"));
$arrayfields['valuebilled'] = array('label'=>$langs->trans("Billed"), 'checked'=>1, 'enabled'=>(((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time));
// Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
$arrayfields = dol_sort_array($arrayfields, 'position');
$parameters = array('socid' => $socid, 'projectid' => $projectid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
@ -1296,7 +1266,31 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// Print form confirm
print $formconfirm;
// Definition of fields for list
$arrayfields = array();
$arrayfields['t.element_date'] = array('label'=>$langs->trans("Date"), 'checked'=>1);
$arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1','checked'=>1);
$arrayfields['s.name_alias'] = array('label'=>$langs->trans("AliasNameShort"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1');
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
if (! empty($allprojectforuser)) {
$arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1];
$arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1];
}
$arrayfields['t.element_ref'] = array('label'=>$langs->trans("RefTask"), 'checked'=>1);
$arrayfields['t.element_label'] = array('label'=>$langs->trans("LabelTask"), 'checked'=>1);
}
$arrayfields['author'] = array('label' => $langs->trans("By"), 'checked' => 1);
$arrayfields['t.note'] = array('label' => $langs->trans("Note"), 'checked' => 1);
if (isModEnabled('service') && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) {
$arrayfields['t.fk_product'] = array('label' => $langs->trans("Product"), 'checked' => 1);
}
$arrayfields['t.element_duration'] = array('label'=>$langs->trans("Duration"), 'checked'=>1);
$arrayfields['value'] = array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>isModEnabled("salaries"));
$arrayfields['valuebilled'] = array('label'=>$langs->trans("Billed"), 'checked'=>1, 'enabled'=>(((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time));
// Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
$arrayfields = dol_sort_array($arrayfields, 'position');
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
@ -1840,8 +1834,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
if (isModEnabled("service") && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) {
print '<td class="nowraponall">';
print img_picto('', 'product');
print $form->select_produits('', 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1);
print img_picto('', 'service');
print $form->select_produits((GETPOSTISSET('fk_product')?GETPOST("fk_product", 'int'):''), 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1);
print '</td>';
}
}
@ -2345,9 +2339,10 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// Product
if (!empty($arrayfields['t.fk_product']['checked'])) {
print '<td class="nowraponall tdoverflowmax125">';
print '<td class="nowraponall">';
if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) {
$form->select_produits($task_time->fk_product, 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500');
print img_picto('', 'service');
print $form->select_produits($task_time->fk_product, 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500', 0, '', null, 1);
} elseif (!empty($task_time->fk_product)) {
$product = new Product($db);
$resultFetch = $product->fetch($task_time->fk_product);

View file

@ -436,13 +436,13 @@ if ($ispaymentok) {
if ($result1 > 0 && $result2 > 0) {
$paymentTypeId = 0;
if ($paymentmethod == 'paybox') {
$paymentTypeId = getDolGlobalString('PAYBOX_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('PAYBOX_PAYMENT_MODE_FOR_PAYMENTS');
}
if ($paymentmethod == 'paypal') {
$paymentTypeId = getDolGlobalString('PAYPAL_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('PAYPAL_PAYMENT_MODE_FOR_PAYMENTS');
}
if ($paymentmethod == 'stripe') {
$paymentTypeId = getDolGlobalString('STRIPE_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('STRIPE_PAYMENT_MODE_FOR_PAYMENTS');
}
if (empty($paymentTypeId)) {
dol_syslog("paymentType = ".$paymentType, LOG_DEBUG, 0, '_payment');
@ -843,13 +843,13 @@ if ($ispaymentok) {
$paymentTypeId = 0;
if ($paymentmethod === 'paybox') {
$paymentTypeId = getDolGlobalString('PAYBOX_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('PAYBOX_PAYMENT_MODE_FOR_PAYMENTS');
}
if ($paymentmethod === 'paypal') {
$paymentTypeId = getDolGlobalString('PAYPAL_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('PAYPAL_PAYMENT_MODE_FOR_PAYMENTS');
}
if ($paymentmethod === 'stripe') {
$paymentTypeId = getDolGlobalString('STRIPE_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('STRIPE_PAYMENT_MODE_FOR_PAYMENTS');
}
if (empty($paymentTypeId)) {
dol_syslog("paymentType = ".$paymentType, LOG_DEBUG, 0, '_payment');
@ -969,13 +969,13 @@ if ($ispaymentok) {
$paymentTypeId = 0;
if ($paymentmethod == 'paybox') {
$paymentTypeId = getDolGlobalString('PAYBOX_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('PAYBOX_PAYMENT_MODE_FOR_PAYMENTS');
}
if ($paymentmethod == 'paypal') {
$paymentTypeId = getDolGlobalString('PAYPAL_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('PAYPAL_PAYMENT_MODE_FOR_PAYMENTS');
}
if ($paymentmethod == 'stripe') {
$paymentTypeId = getDolGlobalString('STRIPE_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('STRIPE_PAYMENT_MODE_FOR_PAYMENTS');
}
if (empty($paymentTypeId)) {
dol_syslog("paymentType = ".$paymentType, LOG_DEBUG, 0, '_payment');
@ -1103,13 +1103,13 @@ if ($ispaymentok) {
if ($result) {
$paymentTypeId = 0;
if ($paymentmethod == 'paybox') {
$paymentTypeId = getDolGlobalString('PAYBOX_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('PAYBOX_PAYMENT_MODE_FOR_PAYMENTS');
}
if ($paymentmethod == 'paypal') {
$paymentTypeId = getDolGlobalString('PAYPAL_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS');
}
if ($paymentmethod == 'stripe') {
$paymentTypeId = getDolGlobalString('STRIPE_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('STRIPE_PAYMENT_MODE_FOR_PAYMENTS');
}
if (empty($paymentTypeId)) {
dol_syslog("paymentType = ".$paymentType, LOG_DEBUG, 0, '_payment');
@ -1235,13 +1235,13 @@ if ($ispaymentok) {
if ($result) {
$paymentTypeId = 0;
if ($paymentmethod == 'paybox') {
$paymentTypeId = getDolGlobalString('PAYBOX_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('PAYBOX_PAYMENT_MODE_FOR_PAYMENTS');
}
if ($paymentmethod == 'paypal') {
$paymentTypeId = getDolGlobalString('PAYPAL_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('PAYPAL_PAYMENT_MODE_FOR_PAYMENTS');
}
if ($paymentmethod == 'stripe') {
$paymentTypeId = getDolGlobalString('STRIPE_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('STRIPE_PAYMENT_MODE_FOR_PAYMENTS');
}
if (empty($paymentTypeId)) {
dol_syslog("paymentType = ".$paymentType, LOG_DEBUG, 0, '_payment');
@ -1465,13 +1465,13 @@ if ($ispaymentok) {
$paymentTypeId = 0;
if ($paymentmethod == 'paybox') {
$paymentTypeId = getDolGlobalString('PAYBOX_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('PAYBOX_PAYMENT_MODE_FOR_PAYMENTS');
}
if ($paymentmethod == 'paypal') {
$paymentTypeId = getDolGlobalString('PAYPAL_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('PAYPAL_PAYMENT_MODE_FOR_PAYMENTS');
}
if ($paymentmethod == 'stripe') {
$paymentTypeId = getDolGlobalString('STRIPE_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('STRIPE_PAYMENT_MODE_FOR_PAYMENTS');
}
if (empty($paymentTypeId)) {
dol_syslog("paymentType = ".$paymentType, LOG_DEBUG, 0, '_payment');
@ -1674,13 +1674,13 @@ if ($ispaymentok) {
$paymentTypeId = 0;
if ($paymentmethod == 'paybox') {
$paymentTypeId = getDolGlobalString('PAYBOX_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('PAYBOX_PAYMENT_MODE_FOR_PAYMENTS');
}
if ($paymentmethod == 'paypal') {
$paymentTypeId = getDolGlobalString('PAYPAL_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('PAYPAL_PAYMENT_MODE_FOR_PAYMENTS');
}
if ($paymentmethod == 'stripe') {
$paymentTypeId = getDolGlobalString('STRIPE_PAYMENT_MODE_FOR_PAYMENTS');
$paymentTypeId = getDolGlobalInt('STRIPE_PAYMENT_MODE_FOR_PAYMENTS');
}
if (empty($paymentTypeId)) {
dol_syslog("paymentType = ".$paymentType, LOG_DEBUG, 0, '_payment');

View file

@ -1679,7 +1679,7 @@ while ($i < $imaxinloop) {
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
$companystatic->fk_prospectlevel = $obj->fk_prospectlevel;
$companystatic->fk_parent = $obj->fk_parent;
$companystatic->parent = $obj->fk_parent;
$companystatic->entity = $obj->entity;
$object = $companystatic;