/** * @file * @brief Called from Follow_Up_Detail for displaying detail * @see Follow_Up_Detail::display */ // Number of articles $article_count=(count($p_follow_up->aAction_detail)==0)?MAX_ARTICLE:count($p_follow_up->aAction_detail); // total item and vat $tot_item=0; $tot_vat=0; $text=new IText(); $num=new INum(); $itva=new ITva_Popup(); $readonly=($p_view == "READ")?true:false; // Check for the Price on ACH or VEN $cn=Dossier::connect(); $document_type=$p_follow_up->db->get_value("select ag_type from action_gestion where ag_id = $1",[$p_follow_up->ag_id]); $option_detail= Document_Option::option_operation_detail($document_type); // default menu for invoice $menu=new Default_Menu(); ?>
jrn=-10; $icard->table=0; $icard->noadd="no"; $icard->extra='all'; $icard->name="e_march".$i; $tmp_ad=(isset($p_follow_up->aAction_detail[$i]))?$p_follow_up->aAction_detail[$i]:false; $icard->readOnly=$readonly; $icard->value=''; $aCard[$i]=0; if ($tmp_ad) { $march=new Fiche($p_follow_up->db); $f=$tmp_ad->get_parameter('qcode'); if ($f!=0) { $march->id=$f; $icard->value=$march->get_quick_code(); $aCard[$i]=$f; } } $icard->set_dblclick("fill_ipopcard(this);"); // name of the field to update with the name of the card $icard->set_attribute('label', "e_march".$i."_label"); // name of the field to update with the name of the card $icard->set_attribute('typecard', $icard->extra); $icard->set_attribute('ipopup', 'ipopcard'); $icard->set_function('fill_data'); $icard->javascript=sprintf(' onchange="fill_data_onchange(\'%s\');" ', $icard->name); // name of the field to update with the name of the card $icard->set_attribute('label', 'e_march' . $i . '_label'); // name of the field with the price autocomplete if ( $option == 'ACH'){ $icard->set_attribute('purchase', 'e_march' . $i . '_price'); } else { $icard->set_attribute('price','e_march'.$i.'_price'); } // name of the field with the TVA_ID $icard->set_attribute('tvaid', 'e_march' . $i . '_tva_id'); $icard->amount_from_type=$option_detail; $aArticle[$i]['fid']=$icard->search().$icard->input(); $text->javascript=' onchange="clean_tva('.$i.');compute_ledger('.$i.')"'; $text->css_size="100%"; $text->name="e_march".$i."_label"; $text->id="e_march".$i."_label"; $text->size=40; $text->value=($tmp_ad)?$tmp_ad->get_parameter('text'):""; $text->readOnly=$readonly; $aArticle[$i]['desc']=$text->input(); $num->javascript=' onchange="format_number(this,4);clean_tva('.$i.');compute_ledger('.$i.')"'; $num->name="e_march".$i."_price"; $num->id="e_march".$i."_price"; $num->size=8; $num->readOnly=$readonly; $num->value=($tmp_ad)?$tmp_ad->get_parameter('price_unit'):0; $aArticle[$i]['pu']=$num->input(); $num->name="e_quant".$i; $num->id="e_quant".$i; $num->size=8; $num->value=($tmp_ad)?$tmp_ad->get_parameter('quantity'):0; $aArticle[$i]['quant']=$num->input(); $itva->name='e_march'.$i.'_tva_id'; $itva->id='e_march'.$i.'_tva_id'; $itva->value=($tmp_ad)?$tmp_ad->get_parameter('tva_id'):0; $itva->readOnly=$readonly; $itva->js=' onchange="format_number(this);clean_tva('.$i.');compute_ledger('.$i.')"'; $itva->set_attribute('compute', $i); $aArticle[$i]['tvaid']=$itva->input(); $num->name="e_march".$i."_tva_amount"; $num->id="e_march".$i."_tva_amount"; $num->value=($tmp_ad)?$tmp_ad->get_parameter('tva_amount'):0; $num->javascript=" onchange=\"compute_ledger('".$i." ')\""; $num->size=8; $aArticle[$i]['tva']=$num->input(); $tot_vat=bcadd($tot_vat, $num->value); $num->name="tvac_march".$i; $num->id="tvac_march".$i; $num->value=($tmp_ad)?$tmp_ad->get_parameter('total'):0; $num->size=8; $aArticle[$i]['tvac']=$num->input(); $tot_item=bcadd($tot_item, $num->value); $aArticle[$i]['hidden_htva']=HtmlInput::hidden('htva_march'.$i, 0); $aArticle[$i]['hidden_tva']=HtmlInput::hidden('tva_march'.$i, 0); $aArticle[$i]['ad_id']=($tmp_ad)?HtmlInput::hidden('ad_id'.$i, $tmp_ad->get_parameter('id')):HtmlInput::hidden('ad_id'.$i, 0); ?>




Total HTVA
Total TVA
Total TVAC
dt_id)): ?>
Cocher pour copier la description dans la note de la vente
Dossier::id(), 'ag_id'=>$p_follow_up->ag_id, 'create_invoice'=>1,'cp'=>0, 'ac'=>$menu->get('code_invoice'))); echo HtmlInput::button_anchor(_("Transformer en Facture de Vente"), "do.php?".$query, "create_invoice", ' target="_blank" ', "button"); ?>
dt_id)): ?>
Cocher pour copier la description dans la note de l'achat ou note de frais
0,'gDossier'=>Dossier::id(), 'ag_id'=>$p_follow_up->ag_id, 'create_feenote'=>1, 'ac'=>$menu->get('code_feenote'))); echo HtmlInput::button_anchor(_("Transformer en Note de frais ou Facture Achat"), "do.php?".$query, "create_feenote", ' target="_blank" ', "button"); ?>