Fix: Use propal date for propal numbering.
This commit is contained in:
parent
26b609fb78
commit
6848d72010
@ -743,20 +743,22 @@ class Propal extends CommonObject
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clear fields
|
||||||
|
$object->user_author = $user->id;
|
||||||
|
$object->user_valid = '';
|
||||||
|
$object->date = '';
|
||||||
|
$object->datep = dol_now('gmt');
|
||||||
|
$object->fin_validite = '';
|
||||||
|
$object->ref_client = '';
|
||||||
|
$object->products = $object->lignes; // Tant que products encore utilise
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$conf->global->PROPALE_ADDON.".php");
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$conf->global->PROPALE_ADDON.".php");
|
||||||
$obj = $conf->global->PROPALE_ADDON;
|
$obj = $conf->global->PROPALE_ADDON;
|
||||||
$modPropale = new $obj;
|
$modPropale = new $obj;
|
||||||
$numpr = $modPropale->getNextValue($objsoc,$object);
|
$numpr = $modPropale->getNextValue($objsoc,$object);
|
||||||
|
|
||||||
// Clear fields
|
// Set ref
|
||||||
$object->ref = $numpr;
|
$object->ref = $numpr;
|
||||||
$object->user_author = $user->id;
|
|
||||||
$object->user_valid = '';
|
|
||||||
$object->date = '';
|
|
||||||
$object->datep = dol_now('gmt');
|
|
||||||
$object->fin_validite = '';
|
|
||||||
$object->ref_client = '';
|
|
||||||
$object->products = $object->lignes; // Tant que products encore utilise
|
|
||||||
|
|
||||||
// Create clone
|
// Create clone
|
||||||
$result=$object->create($user);
|
$result=$object->create($user);
|
||||||
|
|||||||
@ -60,9 +60,9 @@ class Facture extends CommonObject
|
|||||||
var $number;
|
var $number;
|
||||||
var $author;
|
var $author;
|
||||||
//! Invoice date
|
//! Invoice date
|
||||||
var $date;
|
var $date; // Invoice date
|
||||||
var $date_creation;
|
var $date_creation; // Creation date
|
||||||
var $date_validation;
|
var $date_validation; // Validation date
|
||||||
var $datem;
|
var $datem;
|
||||||
var $ref;
|
var $ref;
|
||||||
var $ref_client;
|
var $ref_client;
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/includes/modules/facture/mercure/mercure.modules.php
|
* \file htdocs/includes/modules/facture/mercure/mercure.modules.php
|
||||||
* \ingroup facture
|
* \ingroup facture
|
||||||
* \brief Class filte of Mercure numbering module for invoice
|
* \brief File containing class for numbering module Mercure
|
||||||
* \version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/includes/modules/facture/terre/terre.modules.php
|
* \file htdocs/includes/modules/facture/terre/terre.modules.php
|
||||||
* \ingroup facture
|
* \ingroup facture
|
||||||
* \brief Fichier contenant la classe du mod<EFBFBD>le de num<EFBFBD>rotation de r<EFBFBD>f<EFBFBD>rence de facture Terre
|
* \brief File containing class for numbering module Terre
|
||||||
* \version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
||||||
@ -143,8 +143,7 @@ class mod_facture_terre extends ModeleNumRefFactures
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//$date=time();
|
$date=$facture->date; // This is invoice date (not creation date)
|
||||||
$date=$facture->date;
|
|
||||||
$yymm = strftime("%y%m",$date);
|
$yymm = strftime("%y%m",$date);
|
||||||
$num = sprintf("%04s",$max+1);
|
$num = sprintf("%04s",$max+1);
|
||||||
|
|
||||||
|
|||||||
@ -118,7 +118,7 @@ class mod_propale_marbre extends ModeleNumRefPropales
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$date=$propal->date;
|
$date=$propal->datep;
|
||||||
//$yymm = strftime("%y%m",time());
|
//$yymm = strftime("%y%m",time());
|
||||||
$yymm = strftime("%y%m",$date);
|
$yymm = strftime("%y%m",$date);
|
||||||
$num = sprintf("%04s",$max+1);
|
$num = sprintf("%04s",$max+1);
|
||||||
|
|||||||
@ -109,7 +109,7 @@ class mod_propale_saphir extends ModeleNumRefPropales
|
|||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/lib/functions2.lib.php");
|
require_once(DOL_DOCUMENT_ROOT ."/lib/functions2.lib.php");
|
||||||
|
|
||||||
// On d<EFBFBD>fini critere recherche compteur
|
// On defini critere recherche compteur
|
||||||
$mask=$conf->global->PROPALE_SAPHIR_MASK;
|
$mask=$conf->global->PROPALE_SAPHIR_MASK;
|
||||||
|
|
||||||
if (! $mask)
|
if (! $mask)
|
||||||
@ -118,7 +118,9 @@ class mod_propale_saphir extends ModeleNumRefPropales
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$numFinal=get_next_value($db,$mask,'propal','ref','',$objsoc->code_client,$propal->date);
|
$date=$propal->datep;
|
||||||
|
$customercode=$objsoc->code_client;
|
||||||
|
$numFinal=get_next_value($db,$mask,'propal','ref','',$customercode,$date);
|
||||||
|
|
||||||
return $numFinal;
|
return $numFinal;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user