function fwl_TS_NOOA_lowcode_autothen_creation_facture($id_type,$id_obje){
// LG : NE FAIT RIEN POUR LE MOMENT
//$valeursreglements = fwc7_data_liste_valeurs('', '24', 'value', array('label'));
if(isset($valeursreglements) && !empty($valeursreglements) && isset($id_obje)){
$wc= array();
}
}
function fwl_TS_NOOA_lowcode_autothen_devis_statut_devis_from_opportunite($id_type,$id_obje) {
$idOpportunite = fwc7_data_objet_att('',$id_type,$id_obje);
$wc = array();
$wc[]=" att1 ='".$id_obje."' AND id_work NOT IN (413,420)";
$findAllDevisByOpportunite = fwc7_data_objet_atts('','165','1',$wc);
// Si il reste de devis Ă refuser ou annuler
if(count($findAllDevisByOpportunite) > 0){
// alors on les annule
$datas = [];
$datas["id_work"]="420";
foreach($findAllDevisByOpportunite as $id => $att){
fwc7_modify_att_edit('','165',$id,$datas);
// ... (truncated)
When modifying opportunite|devis|facture client: Assigns the prescriber of the client to the current prescriber opportunity If the client has no prescriber, sets the opportunity's prescriber to ''
function fwl_TS_NOOA_lowcode_autothen_assignation_prescription($id_type, $id_obje)
{
// Input validation
if (empty($id_type) || empty($id_obje)) {
error_log("Error in assignation_prescription: Invalid input parameters");
return false;
}
try {
$type_code = fwc7_param_objet_general("", $id_type)['module_code'];
$object = fwc7_data_objet_att('', $id_type, $id_obje);
if (empty($object)) {
throw new Exception("Invalid object data for type $id_type and ID $id_obje");
// ... (truncated)
⚙️ Parameters
$id_type(string) The type ID of the opportunity or devis
$id_obje(string) The object ID of the opportunity or devis
Filters and manages products for a cooperative based on SAP restrictions This function performs the following: 1. Gets product information and cooperative details 2. Checks if the cooperative is of type "sap" 3. For SAP cooperatives, removes non-SAP products if product restrictions are enabled
function fwl_TS_NOOA_lowcode_autothen_cooperative_product($id_type, $id_obje){
// Get the product and cooperative type ID from settings
$id_type_produit = fwp7_param_objet_setting_get('', $id_type, 'produit', 'id_type');
$id_type_cooperative = fwp7_param_objet_setting_get('', $id_type, 'cooperative', 'id');
// Get the field ID for product lines and retrieve all product lines
$products_line_id_field = fwp7_param_template_tlg_get_number('', $id_type, 'ligne_de_documents');
$products_line = fwc7_data_objet_ligs("", $id_type, $id_obje, intval($products_line_id_field), "all", 1, "", "", "", "");
// Get the cooperative ID field and retrieve the cooperative ID
$devis_cooperative_id_field = fwp7_param_template_att_get_number('', $id_type, 'id_cooperative');
$id_cooperative = fwc7_data_objet_att('', $id_type, intval($id_obje))[$devis_cooperative_id_field];
// Get cooperative details and type
$cooperative = fwc7_data_objet_att('', $id_type_cooperative, $id_cooperative);
$cooperative_type_field = fwp7_param_template_att_get_number('', $cooperative['id_type'], 'type_cooperative');
$cooperative_type = $cooperative[$cooperative_type_field];
// ... (truncated)
⚙️ Parameters
$id_type(int) The type ID of the object (representing the cooperative or order)
$id_obje(int) The object ID (representing the specific cooperative or order instance)