Update facture.php
if socid is filled and send, they no need to get the thirdparty of the object
This commit is contained in:
parent
8a6f7df186
commit
135d6c1d1f
@ -1766,8 +1766,10 @@ if ($action == 'create')
|
||||
$projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
|
||||
$ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : '');
|
||||
$ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : '');
|
||||
|
||||
$soc = $objectsrc->thirdparty;
|
||||
|
||||
// only if socid is not filled
|
||||
if (empty($socid))
|
||||
$soc = $objectsrc->thirdparty;
|
||||
|
||||
$cond_reglement_id = (! empty($objectsrc->cond_reglement_id)?$objectsrc->cond_reglement_id:(! empty($soc->cond_reglement_id)?$soc->cond_reglement_id:1));
|
||||
$mode_reglement_id = (! empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(! empty($soc->mode_reglement_id)?$soc->mode_reglement_id:0));
|
||||
@ -1786,7 +1788,7 @@ if ($action == 'create')
|
||||
{
|
||||
$cond_reglement_id = $soc->cond_reglement_id;
|
||||
$mode_reglement_id = $soc->mode_reglement_id;
|
||||
$fk_account = $soc->fk_account;
|
||||
$fk_account = $soc->fk_account;
|
||||
$remise_percent = $soc->remise_percent;
|
||||
$remise_absolue = 0;
|
||||
$dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); // Do not set 0 here (0 for a date is 1970)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user