mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix numbering of shipments
This commit is contained in:
parent
0ab376887c
commit
df4761e42a
|
|
@ -144,7 +144,7 @@ class mod_expedition_safor extends ModelNumRefExpedition
|
|||
return -1;
|
||||
}
|
||||
|
||||
$date = time();
|
||||
$date = $shipment->date_creation;
|
||||
$yymm = strftime("%y%m", $date);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -657,7 +657,35 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase
|
|||
$this->assertEquals('A198201-0001', $result); // counter must start to 1
|
||||
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* testShipmentSafor
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function testShipmentSafor()
|
||||
{
|
||||
global $conf,$user,$langs,$db,$mysoc;
|
||||
$conf=$this->savconf;
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
require_once dirname(__FILE__).'/../../htdocs/expedition/class/expedition.class.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/modules/expedition/mod_expedition_safor.php';
|
||||
|
||||
$localobject=new Expedition($db);
|
||||
$localobject->initAsSpecimen();
|
||||
$localobject->fetch_thirdparty();
|
||||
|
||||
$localobject->date_creation = dol_mktime(12, 0, 0, 1, 1, 1980); // we use year 1915 to be sure to not have existing invoice for this year (usefull only if numbering is {0000@1}
|
||||
$numbering=new mod_expedition_safor();
|
||||
$result=$numbering->getNextValue($mysoc, $localobject);
|
||||
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals('SH8001-0001', $result); // counter must start to 1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user