automation

đź”§ fwl_TS_NOOA_lowcode_autothen_devis_generate_token

function fwl_TS_NOOA_lowcode_autothen_devis_generate_token($id_type,$id_obje) { $utoken=fwk_var_password_simple_generate(16); $url_devis=fwp7_param_params_detail('','MAIL_URL')."site/SITE1/DEVIS/".$utoken.""; $datas=array(); $att_token = fwp7_param_template_att_get_number('',$id_type,'token'); $att_url_devis = fwp7_param_template_att_get_number('',$id_type,'url_site_ext_devis'); $datas[$att_token]=$utoken; $datas[$att_url_devis]=$url_devis; fwc7_modify_att_edit('',$id_type,$id_obje,$datas); }

↩️ Returns

(void)

đź”§ fwl_TS_NOOA_lowcode_autothen_devis_statut_opportunite_from_devis

: Lorsque qu’un devis passe au statut refusé alors on vient checker si c’est le dernier a être refusé sur l’ensemble de la liste de devis refusé. Si c’est le cas, alors l’opportunité passe au statut “Perdu”.
function fwl_TS_NOOA_lowcode_autothen_devis_statut_opportunite_from_devis($id_type,$id_obje) { $att_key_opportunite = fwp7_param_template_att_get_number('',$id_type,'opportunite'); $att_key_status_refuse = fwp7_param_objet_setting_get('',$id_type,'devis','statut','refuse'); $att_key_status_annule = fwp7_param_objet_setting_get('',$id_type,'devis','statut','annule'); $att_key_type_opportunite = fwp7_param_objet_setting_get('',$id_type,'opportunite','id_type'); $att_key_type_opportunite_annule = fwp7_param_objet_setting_get('',$id_type,'opportunite','statut','annule'); $idOpportunite = fwc7_data_objet_att('',$id_type,$id_obje)[$att_key_opportunite]; $wc = array(); $wc[]=$att_key_opportunite." ='".$idOpportunite."' AND id_work NOT IN (".$att_key_status_refuse." , ".$att_key_status_annule.")"; $findAllDevisByOpportunite = fwc7_data_objet_atts('',$id_type,'1',$wc); // ... (truncated)

↩️ Returns

(void)

đź”§ fwl_TS_NOOA_lowcode_autothen_creation_facture

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(); } }

↩️ Returns

(void)

đź”§ fwl_TS_NOOA_lowcode_autothen_create_commande_from_devis

Fonction principale pour créer une commande à partir d'un devis
function fwl_TS_NOOA_lowcode_autothen_create_commande_from_devis($id_type, $id_obje) { try { $wc = array(); $wc[]= " att14 = ".$id_obje; $isCommandeAlreadyExist = fwc7_data_objet_atts('',168,"1",$wc); $idCommande = reset($isCommandeAlreadyExist); count($isCommandeAlreadyExist) == 0 ? $isCommandeAlreadyExist = false : $isCommandeAlreadyExist = true ; if(!$isCommandeAlreadyExist){ $serviceCommande = new CommandeService(strval($id_type), strval($id_obje)); $idCommande = $serviceCommande->creerCommande(); // ... (truncated)

⚙️ Parameters

↩️ Returns

(int|false) Retourne l'ID de la commande si succès, false si la commande existe déjà

đź”§ fwl_TS_NOOA_lowcode_autothen_transformation

Fonction pour le calcul du temps de transformation des opportunité
function fwl_TS_NOOA_lowcode_autothen_transformation($id_type,$id_obje){ global $global_modified_att; $opportuniteOBJ = fwc7_data_objet_att('',$id_type,$id_obje); if($global_modified_att[$id_type][$opportuniteOBJ['id_vent']]['att']['id_work']['old']!="" && $global_modified_att[$id_type][$opportuniteOBJ['id_vent']]['att']['id_work']['old']!=$global_modified_att[$id_type][$opportuniteOBJ['id_vent']]['att']['id_work']['new'] && $global_modified_att[$id_type][$opportuniteOBJ['id_vent']]['att']['id_work']['new']== 417){ $dateCreate = strtotime($opportuniteOBJ['attf100']); $dateTransfo = strtotime(date('Ymd')); $data=array(); $data['att4'] = ($dateTransfo-$dateCreate)/86400; // ... (truncated)

↩️ Returns

(void)

đź”§ fwl_TS_NOOA_lowcode_autothen_devis_statut_devis_from_opportunite

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)

↩️ Returns

(void)

đź”§ fws_TS_NOOA_OPPORTUNITE_dropdown_selectize_client

function fws_TS_NOOA_OPPORTUNITE_dropdown_selectize_client($id_type="",$id_obje="", $param_att="") { $id_cur_obje=""; switch ($id_type) { case '148': $data_objet=fwc7_data_objet_att('',$id_type,$id_obje); $id_cur_obje=$data_objet['att2']; break; default: break; } // ... (truncated)

↩️ Returns

(array)

đź”§ fwl_TS_NOOA_lowcode_autothen_assignation_prescription

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

↩️ Returns

(bool) Returns true if the assignment was successful, false otherwise

đź”§ fwl_TS_NOOA_lowcode_autothen_cooperative_product

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

↩️ Returns

(bool) Always returns true after processing

đź”§ fwl_TS_NOOA_FRANCHISE_lowcode_autothen_add_row_franchise

Ajout des lignes de compteur à la création de la franchise
function fwl_TS_NOOA_FRANCHISE_lowcode_autothen_add_row_franchise($id_type="",$id_obje=""){ $ligData = array(); $ligData['lig1'] = "CLI-"; $ligData['lig3'] = "80"; fwc7_modify_lig_merge("",$id_type,$id_obje,"163","",'',$ligData,'new','','',''); $ligData = array(); $ligData['lig1'] = "DEV-"; $ligData['lig3'] = "165"; fwc7_modify_lig_merge("",$id_type,$id_obje,"163","",'',$ligData,'new','','',''); $ligData = array(); // ... (truncated)

↩️ Returns

(void)