can merge products but experimental

This commit is contained in:
Frédéric FRANCE 2021-11-23 22:02:55 +01:00
parent d9bcd27764
commit 429e5cf517
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
4 changed files with 55 additions and 2 deletions

View File

@ -2929,6 +2929,23 @@ class FactureFournisseur extends CommonInvoice
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
}
/**
* Function used to replace a product id with another one.
*
* @param DoliDB $db Database handler
* @param int $origin_id Old product id
* @param int $dest_id New product id
* @return bool
*/
public static function replaceProduct(DoliDB $db, $origin_id, $dest_id)
{
$tables = array(
'facture_fourn_det'
);
return CommonObject::commonReplaceProduct($db, $origin_id, $dest_id, $tables);
}
/**
* Is the payment of the supplier invoice having a delay?
*

View File

@ -321,11 +321,12 @@ if (empty($reshook)) {
'Bom' => '/bom/class/bom.class.php',
'Contrat' => '/contrat/class/contrat.class.php',
'Expedition' => '/expedition/class/expedition.class.php',
'Reception' => '/reception/class/reception.class.php',
'Fichinter' => '/fichinter/class/fichinter.class.php',
'FichinterRec' => '/fichinter/class/fichinter.class.php',
'CommandeFournisseur' => '/fourn/class/fournisseur.commande.class.php',
// 'FactureFournisseur' => '/fourn/class/fournisseur.facture.class.php',
// 'SupplierProposal' => '/supplier_proposal/class/supplier_proposal.class.php',
'FactureFournisseur' => '/fourn/class/fournisseur.facture.class.php',
'SupplierProposal' => '/supplier_proposal/class/supplier_proposal.class.php',
// 'ProductFournisseur' => '/fourn/class/fournisseur.product.class.php',
'Delivery' => '/delivery/class/delivery.class.php',
// 'Project' => '/projet/class/project.class.php',

View File

@ -1949,4 +1949,21 @@ class Reception extends CommonObject
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
}
/**
* Function used to replace a product id with another one.
*
* @param DoliDB $db Database handler
* @param int $origin_id Old product id
* @param int $dest_id New product id
* @return bool
*/
public static function replaceProduct(DoliDB $db, $origin_id, $dest_id)
{
$tables = array(
'commande_fournisseur_dispatch'
);
return CommonObject::commonReplaceProduct($db, $origin_id, $dest_id, $tables);
}
}

View File

@ -2681,6 +2681,24 @@ class SupplierProposal extends CommonObject
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
}
/**
* Function used to replace a product id with another one.
*
* @param DoliDB $db Database handler
* @param int $origin_id Old product id
* @param int $dest_id New product id
* @return bool
*/
public static function replaceProduct(DoliDB $db, $origin_id, $dest_id)
{
$tables = array(
'supplier_proposaldet'
);
return CommonObject::commonReplaceProduct($db, $origin_id, $dest_id, $tables);
}
}