|
3671 | 3671 | $mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
3672 | 3672 | $fk_account = GETPOSTINT('fk_account'); |
3673 | 3673 |
|
| 3674 | + $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
| 3675 | + if (empty($dateinvoice)) { |
| 3676 | + $dateinvoice = (getDolGlobalString('MAIN_DO_NOT_AUTOFILL_DATE_INVOICE') ? -1 : ''); // By default '' so we will autofill date. -1 means keep empty. |
| 3677 | + } |
| 3678 | + |
3674 | 3679 | // Load objectsrc |
3675 | 3680 | $objectsrc = null; // Initialise |
3676 | 3681 | //$remise_absolue = 0; |
|
3683 | 3688 | $subelement = $regs[2]; |
3684 | 3689 | } |
3685 | 3690 |
|
3686 | | - $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
3687 | 3691 | $date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver'); |
3688 | 3692 |
|
3689 | 3693 | if ($element == 'project') { |
|
3698 | 3702 | if (empty($fk_account)) { |
3699 | 3703 | $fk_account = $soc->fk_account; |
3700 | 3704 | } |
3701 | | - if (empty($dateinvoice)) { |
3702 | | - // Do not set 0 here (0 for a date is 1970) |
3703 | | - $dateinvoice = getDolGlobalString('MAIN_AUTOFILL_DATE') ? '' : -1; |
3704 | | - } |
3705 | 3705 | } else { |
3706 | 3706 | // For compatibility |
3707 | 3707 | if ($element == 'order' || $element == 'commande') { |
|
3744 | 3744 | $soc = $objectsrc->thirdparty; |
3745 | 3745 | } |
3746 | 3746 |
|
3747 | | - $dateinvoice = (empty($dateinvoice) ? (!getDolGlobalString('MAIN_AUTOFILL_DATE') ? -1 : '') : $dateinvoice); |
3748 | | - |
3749 | 3747 | if ($element == 'expedition') { |
3750 | 3748 | $elem = $subelem = $objectsrc->origin; |
3751 | 3749 | $expeoriginid = $objectsrc->origin_id; |
|
3801 | 3799 | $fk_account = empty($soc->fk_account) ? $fk_account : $soc->fk_account; |
3802 | 3800 | $inputReasonId = empty($soc->demand_reason_id) ? $inputReasonId : $soc->demand_reason_id; |
3803 | 3801 |
|
3804 | | - $dateinvoice = (empty($dateinvoice) ? (!getDolGlobalString('MAIN_AUTOFILL_DATE') ? -1 : '') : $dateinvoice); // Do not set 0 here (0 for a date is 1970) |
3805 | | - |
3806 | 3802 | if (isModEnabled('multicurrency') && !empty($soc->multicurrency_code)) { |
3807 | 3803 | $currency_code = $soc->multicurrency_code; |
3808 | 3804 | } |
|
0 commit comments