Merge pull request #5424 from atm-florian/dev_fix5353
NEW #5353 IBAN and BIC should be now always mandatory for all country regarding accounting managment
This commit is contained in:
commit
6d0ebbc4a3
@ -187,7 +187,9 @@
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
<rule ref="PEAR.Commenting.ClassComment.MissingTag" />
|
||||
<rule ref="PEAR.Commenting.ClassComment.MissingTag">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
<rule ref="PEAR.Commenting.ClassComment.MissingAuthorTag">
|
||||
<severity>0</severity>
|
||||
|
||||
@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php';
|
||||
* Class Skeleton_Class
|
||||
*
|
||||
* Put here description of your class
|
||||
*
|
||||
* @see CommonObject
|
||||
*/
|
||||
class Skeleton_Class extends CommonObject
|
||||
@ -228,7 +229,7 @@ class Skeleton_Class extends CommonObject
|
||||
if (count($sqlwhere) > 0) {
|
||||
$sql .= ' WHERE ' . implode(' '.$filtermode.' ', $sqlwhere);
|
||||
}
|
||||
|
||||
|
||||
if (!empty($sortfield)) {
|
||||
$sql .= $this->db->order($sortfield,$sortorder);
|
||||
}
|
||||
@ -463,7 +464,7 @@ class Skeleton_Class extends CommonObject
|
||||
$result.= $link . $this->ref . $linkend;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retourne le libelle du status d'un user (actif, inactif)
|
||||
*
|
||||
@ -518,8 +519,8 @@ class Skeleton_Class extends CommonObject
|
||||
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Initialise object with example values
|
||||
* Id must be 0 if object instance is a specimen
|
||||
|
||||
@ -258,6 +258,10 @@ class Account extends CommonObject
|
||||
$string .= $this->code_guichet.' ';
|
||||
} elseif ($val == 'BankAccountNumberKey') {
|
||||
$string .= $this->cle_rib.' ';
|
||||
}elseif ($val == 'BIC') {
|
||||
$string .= $this->bic.' ';
|
||||
}elseif ($val == 'IBAN') {
|
||||
$string .= $this->iban.' ';
|
||||
}
|
||||
}
|
||||
|
||||
@ -1151,9 +1155,9 @@ class Account extends CommonObject
|
||||
if ($user->societe_id) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
$nb=0;
|
||||
|
||||
|
||||
$sql = "SELECT COUNT(ba.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
|
||||
$sql.= " WHERE ba.rappro > 0 and ba.clos = 0";
|
||||
@ -1169,7 +1173,7 @@ class Account extends CommonObject
|
||||
|
||||
return $nb;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
*
|
||||
@ -1204,7 +1208,7 @@ class Account extends CommonObject
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/compta/bank/releve.php?account='.$this->id.$linkclose;
|
||||
$linkend='</a>';
|
||||
}
|
||||
|
||||
|
||||
if ($withpicto) $result.=($link.img_object($label, 'account', 'class="classfortooltip"').$linkend.' ');
|
||||
$result.=$link.$this->label.$linkend;
|
||||
return $result;
|
||||
@ -1293,6 +1297,55 @@ class Account extends CommonObject
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return 1 is IBAN is need for UE country
|
||||
*
|
||||
* @return int 1 yes / 0 No
|
||||
*/
|
||||
function needIBAN()
|
||||
{
|
||||
$country_code=$this->getCountryCode();
|
||||
|
||||
$country_code_in_EEC=array(
|
||||
'AT', // Austria
|
||||
'BE', // Belgium
|
||||
'BG', // Bulgaria
|
||||
'CY', // Cyprus
|
||||
'CZ', // Czech republic
|
||||
'DE', // Germany
|
||||
'DK', // Danemark
|
||||
'EE', // Estonia
|
||||
'ES', // Spain
|
||||
'FI', // Finland
|
||||
'FR', // France
|
||||
'GB', // United Kingdom
|
||||
'GR', // Greece
|
||||
'HR', // Croatia
|
||||
'NL', // Holland
|
||||
'HU', // Hungary
|
||||
'IE', // Ireland
|
||||
'IM', // Isle of Man - Included in UK
|
||||
'IT', // Italy
|
||||
'LT', // Lithuania
|
||||
'LU', // Luxembourg
|
||||
'LV', // Latvia
|
||||
'MC', // Monaco - Included in France
|
||||
'MT', // Malta
|
||||
//'NO', // Norway
|
||||
'PL', // Poland
|
||||
'PT', // Portugal
|
||||
'RO', // Romania
|
||||
'SE', // Sweden
|
||||
'SK', // Slovakia
|
||||
'SI', // Slovenia
|
||||
'UK', // United Kingdom
|
||||
//'CH', // Switzerland - No. Swizerland in not in EEC
|
||||
);
|
||||
|
||||
if (in_array($country_code,$country_code_in_EEC)) return 1; // France, Spain, Gabon, ...
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load miscellaneous information for tab "Info"
|
||||
*
|
||||
@ -1323,18 +1376,26 @@ class Account extends CommonObject
|
||||
$detailedBBAN = $this->useDetailedBBAN();
|
||||
|
||||
if ($detailedBBAN == 0) {
|
||||
return array(
|
||||
'BankAccountNumber'
|
||||
$fieldarray= array(
|
||||
'BankAccountNumber'
|
||||
);
|
||||
} elseif ($detailedBBAN == 2) {
|
||||
return array(
|
||||
'BankCode',
|
||||
'BankAccountNumber'
|
||||
$fieldarray= array(
|
||||
'BankCode',
|
||||
'BankAccountNumber'
|
||||
);
|
||||
} else {
|
||||
$fieldarray=self::getAccountNumberOrder();
|
||||
}
|
||||
|
||||
if ($this->needIBAN()) {
|
||||
$fieldarray[]='IBAN';
|
||||
$fieldarray[]='BIC';
|
||||
}
|
||||
|
||||
//Get the order the properties are shown
|
||||
return self::getAccountNumberOrder();
|
||||
return $fieldarray;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1352,10 +1413,10 @@ class Account extends CommonObject
|
||||
global $conf;
|
||||
|
||||
$fieldlists = array(
|
||||
'BankCode',
|
||||
'DeskCode',
|
||||
'BankAccountNumber',
|
||||
'BankAccountNumberKey'
|
||||
'BankCode',
|
||||
'DeskCode',
|
||||
'BankAccountNumber',
|
||||
'BankAccountNumberKey'
|
||||
);
|
||||
|
||||
if (!empty($conf->global->BANK_SHOW_ORDER_OPTION)) {
|
||||
|
||||
@ -292,7 +292,7 @@ function pdf_getHeightForLogo($logo, $url = false)
|
||||
|
||||
/**
|
||||
* Function to try to calculate height of a HTML Content
|
||||
*
|
||||
*
|
||||
* @param TCPDF $pdf PDF initialized object
|
||||
* @param string $htmlcontent HTML Contect
|
||||
* @see getStringHeight
|
||||
@ -315,7 +315,7 @@ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent)
|
||||
if ($end_page == $start_page) {
|
||||
$height = $end_y - $start_y;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
for ($page=$start_page; $page <= $end_page; ++$page) {
|
||||
$pdf->setPage($page);
|
||||
@ -331,7 +331,7 @@ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent)
|
||||
}
|
||||
}
|
||||
// restore previous object
|
||||
$pdf = $pdf->rollbackTransaction();
|
||||
$pdf = $pdf->rollbackTransaction();
|
||||
|
||||
return $height;
|
||||
}
|
||||
@ -404,9 +404,9 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
{
|
||||
$withCountry = 0;
|
||||
if (!empty($sourcecompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) $withCountry = 1;
|
||||
|
||||
|
||||
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($sourcecompany, $withCountry, "\n", $outputlangs))."\n";
|
||||
|
||||
|
||||
if (empty($conf->global->MAIN_PDF_DISABLESOURCEDETAILS))
|
||||
{
|
||||
// Phone
|
||||
@ -419,13 +419,13 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
if ($sourcecompany->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($sourcecompany->url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($mode == 'target' || preg_match('/targetwithdetails/',$mode))
|
||||
{
|
||||
if ($usecontact)
|
||||
{
|
||||
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs,1));
|
||||
|
||||
|
||||
if (!empty($targetcontact->address)) {
|
||||
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcontact))."\n";
|
||||
}else {
|
||||
@ -438,7 +438,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
else if (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) {
|
||||
$stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code))."\n";
|
||||
}
|
||||
|
||||
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/',$mode))
|
||||
{
|
||||
// Phone
|
||||
@ -471,7 +471,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcompany))."\n";
|
||||
// Country
|
||||
if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code))."\n";
|
||||
|
||||
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/',$mode))
|
||||
{
|
||||
// Phone
|
||||
@ -499,13 +499,13 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Intra VAT
|
||||
if (empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS))
|
||||
{
|
||||
if ($targetcompany->tva_intra) $stringaddress.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($targetcompany->tva_intra);
|
||||
}
|
||||
|
||||
|
||||
// Professionnal Ids
|
||||
if (! empty($conf->global->MAIN_PROFID1_IN_ADDRESS) && ! empty($targetcompany->idprof1))
|
||||
{
|
||||
@ -543,7 +543,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1];
|
||||
$stringaddress.="\n".$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof6);
|
||||
}
|
||||
|
||||
|
||||
// Public note
|
||||
if (! empty($conf->global->MAIN_PUBLIC_NOTE_IN_ADDRESS))
|
||||
{
|
||||
@ -558,7 +558,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $stringaddress;
|
||||
}
|
||||
|
||||
@ -641,7 +641,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
|
||||
global $mysoc, $conf;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbank.class.php';
|
||||
|
||||
|
||||
$diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE);
|
||||
$diffsizecontent=(empty($conf->global->PDF_DIFFSIZE_CONTENT)?4:$conf->global->PDF_DIFFSIZE_CONTENT);
|
||||
$pdf->SetXY($curx, $cury);
|
||||
@ -683,7 +683,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
|
||||
// number = account number
|
||||
// key = check control key used only when $usedetailedbban = 1
|
||||
if (empty($onlynumber)) $pdf->line($curx+1, $cury+1, $curx+1, $cury+6);
|
||||
|
||||
|
||||
|
||||
foreach ($account->getFieldsToShow() as $val)
|
||||
{
|
||||
@ -706,8 +706,12 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
|
||||
// Key
|
||||
$tmplength = 13;
|
||||
$content = $account->cle_rib;
|
||||
}elseif ($val == 'IBAN' || $val == 'BIC') {
|
||||
// Key
|
||||
$tmplength = 0;
|
||||
$content = '';
|
||||
} else {
|
||||
dol_print_error($this->db, 'Unexpected value for getFieldsToShow: '.$val);
|
||||
dol_print_error($account->db, 'Unexpected value for getFieldsToShow: '.$val);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -720,7 +724,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
|
||||
$pdf->line($curx, $cury + 1, $curx, $cury + 7);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$curx=$savcurx;
|
||||
$cury+=8;
|
||||
}
|
||||
@ -1054,7 +1058,7 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$al
|
||||
{
|
||||
$reftoshow .= ' / '.$linkedobject["date_value"];
|
||||
}
|
||||
|
||||
|
||||
$posy+=3;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
@ -1095,7 +1099,7 @@ function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hide
|
||||
$parameters = array('pdf'=>$pdf,'i'=>$i,'outputlangs'=>$outputlangs,'w'=>$w,'h'=>$h,'posx'=>$posx,'posy'=>$posy,'hideref'=>$hideref,'hidedesc'=>$hidedesc,'issupplierline'=>$issupplierline,'special_code'=>$special_code);
|
||||
$action='';
|
||||
$reshook=$hookmanager->executeHooks('pdf_writelinedesc',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
|
||||
if (!empty($hookmanager->resPrint)) $result.=$hookmanager->resPrint;
|
||||
}
|
||||
if (empty($reshook))
|
||||
@ -1415,7 +1419,7 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0)
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlinevatrate',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
|
||||
if (!empty($hookmanager->resPrint)) $result.=$hookmanager->resPrint;
|
||||
}
|
||||
if (empty($reshook))
|
||||
@ -1451,12 +1455,12 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0)
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineupexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
|
||||
if (!empty($hookmanager->resPrint)) $result.=$hookmanager->resPrint;
|
||||
}
|
||||
if (empty($reshook))
|
||||
{
|
||||
if (empty($hidedetails) || $hidedetails > 1)
|
||||
if (empty($hidedetails) || $hidedetails > 1)
|
||||
{
|
||||
$subprice = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_subprice : $object->lines[$i]->subprice);
|
||||
$result.=price($sign * $subprice, 0, $outputlangs);
|
||||
@ -1491,7 +1495,7 @@ function pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails=0)
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineupwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
|
||||
if (!empty($hookmanager->resPrint)) $result.=$hookmanager->resPrint;
|
||||
}
|
||||
if (empty($reshook))
|
||||
@ -1524,7 +1528,7 @@ function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0)
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineqty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
|
||||
if(!empty($hookmanager->resPrint)) $result=$hookmanager->resPrint;
|
||||
}
|
||||
if (empty($reshook))
|
||||
@ -1558,7 +1562,7 @@ function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0)
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineqty_asked',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
|
||||
if (!empty($hookmanager->resPrint)) $result.=$hookmanager->resPrint;
|
||||
}
|
||||
if (empty($reshook))
|
||||
@ -1592,7 +1596,7 @@ function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0)
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineqty_shipped',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
|
||||
if(!empty($hookmanager->resPrint)) $result.=$hookmanager->resPrint;
|
||||
}
|
||||
if (empty($reshook))
|
||||
@ -1626,7 +1630,7 @@ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0)
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineqty_keeptoship',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
|
||||
if(!empty($hookmanager->resPrint)) $result.=$hookmanager->resPrint;
|
||||
}
|
||||
if (empty($reshook))
|
||||
@ -1650,7 +1654,7 @@ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0)
|
||||
function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = false)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
||||
$reshook=0;
|
||||
$result='';
|
||||
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) )
|
||||
@ -1668,7 +1672,7 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanag
|
||||
);
|
||||
$action = '';
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineunit', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
|
||||
if(!empty($hookmanager->resPrint)) $result.=$hookmanager->resPrint;
|
||||
}
|
||||
if (empty($reshook))
|
||||
@ -1705,7 +1709,7 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0)
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineremisepercent',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
|
||||
if(!empty($hookmanager->resPrint)) $result.=$hookmanager->resPrint;
|
||||
}
|
||||
if (empty($reshook))
|
||||
@ -1738,7 +1742,7 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm
|
||||
$parameters = array('i' => $i, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails, 'special_code' => $special_code);
|
||||
$action = '';
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineprogress', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
|
||||
if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint;
|
||||
}
|
||||
if (empty($reshook))
|
||||
@ -1775,7 +1779,7 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0)
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code, 'sign'=>$sign);
|
||||
$action='';
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlinetotalexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
|
||||
if(!empty($hookmanager->resPrint)) $result.=$hookmanager->resPrint;
|
||||
}
|
||||
if (empty($reshook))
|
||||
@ -1819,7 +1823,7 @@ function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0)
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlinetotalwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
|
||||
if(!empty($hookmanager->resPrint)) $result.=$hookmanager->resPrint;
|
||||
}
|
||||
if (empty($reshook))
|
||||
@ -1895,7 +1899,7 @@ function pdf_getLinkedObjects($object,$outputlangs)
|
||||
$linkedobjects=array();
|
||||
|
||||
$object->fetchObjectLinked();
|
||||
|
||||
|
||||
foreach($object->linkedObjects as $objecttype => $objects)
|
||||
{
|
||||
if ($objecttype == 'facture')
|
||||
@ -1955,7 +1959,7 @@ function pdf_getLinkedObjects($object,$outputlangs)
|
||||
if (! empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'].=' / ';
|
||||
$linkedobjects[$objecttype]['ref_value'].= $outputlangs->transnoentities($elementobject->ref);
|
||||
//$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateShipment");
|
||||
//if (! empty($linkedobjects[$objecttype]['date_value'])) $linkedobjects[$objecttype]['date_value'].=' / ';
|
||||
//if (! empty($linkedobjects[$objecttype]['date_value'])) $linkedobjects[$objecttype]['date_value'].=' / ';
|
||||
//$linkedobjects[$objecttype]['date_value'].= dol_print_date($elementobject->date_delivery,'day','',$outputlangs);
|
||||
}
|
||||
else
|
||||
|
||||
@ -200,7 +200,7 @@ class mailing_advthirdparties extends MailingTargets
|
||||
* For example if this selector is used to extract 500 different
|
||||
* emails from a text file, this function must return 500.
|
||||
*
|
||||
* @param string $sql Sql request to use
|
||||
* @param string $sql Not use here
|
||||
* @return int Nb of recipients
|
||||
*/
|
||||
function getNbOfRecipients($sql='')
|
||||
|
||||
@ -233,7 +233,7 @@ class CompanyBankAccount extends Account
|
||||
{
|
||||
$rib = '';
|
||||
|
||||
if ($this->code_banque || $this->code_guichet || $this->number || $this->cle_rib) {
|
||||
if ($this->code_banque || $this->code_guichet || $this->number || $this->cle_rib || $this->iban || $this->bic ) {
|
||||
|
||||
if ($this->label && $displayriblabel) {
|
||||
$rib = $this->label." : ";
|
||||
|
||||
@ -365,7 +365,7 @@ class Societe extends CommonObject
|
||||
// Multicurrency
|
||||
var $fk_multicurrency;
|
||||
var $multicurrency_code;
|
||||
|
||||
|
||||
/**
|
||||
* To contains a clone of this when we need to save old properties of object
|
||||
* @var Societe
|
||||
@ -414,14 +414,14 @@ class Societe extends CommonObject
|
||||
if (empty($this->client)) $this->client=0;
|
||||
if (empty($this->fournisseur)) $this->fournisseur=0;
|
||||
$this->import_key = trim($this->import_key);
|
||||
|
||||
|
||||
if (!empty($this->multicurrency_code)) $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||
if (empty($this->fk_multicurrency))
|
||||
{
|
||||
$this->multicurrency_code = '';
|
||||
$this->fk_multicurrency = 0;
|
||||
}
|
||||
|
||||
|
||||
dol_syslog(get_class($this)."::create ".$this->name);
|
||||
|
||||
// Check parameters
|
||||
@ -853,7 +853,7 @@ class Societe extends CommonObject
|
||||
$sql .= ",mode_reglement_supplier = ".(! empty($this->mode_reglement_supplier_id)?"'".$this->db->escape($this->mode_reglement_supplier_id)."'":"null");
|
||||
$sql .= ",cond_reglement_supplier = ".(! empty($this->cond_reglement_supplier_id)?"'".$this->db->escape($this->cond_reglement_supplier_id)."'":"null");
|
||||
$sql .= ",fk_shipping_method = ".(! empty($this->shipping_method_id)?"'".$this->db->escape($this->shipping_method_id)."'":"null");
|
||||
|
||||
|
||||
$sql .= ",client = " . (! empty($this->client)?$this->client:0);
|
||||
$sql .= ",fournisseur = " . (! empty($this->fournisseur)?$this->fournisseur:0);
|
||||
$sql .= ",barcode = ".(! empty($this->barcode)?"'".$this->db->escape($this->barcode)."'":"null");
|
||||
@ -1063,7 +1063,7 @@ class Societe extends CommonObject
|
||||
else if ($idprof4) $sql .= " WHERE s.idprof4 = '".$this->db->escape($idprof4)."' AND s.entity IN (".getEntity($this->element, 1).")";
|
||||
else if ($idprof5) $sql .= " WHERE s.idprof5 = '".$this->db->escape($idprof5)."' AND s.entity IN (".getEntity($this->element, 1).")";
|
||||
else if ($idprof6) $sql .= " WHERE s.idprof6 = '".$this->db->escape($idprof6)."' AND s.entity IN (".getEntity($this->element, 1).")";
|
||||
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
dol_syslog(get_class($this)."::fetch ".$sql);
|
||||
if ($resql)
|
||||
@ -1910,10 +1910,10 @@ class Societe extends CommonObject
|
||||
$linkclose='';
|
||||
if (empty($notooltip))
|
||||
{
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowCompany");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.=' class="classfortooltip"';
|
||||
@ -2216,6 +2216,7 @@ class Societe extends CommonObject
|
||||
function display_rib($mode='label')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
|
||||
|
||||
$bac = new CompanyBankAccount($this->db);
|
||||
$bac->fetch(0,$this->id);
|
||||
|
||||
@ -2227,6 +2228,7 @@ class Societe extends CommonObject
|
||||
{
|
||||
if (empty($bac->rum))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/prelevement/class/bonprelevement.class.php';
|
||||
$prelevement = new BonPrelevement($this->db);
|
||||
$bac->fetch_thirdparty();
|
||||
$bac->rum = $prelevement->buildRumNumber($bac->thirdparty->code_client, $bac->datec, $bac->id);
|
||||
@ -3159,7 +3161,7 @@ class Societe extends CommonObject
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if we must use revenue stamps feature or not according to country (country of $mysocin most cases).
|
||||
*
|
||||
@ -3388,7 +3390,7 @@ class Societe extends CommonObject
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create a document onto disk according to template module.
|
||||
*
|
||||
@ -3423,8 +3425,8 @@ class Societe extends CommonObject
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Sets object to supplied categories.
|
||||
*
|
||||
@ -3499,13 +3501,11 @@ class Societe extends CommonObject
|
||||
* Thirdparty commercials cannot be the same in both thirdparties so we look for them and remove some
|
||||
* Because this function is meant to be executed within a transaction, we won't take care of it.
|
||||
*/
|
||||
$sql = 'SELECT rowid
|
||||
FROM '.MAIN_DB_PREFIX.'societe_commerciaux
|
||||
WHERE fk_soc = '.(int) $dest_id.' AND fk_user IN (
|
||||
SELECT fk_user
|
||||
FROM '.MAIN_DB_PREFIX.'societe_commerciaux
|
||||
WHERE fk_soc = '.(int) $origin_id.'
|
||||
);';
|
||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'societe_commerciaux ';
|
||||
$sql .= ' WHERE fk_soc = '.(int) $dest_id.' AND fk_user IN ( ';
|
||||
$sql = ' SELECT fk_user ';
|
||||
$sql = ' FROM '.MAIN_DB_PREFIX.'societe_commerciaux ';
|
||||
$sql = ' WHERE fk_soc = '.(int) $origin_id.') ';
|
||||
|
||||
$query = $db->query($sql);
|
||||
|
||||
|
||||
@ -59,43 +59,73 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
// Modification
|
||||
$account = new CompanyBankAccount($db);
|
||||
|
||||
$account->fetch($id);
|
||||
|
||||
$account->socid = $object->id;
|
||||
|
||||
$account->bank = $_POST["bank"];
|
||||
$account->label = $_POST["label"];
|
||||
$account->courant = $_POST["courant"];
|
||||
$account->clos = $_POST["clos"];
|
||||
$account->code_banque = $_POST["code_banque"];
|
||||
$account->code_guichet = $_POST["code_guichet"];
|
||||
$account->number = $_POST["number"];
|
||||
$account->cle_rib = $_POST["cle_rib"];
|
||||
$account->bic = $_POST["bic"];
|
||||
$account->iban = $_POST["iban"];
|
||||
$account->domiciliation = $_POST["domiciliation"];
|
||||
$account->proprio = $_POST["proprio"];
|
||||
$account->owner_address = $_POST["owner_address"];
|
||||
$account->frstrecur = GETPOST('frstrecur');
|
||||
|
||||
$result = $account->update($user);
|
||||
if (! $result)
|
||||
if (! GETPOST('label'))
|
||||
{
|
||||
setEventMessages($account->error, $account->errors, 'errors');
|
||||
$_GET["action"]='edit'; // Force chargement page edition
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors');
|
||||
$action='update';
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
if (! GETPOST('bank'))
|
||||
{
|
||||
// If this account is the default bank account, we disable others
|
||||
if ($account->default_rib)
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankName")), null, 'errors');
|
||||
$action='update';
|
||||
$error++;
|
||||
}
|
||||
if ($account->needIBAN() == 1)
|
||||
{
|
||||
if (! GETPOST('iban'))
|
||||
{
|
||||
$account->setAsDefault($id); // This will make sure there is only one default rib
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("IBAN")), null, 'errors');
|
||||
$action='update';
|
||||
$error++;
|
||||
}
|
||||
if (! GETPOST('bic'))
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BIC")), null, 'errors');
|
||||
$action='update';
|
||||
$error++;
|
||||
}
|
||||
|
||||
$url=DOL_URL_ROOT.'/societe/rib.php?socid='.$object->id;
|
||||
header('Location: '.$url);
|
||||
exit;
|
||||
}
|
||||
|
||||
$account->fetch($id);
|
||||
if (! $error)
|
||||
{
|
||||
$account->socid = $object->id;
|
||||
|
||||
$account->bank = GETPOST('bank','alpha');
|
||||
$account->label = GETPOST('label','alpha');
|
||||
$account->courant = GETPOST('courant','alpha');
|
||||
$account->clos = GETPOST('clos','alpha');
|
||||
$account->code_banque = GETPOST('code_banque','alpha');
|
||||
$account->code_guichet = GETPOST('code_guichet','alpha');
|
||||
$account->number = GETPOST('number','alpha');
|
||||
$account->cle_rib = GETPOST('cle_rib','alpha');
|
||||
$account->bic = GETPOST('bic','alpha');
|
||||
$account->iban = GETPOST('iban','alpha');
|
||||
$account->domiciliation = GETPOST('domiciliation','alpha');
|
||||
$account->proprio = GETPOST('proprio','alpha');
|
||||
$account->owner_address = GETPOST('owner_address','alpha');
|
||||
$account->frstrecur = GETPOST('frstrecur','alpha');
|
||||
|
||||
$result = $account->update($user);
|
||||
if (! $result)
|
||||
{
|
||||
setEventMessages($account->error, $account->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
// If this account is the default bank account, we disable others
|
||||
if ($account->default_rib)
|
||||
{
|
||||
$account->setAsDefault($id); // This will make sure there is only one default rib
|
||||
}
|
||||
|
||||
$url=DOL_URL_ROOT.'/societe/rib.php?socid='.$object->id;
|
||||
header('Location: '.$url);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'add' && ! $_POST["cancel"])
|
||||
@ -114,6 +144,21 @@ if ($action == 'add' && ! $_POST["cancel"])
|
||||
$action='create';
|
||||
$error++;
|
||||
}
|
||||
if ($account->needIBAN() == 1)
|
||||
{
|
||||
if (! GETPOST('iban'))
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("IBAN")), null, 'errors');
|
||||
$action='create';
|
||||
$error++;
|
||||
}
|
||||
if (! GETPOST('bic'))
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BIC")), null, 'errors');
|
||||
$action='create';
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
@ -122,19 +167,19 @@ if ($action == 'add' && ! $_POST["cancel"])
|
||||
|
||||
$account->socid = $object->id;
|
||||
|
||||
$account->bank = $_POST["bank"];
|
||||
$account->label = $_POST["label"];
|
||||
$account->courant = $_POST["courant"];
|
||||
$account->clos = $_POST["clos"];
|
||||
$account->code_banque = $_POST["code_banque"];
|
||||
$account->code_guichet = $_POST["code_guichet"];
|
||||
$account->number = $_POST["number"];
|
||||
$account->cle_rib = $_POST["cle_rib"];
|
||||
$account->bic = $_POST["bic"];
|
||||
$account->iban = $_POST["iban"];
|
||||
$account->domiciliation = $_POST["domiciliation"];
|
||||
$account->proprio = $_POST["proprio"];
|
||||
$account->owner_address = $_POST["owner_address"];
|
||||
$account->bank = GETPOST('bank','alpha');
|
||||
$account->label = GETPOST('label','alpha');
|
||||
$account->courant = GETPOST('courant','alpha');
|
||||
$account->clos = GETPOST('clos','alpha');
|
||||
$account->code_banque = GETPOST('code_banque','alpha');
|
||||
$account->code_guichet = GETPOST('code_guichet','alpha');
|
||||
$account->number = GETPOST('number','alpha');
|
||||
$account->cle_rib = GETPOST('cle_rib','alpha');
|
||||
$account->bic = GETPOST('bic','alpha');
|
||||
$account->iban = GETPOST('iban','alpha');
|
||||
$account->domiciliation = GETPOST('domiciliation','alpha');
|
||||
$account->proprio = GETPOST('proprio','alpha');
|
||||
$account->owner_address = GETPOST('owner_address','alpha');
|
||||
$account->frstrecur = GETPOST('frstrecur');
|
||||
|
||||
$result = $account->update($user); // TODO Use create and include update into create method
|
||||
@ -161,8 +206,8 @@ if ($action == 'setasdefault')
|
||||
$url=DOL_URL_ROOT.'/societe/rib.php?socid='.$object->id;
|
||||
header('Location: '.$url);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($db->lasterror, null, 'errors');
|
||||
}
|
||||
@ -239,9 +284,9 @@ if ($socid && $action != 'edit' && $action != "create")
|
||||
}
|
||||
|
||||
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans("DefaultRIB"), '', '');
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
@ -265,35 +310,31 @@ if ($socid && $action != 'edit' && $action != "create")
|
||||
$content = $account->number;
|
||||
} elseif ($val == 'BankAccountNumberKey') {
|
||||
$content = $account->cle_rib;
|
||||
}elseif ($val == 'IBAN') {
|
||||
$content = $account->iban;
|
||||
if (! empty($account->iban)) {
|
||||
if (! checkIbanForAccount($account)) {
|
||||
$content.= img_picto($langs->trans("IbanNotValid"),'warning');
|
||||
} else {
|
||||
$content.= img_picto($langs->trans("IbanValid"),'info');
|
||||
}
|
||||
}
|
||||
}elseif ($val == 'BIC') {
|
||||
$content = $account->bic;
|
||||
if (! empty($account->bic)) {
|
||||
if (! checkSwiftForAccount($account)) {
|
||||
$content.= img_picto($langs->trans("SwiftNotValid"),'warning');
|
||||
} else {
|
||||
$content.= img_picto($langs->trans("SwiftValid"),'info');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans($val).'</td>';
|
||||
print '<td colspan="3">'.$content.'</td>';
|
||||
print '<td colspan="4">'.$content.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
|
||||
print '<td colspan="4">'.$account->iban . ' ';
|
||||
if (! empty($account->iban)) {
|
||||
if (! checkIbanForAccount($account)) {
|
||||
print img_picto($langs->trans("IbanNotValid"),'warning');
|
||||
} else {
|
||||
print img_picto($langs->trans("IbanValid"),'info');
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BIC").'</td>';
|
||||
print '<td colspan="4">'.$account->bic.' ';
|
||||
if (! empty($account->bic)) {
|
||||
if (! checkSwiftForAccount($account)) {
|
||||
print img_picto($langs->trans("SwiftNotValid"),'warning');
|
||||
} else {
|
||||
print img_picto($langs->trans("SwiftValid"),'info');
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="4">';
|
||||
print $account->domiciliation;
|
||||
print "</td></tr>\n";
|
||||
@ -315,7 +356,7 @@ if ($socid && $action != 'edit' && $action != "create")
|
||||
}
|
||||
|
||||
print "</div>";
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
@ -418,9 +459,9 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer)
|
||||
dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"),0,'company');
|
||||
|
||||
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
@ -432,6 +473,8 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer)
|
||||
|
||||
// Show fields of bank account
|
||||
foreach ($account->getFieldsToShow() as $val) {
|
||||
|
||||
$require=false;
|
||||
if ($val == 'BankCode') {
|
||||
$name = 'code_banque';
|
||||
$size = 8;
|
||||
@ -448,20 +491,23 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer)
|
||||
$name = 'cle_rib';
|
||||
$size = 3;
|
||||
$content = $account->cle_rib;
|
||||
} elseif ($val == 'IBAN') {
|
||||
$name = 'iban';
|
||||
$size = 30;
|
||||
$content = $account->iban;
|
||||
if ($account->needIBAN()) $require=true;
|
||||
} elseif ($val == 'BIC') {
|
||||
$name = 'bic';
|
||||
$size = 12;
|
||||
$content = $account->bic;
|
||||
if ($account->needIBAN()) $require=true;
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans($val).'</td>';
|
||||
print '<tr><td'.($require?' class="fieldrequired" ':'').'>'.$langs->trans($val).'</td>';
|
||||
print '<td><input size="'.$size.'" type="text" class="flat" name="'.$name.'" value="'.$content.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// IBAN
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("IBAN").'</td>';
|
||||
print '<td colspan="4"><input size="30" type="text" name="iban" value="'.$account->iban.'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("BIC").'</td>';
|
||||
print '<td colspan="4"><input size="12" type="text" name="bic" value="'.$account->bic.'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="4">';
|
||||
print '<textarea name="domiciliation" rows="4" cols="40">';
|
||||
print $account->domiciliation;
|
||||
@ -498,7 +544,7 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer)
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div align="center">';
|
||||
@ -515,9 +561,9 @@ if ($socid && $action == 'create' && $user->rights->societe->creer)
|
||||
dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"),0,'company');
|
||||
|
||||
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
@ -527,6 +573,13 @@ if ($socid && $action == 'create' && $user->rights->societe->creer)
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Bank").'</td>';
|
||||
print '<td><input size="30" type="text" name="bank" value="'.GETPOST('bank').'"></td></tr>';
|
||||
|
||||
// IBAN
|
||||
print '<tr><td valign="top" '.($account->needIBAN()?' class="fieldrequired" ':'').'>'.$langs->trans("IBAN").'</td>';
|
||||
print '<td colspan="4"><input size="30" type="text" name="iban" value="'.GETPOST('iban').'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top" '.($account->needIBAN()?' class="fieldrequired" ':'').'>'.$langs->trans("BIC").'</td>';
|
||||
print '<td colspan="4"><input size="12" type="text" name="bic" value="'.GETPOST('bic').'"></td></tr>';
|
||||
|
||||
// BBAN
|
||||
if ($account->useDetailedBBAN() == 1)
|
||||
{
|
||||
@ -556,13 +609,6 @@ if ($socid && $action == 'create' && $user->rights->societe->creer)
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// IBAN
|
||||
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
|
||||
print '<td colspan="4"><input size="30" type="text" name="iban" value="'.GETPOST('iban').'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BIC").'</td>';
|
||||
print '<td colspan="4"><input size="12" type="text" name="bic" value="'.GETPOST('bic').'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="4">';
|
||||
print '<textarea name="domiciliation" rows="4" cols="40">';
|
||||
print GETPOST('domiciliation');
|
||||
@ -597,7 +643,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer)
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div align="center">';
|
||||
|
||||
@ -106,7 +106,7 @@ if (empty($reshook))
|
||||
{
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'confirm_merge' && $confirm == 'yes')
|
||||
@ -200,8 +200,8 @@ if (empty($reshook))
|
||||
{
|
||||
setEventMessages($langs->trans('ThirdpartiesMergeSuccess'), null, 'mesgs');
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans('ErrorsThirdpartyMerge'), null, 'errors');
|
||||
@ -262,8 +262,8 @@ if (empty($reshook))
|
||||
$error++;
|
||||
$action='create';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ($action == 'update')
|
||||
{
|
||||
$ret=$object->fetch($socid);
|
||||
@ -340,13 +340,13 @@ if (empty($reshook))
|
||||
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
||||
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
||||
}
|
||||
|
||||
|
||||
// Multicurrency
|
||||
if (!empty($conf->multicurrency->enabled))
|
||||
{
|
||||
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
|
||||
}
|
||||
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
if ($ret < 0)
|
||||
@ -1507,7 +1507,7 @@ else
|
||||
print $object->ref;
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Name
|
||||
print '<tr><td class="titlefield">'.fieldLabel('ThirdPartyName','name',1).'</td>';
|
||||
print '<td colspan="3"><input type="text" size="60" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus"></td></tr>';
|
||||
@ -1935,13 +1935,13 @@ else
|
||||
dol_htmloutput_errors($error,$errors);
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
|
||||
@ -1949,12 +1949,12 @@ else
|
||||
print '<tr><td class="titlefield">'.$langs->trans('ProspectCustomer').'</td><td>';
|
||||
print $object->getLibCustProspStatut();
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Prospect/Customer
|
||||
print '<tr><td>'.$langs->trans('Supplier').'</td><td>';
|
||||
print yn($object->fournisseur);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Prefix
|
||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||
{
|
||||
@ -2032,7 +2032,7 @@ else
|
||||
print yn($object->tva_assuj);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// VAT Code
|
||||
print '<tr>';
|
||||
print '<td class="nowrap">'.$langs->trans('VATIntra').'</td><td>';
|
||||
@ -2176,13 +2176,13 @@ else
|
||||
print '<tr><td>'.$langs->trans("Staff").'</td><td>'.$object->effectif.'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</div>';
|
||||
print '<div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
|
||||
|
||||
// Legal
|
||||
print '<tr><td class="titlefield">'.$langs->trans('JuridicalStatus').'</td><td>'.$object->forme_juridique.'</td></tr>';
|
||||
|
||||
@ -2257,7 +2257,7 @@ else
|
||||
print !empty($object->multicurrency_code) ? currency_name($object->multicurrency_code,1) : '';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
@ -2338,10 +2338,10 @@ else
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '</div></div>';
|
||||
print '<div style="clear:both"></div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
@ -2358,13 +2358,13 @@ else
|
||||
$TContact = $object->contact_array_objects();
|
||||
foreach ($TContact as &$contact)
|
||||
{
|
||||
if (!empty($contact->email))
|
||||
if (!empty($contact->email))
|
||||
{
|
||||
$at_least_one_email_contact = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! empty($object->email) || $at_least_one_email_contact)
|
||||
{
|
||||
$langs->load("mails");
|
||||
@ -2421,7 +2421,7 @@ else
|
||||
print load_fiche_titre($langs->trans($titreform));
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user