Fix: Use propal date for propal numbering.

This commit is contained in:
Laurent Destailleur 2010-04-24 11:02:38 +00:00
parent 26b609fb78
commit 6848d72010
6 changed files with 22 additions and 19 deletions

View File

@ -743,20 +743,22 @@ class Propal extends CommonObject
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");
$obj = $conf->global->PROPALE_ADDON;
$modPropale = new $obj;
$numpr = $modPropale->getNextValue($objsoc,$object);
// Clear fields
// Set ref
$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
$result=$object->create($user);
@ -2024,7 +2026,7 @@ class Propal extends CommonObject
function verifyNumRef($soc)
{
global $conf;
$sql = "SELECT rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."propal";
$sql.= " WHERE ref = '".$this->ref."'";

View File

@ -60,9 +60,9 @@ class Facture extends CommonObject
var $number;
var $author;
//! Invoice date
var $date;
var $date_creation;
var $date_validation;
var $date; // Invoice date
var $date_creation; // Creation date
var $date_validation; // Validation date
var $datem;
var $ref;
var $ref_client;

View File

@ -23,7 +23,7 @@
/**
* \file htdocs/includes/modules/facture/mercure/mercure.modules.php
* \ingroup facture
* \brief Class filte of Mercure numbering module for invoice
* \brief File containing class for numbering module Mercure
* \version $Id$
*/
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");

View File

@ -21,7 +21,7 @@
/**
* \file htdocs/includes/modules/facture/terre/terre.modules.php
* \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$
*/
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
@ -143,8 +143,7 @@ class mod_facture_terre extends ModeleNumRefFactures
return -1;
}
//$date=time();
$date=$facture->date;
$date=$facture->date; // This is invoice date (not creation date)
$yymm = strftime("%y%m",$date);
$num = sprintf("%04s",$max+1);

View File

@ -118,7 +118,7 @@ class mod_propale_marbre extends ModeleNumRefPropales
return -1;
}
$date=$propal->date;
$date=$propal->datep;
//$yymm = strftime("%y%m",time());
$yymm = strftime("%y%m",$date);
$num = sprintf("%04s",$max+1);

View File

@ -109,7 +109,7 @@ class mod_propale_saphir extends ModeleNumRefPropales
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;
if (! $mask)
@ -118,7 +118,9 @@ class mod_propale_saphir extends ModeleNumRefPropales
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;
}