diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 0515c8187c1..09aedd05e66 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -197,9 +197,9 @@ if ($_POST['action'] == 'update' && ! $_POST['cancel']) */ if ($_POST['action'] == 'add' && $user->rights->fournisseur->facture->creer) { - $error=0; + $error=0; - $datefacture=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']); + $datefacture=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']); $datedue=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']); if ($datefacture == '') @@ -232,93 +232,93 @@ if ($_POST['action'] == 'add' && $user->rights->fournisseur->facture->creer) $facfou->note_public = $_POST['note']; // If creation from another object of another module - if ($_POST['origin'] && $_POST['originid']) - { - // Parse element/subelement (ex: project_task) - $element = $subelement = $_POST['origin']; - /*if (preg_match('/^([^_]+)_([^_]+)/i',$_POST['origin'],$regs)) - { - $element = $regs[1]; - $subelement = $regs[2]; - }*/ + if ($_POST['origin'] && $_POST['originid']) + { + // Parse element/subelement (ex: project_task) + $element = $subelement = $_POST['origin']; + /*if (preg_match('/^([^_]+)_([^_]+)/i',$_POST['origin'],$regs)) + { + $element = $regs[1]; + $subelement = $regs[2]; + }*/ - // For compatibility - if ($element == 'order') { $element = $subelement = 'commande'; } + // For compatibility + if ($element == 'order') { $element = $subelement = 'commande'; } if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } if ($element == 'contract') { $element = $subelement = 'contrat'; } if ($element == 'order_supplier') { $element = 'fourn'; $subelement = 'fournisseur.commande'; } - $facfou->origin = $_POST['origin']; - $facfou->origin_id = $_POST['originid']; + $facfou->origin = $_POST['origin']; + $facfou->origin_id = $_POST['originid']; - $facid = $facfou->create($user); + $facid = $facfou->create($user); - // Add lines - if ($facid > 0) - { - require_once(DOL_DOCUMENT_ROOT.'/'.$element.'/class/'.$subelement.'.class.php'); - $classname = ucfirst($subelement); - if ($classname == 'Fournisseur.commande') $classname='CommandeFournisseur'; - $srcobject = new $classname($db); + // Add lines + if ($facid > 0) + { + require_once(DOL_DOCUMENT_ROOT.'/'.$element.'/class/'.$subelement.'.class.php'); + $classname = ucfirst($subelement); + if ($classname == 'Fournisseur.commande') $classname='CommandeFournisseur'; + $srcobject = new $classname($db); - $result=$srcobject->fetch($_POST['originid']); - if ($result > 0) - { - $lines = $srcobject->lines; - if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines(); + $result=$srcobject->fetch($_POST['originid']); + if ($result > 0) + { + $lines = $srcobject->lines; + if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines(); - for ($i = 0 ; $i < sizeof($lines) ; $i++) - { - $desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle); - $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0); + for ($i = 0 ; $i < sizeof($lines) ; $i++) + { + $desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle); + $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0); - // Dates - // TODO mutualiser - $date_start=$lines[$i]->date_debut_prevue; - if ($lines[$i]->date_debut_reel) $date_start=$lines[$i]->date_debut_reel; - if ($lines[$i]->date_start) $date_start=$lines[$i]->date_start; - $date_end=$lines[$i]->date_fin_prevue; - if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel; - if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end; + // Dates + // TODO mutualiser + $date_start=$lines[$i]->date_debut_prevue; + if ($lines[$i]->date_debut_reel) $date_start=$lines[$i]->date_debut_reel; + if ($lines[$i]->date_start) $date_start=$lines[$i]->date_start; + $date_end=$lines[$i]->date_fin_prevue; + if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel; + if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end; - $result = $facfou->addline( - $desc, - $lines[$i]->subprice, - $lines[$i]->tva_tx, - $lines[$i]->localtax1_tx, - $lines[$i]->localtax2_tx, - $lines[$i]->qty, - $lines[$i]->fk_product, - $lines[$i]->remise_percent, - $date_start, - $date_end, - 0, - $lines[$i]->info_bits, + $result = $facfou->addline( + $desc, + $lines[$i]->subprice, + $lines[$i]->tva_tx, + $lines[$i]->localtax1_tx, + $lines[$i]->localtax2_tx, + $lines[$i]->qty, + $lines[$i]->fk_product, + $lines[$i]->remise_percent, + $date_start, + $date_end, + 0, + $lines[$i]->info_bits, 'HT', - $product_type - ); + $product_type + ); - if ($result < 0) - { - $error++; - break; - } - } - } - else - { - $error++; - } - } - else - { - $error++; - } - } - // If some invoice's lines already known - else - { - $facid = $facfou->create($user); + if ($result < 0) + { + $error++; + break; + } + } + } + else + { + $error++; + } + } + else + { + $error++; + } + } + // If some invoice's lines already known + else + { + $facid = $facfou->create($user); if ($facid < 0) { $error++; @@ -326,7 +326,7 @@ if ($_POST['action'] == 'add' && $user->rights->fournisseur->facture->creer) if (! $error) { - for ($i = 1 ; $i < 9 ; $i++) + for ($i = 1 ; $i < 9 ; $i++) { $label = $_POST['label'.$i]; $amountht = price2num($_POST['amount'.$i]); @@ -346,14 +346,14 @@ if ($_POST['action'] == 'add' && $user->rights->fournisseur->facture->creer) } $atleastoneline=1; - $product=new Product($db); - $product->fetch($_POST['idprod'.$i]); + $product=new Product($db); + $product->fetch($_POST['idprod'.$i]); - $ret=$facfou->addline($label, $amount, $tauxtva, $product->localtax1_tx, $product->localtax2_tx, $qty, $fk_product, $remise_percent, '', '', '', 0, $price_base); - if ($ret < 0) $error++; - } + $ret=$facfou->addline($label, $amount, $tauxtva, $product->localtax1_tx, $product->localtax2_tx, $qty, $fk_product, $remise_percent, '', '', '', 0, $price_base); + if ($ret < 0) $error++; + } } - } + } } if ($error) @@ -383,7 +383,7 @@ if ($_GET['action'] == 'del_ligne') // Modification d'une ligne if ($_REQUEST['action'] == 'update_line') { - if ($_REQUEST['etat'] == '1' && ! $_REQUEST['cancel']) // si on valide la modification + if ($_REQUEST['etat'] == '1' && ! $_REQUEST['cancel']) // si on valide la modification { $facfou = new FactureFournisseur($db); $facfou->fetch($_GET['facid']); @@ -412,15 +412,15 @@ if ($_REQUEST['action'] == 'update_line') } else { - if ($facfou->socid) - { - $societe=new Societe($db); - $societe->fetch($facfou->socid); - } + if ($facfou->socid) + { + $societe=new Societe($db); + $societe->fetch($facfou->socid); + } $label = $_POST['label']; $type = $_POST["type"]?$_POST["type"]:0; $localtax1tx= get_localtax($_POST['tauxtva'], 1, $societe); - $localtax2tx= get_localtax($_POST['tauxtva'], 2, $societe); + $localtax2tx= get_localtax($_POST['tauxtva'], 2, $societe); } $result=$facfou->updateline($_GET['lineid'], $label, $pu, $_POST['tauxtva'], $localtax1tx, $localtax2tx, $_POST['qty'], $_POST['idprod'], $price_base_type, 0, $type); @@ -441,11 +441,11 @@ if ($_GET['action'] == 'addline') exit; } - if ($facfou->socid) - { - $societe=new Societe($db); - $societe->fetch($facfou->socid); - } + if ($facfou->socid) + { + $societe=new Societe($db); + $societe->fetch($facfou->socid); + } if ($_POST['idprodfournprice']) // > 0 or -1 { @@ -464,7 +464,7 @@ if ($_GET['action'] == 'addline') $tvatx=get_default_tva($societe,$mysoc,$product->id); $localtax1tx= get_localtax($tvatx, 1, $societe); - $localtax2tx= get_localtax($tvatx, 2, $societe); + $localtax2tx= get_localtax($tvatx, 2, $societe); $type = $product->type; @@ -480,8 +480,8 @@ if ($_GET['action'] == 'addline') else { $tauxtva = price2num($_POST['tauxtva']); - $localtax1tx= get_localtax($tauxtva, 1, $societe); - $localtax2tx= get_localtax($tauxtva, 2, $societe); + $localtax1tx= get_localtax($tauxtva, 1, $societe); + $localtax2tx= get_localtax($tauxtva, 2, $societe); if (! $_POST['label']) { @@ -528,8 +528,8 @@ if ($_GET['action'] == 'addline') unset($_POST['pu']); unset($_POST['tva_tx']); unset($_POST['label']); - unset($localtax1_tx); - unset($localtax2_tx); + unset($localtax1_tx); + unset($localtax2_tx); } else if (empty($mesg)) { @@ -621,7 +621,7 @@ if ($_GET['action'] == 'reopen' && $user->rights->fournisseur->facture->creer) /* * Add file in email form - */ +*/ if ($_POST['addfile']) { require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); @@ -638,7 +638,7 @@ if ($_POST['addfile']) /* * Remove file in email form - */ +*/ if (! empty($_POST['removedfile'])) { require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); @@ -655,7 +655,7 @@ if (! empty($_POST['removedfile'])) /* * Send mail - */ +*/ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_POST['cancel']) { $langs->load('mails'); @@ -747,7 +747,7 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] $facturefourn->actionmsg = $actionmsg; $facturefourn->actionmsg2 = $actionmsg2; $facturefourn->fk_element = $facturefourn->id; - $facturefourn->elementtype = $facturefourn->element; + $facturefourn->elementtype = $facturefourn->element; // Appel des triggers include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); @@ -812,14 +812,14 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] /* * Build document - */ +*/ if ($_REQUEST['action'] == 'builddoc') { /* * Generation de la facture - * definit dans /includes/modules/supplier_invoice/modules_facturefournisseur.php - */ + * definit dans /includes/modules/supplier_invoice/modules_facturefournisseur.php + */ // Save modele used $facture=new FactureFournisseur($db); @@ -866,7 +866,7 @@ if ($action=='remove_file') /* * View - */ +*/ llxHeader('','',''); @@ -887,53 +887,53 @@ if ($_GET['action'] == 'create') $societe->fetch($_GET['socid']); } - if (GETPOST('origin') && GETPOST('originid')) - { - // Parse element/subelement (ex: project_task) - $element = $subelement = GETPOST('origin'); + if (GETPOST('origin') && GETPOST('originid')) + { + // Parse element/subelement (ex: project_task) + $element = $subelement = GETPOST('origin'); - if ($element == 'project') - { + if ($element == 'project') + { $projectid=GETPOST('originid'); - } - else if (in_array($element,array('order_supplier'))) - { - // For compatibility - if ($element == 'order') { $element = $subelement = 'commande'; } + } + else if (in_array($element,array('order_supplier'))) + { + // For compatibility + if ($element == 'order') { $element = $subelement = 'commande'; } if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } if ($element == 'contract') { $element = $subelement = 'contrat'; } if ($element == 'order_supplier') { $element = 'fourn'; $subelement = 'fournisseur.commande'; } + + require_once(DOL_DOCUMENT_ROOT.'/'.$element.'/class/'.$subelement.'.class.php'); + $classname = ucfirst($subelement); + if ($classname == 'Fournisseur.commande') $classname='CommandeFournisseur'; + $objectsrc = new $classname($db); + $objectsrc->fetch(GETPOST('originid')); + $objectsrc->fetch_thirdparty(); - require_once(DOL_DOCUMENT_ROOT.'/'.$element.'/class/'.$subelement.'.class.php'); - $classname = ucfirst($subelement); - if ($classname == 'Fournisseur.commande') $classname='CommandeFournisseur'; - $objectsrc = new $classname($db); - $objectsrc->fetch(GETPOST('originid')); - $objectsrc->fetch_thirdparty(); + $projectid = (!empty($objectsrc->fk_project)?$object->fk_project:''); + //$ref_client = (!empty($objectsrc->ref_client)?$object->ref_client:''); - $projectid = (!empty($objectsrc->fk_project)?$object->fk_project:''); - //$ref_client = (!empty($objectsrc->ref_client)?$object->ref_client:''); + $soc = $objectsrc->client; + $cond_reglement_id = (!empty($objectsrc->cond_reglement_id)?$objectsrc->cond_reglement_id:(!empty($soc->cond_reglement_id)?$soc->cond_reglement_id:1)); + $mode_reglement_id = (!empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(!empty($soc->mode_reglement_id)?$soc->mode_reglement_id:0)); + $remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0)); + $remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0)); + $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; - $soc = $objectsrc->client; - $cond_reglement_id = (!empty($objectsrc->cond_reglement_id)?$objectsrc->cond_reglement_id:(!empty($soc->cond_reglement_id)?$soc->cond_reglement_id:1)); - $mode_reglement_id = (!empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(!empty($soc->mode_reglement_id)?$soc->mode_reglement_id:0)); - $remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0)); - $remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0)); - $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; - - $datetmp=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']); - $dateinvoice=($datetmp==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0):$datetmp); - $datetmp=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']); - $datedue=($datetmp==''?-1:$datetmp); - } - } - else - { - $datetmp=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']); - $dateinvoice=($datetmp==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0):$datetmp); - $datetmp=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']); - $datedue=($datetmp==''?-1:$datetmp); - } + $datetmp=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']); + $dateinvoice=($datetmp==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0):$datetmp); + $datetmp=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']); + $datedue=($datetmp==''?-1:$datetmp); + } + } + else + { + $datetmp=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']); + $dateinvoice=($datetmp==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0):$datetmp); + $datetmp=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']); + $datedue=($datetmp==''?-1:$datetmp); + } print '
'; print ''; @@ -942,10 +942,10 @@ if ($_GET['action'] == 'create') print ''; print ''; - // Ref - print ''; + // Ref + print ''; - // Third party + // Third party print ''; print ''; print ''; - print ''; - // Label + // Label print ''; // Date invoice @@ -1065,68 +1065,83 @@ if ($_GET['action'] == 'create') print ''; print ''; - if (is_object($objectsrc)) - { - print "\n"; - print "\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''; - print ''; + if (is_object($objectsrc)) + { + print "\n"; + print "\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''; + print ''; - $txt=$langs->trans($classname); - if ($classname=='CommandeFournisseur') $txt=$langs->trans("SupplierOrder"); - print ''; - print ''; - print '"; - if ($mysoc->pays_code=='ES') - { - if ($mysoc->localtax1_assuj=="1") //Localtax1 RE - { - print '"; - } + $txt=$langs->trans($classname); + if ($classname=='CommandeFournisseur') $txt=$langs->trans("SupplierOrder"); + print ''; + print ''; + print '"; + if ($mysoc->pays_code=='ES') + { + if ($mysoc->localtax1_assuj=="1") //Localtax1 RE + { + print '"; + } - if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF - { - print '"; - } - } - print '"; - } + if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF + { + print '"; + } + } + print '"; + } else { - if ($conf->global->PRODUCT_SHOW_WHEN_CREATE) - { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + if ($conf->global->PRODUCT_SHOW_WHEN_CREATE) + { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; - for ($i = 1 ; $i < 9 ; $i++) - { - $value_qty = '1'; - $value_tauxtva = ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - } - } + for ($i = 1 ; $i < 9 ; $i++) + { + $value_qty = '1'; + $value_tauxtva = ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } + } } - // Bouton "Create Draft" - print "
'.$langs->trans('Ref').''.$langs->trans('Draft').'
'.$langs->trans('Ref').''.$langs->trans('Draft').'
'.$langs->trans('ThirdParty').''; @@ -964,91 +964,91 @@ if ($_GET['action'] == 'create') print '
'.$langs->trans('RefSupplier').'
'.$langs->trans('Type').''; - print ''."\n"; + print ''; + // Credit note + print ''."\n"; + */ + print '
'.$langs->trans('Type').''; + print ''."\n"; - // Standard invoice - print ''."\n"; + // Standard invoice + print ''."\n"; - /* - // Deposit - print ''."\n"; + /* + // Deposit + print ''."\n"; - // Proforma - if ($conf->global->FACTURE_USE_PROFORMAT) - { - print ''."\n"; - } + // Proforma + if ($conf->global->FACTURE_USE_PROFORMAT) + { + print ''."\n"; + } - // Replacement - print ''; + // Replacement + print ''; - // Credit note - print ''."\n"; -*/ - print '
'; - print ''; - print ''; - $desc=$html->textwithpicto($langs->trans("InvoiceStandardAsk"),$langs->transnoentities("InvoiceStandardDesc"),1); - print $desc; - print '
'; + print ''; + print ''; + $desc=$html->textwithpicto($langs->trans("InvoiceStandardAsk"),$langs->transnoentities("InvoiceStandardDesc"),1); + print $desc; + print '
'; - print ''; - print ''; - $desc=$html->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1); - print $desc; - print '
'; + print ''; + print ''; + $desc=$html->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1); + print $desc; + print '
'; - print ''; - print ''; - $desc=$html->textwithpicto($langs->trans("InvoiceProForma"),$langs->transnoentities("InvoiceProFormaDesc"),1); - print $desc; - print '
'; + print ''; + print ''; + $desc=$html->textwithpicto($langs->trans("InvoiceProForma"),$langs->transnoentities("InvoiceProFormaDesc"),1); + print $desc; + print '
'; - print ''; - print ''; - $text=$langs->trans("InvoiceReplacementAsk").' '; - $text.=''; - $desc=$html->textwithpicto($text,$langs->transnoentities("InvoiceReplacementDesc"),1); - print $desc; - print '
'; + print ''; + print ''; + $text=$langs->trans("InvoiceReplacementAsk").' '; + $text.=''; + $desc=$html->textwithpicto($text,$langs->transnoentities("InvoiceReplacementDesc"),1); + print $desc; + print '
'; - print ''; - print ''; - $text=$langs->transnoentities("InvoiceAvoirAsk").' '; - // $text.=''; - $text.=''; - $desc=$html->textwithpicto($text,$langs->transnoentities("InvoiceAvoirDesc"),1); - //.' ('.$langs->trans("FeatureNotYetAvailable").')',$langs->transnoentities("InvoiceAvoirDesc"),1); - print $desc; - print '
'; - print '
'; + print ''; + print ''; + $text=$langs->transnoentities("InvoiceAvoirAsk").' '; + // $text.=''; + $text.=''; + $desc=$html->textwithpicto($text,$langs->transnoentities("InvoiceAvoirDesc"),1); + //.' ('.$langs->trans("FeatureNotYetAvailable").')',$langs->transnoentities("InvoiceAvoirDesc"),1); + print $desc; + print '
'; + print '
'.$langs->trans('Label').'
'.$txt.''.$objectsrc->getNomUrl(1).'
'.$langs->trans('TotalHT').''.price($objectsrc->total_ht).'
'.$langs->trans('TotalVAT').''.price($objectsrc->total_tva)."
'.$langs->transcountry("AmountLT1",$mysoc->pays_code).''.price($objectsrc->total_localtax1)."
'.$txt.''.$objectsrc->getNomUrl(1).'
'.$langs->trans('TotalHT').''.price($objectsrc->total_ht).'
'.$langs->trans('TotalVAT').''.price($objectsrc->total_tva)."
'.$langs->transcountry("AmountLT1",$mysoc->pays_code).''.price($objectsrc->total_localtax1)."
'.$langs->transcountry("AmountLT2",$mysoc->pays_code).''.price($objectsrc->total_localtax2)."
'.$langs->trans('TotalTTC').''.price($objectsrc->total_ttc)."
'.$langs->transcountry("AmountLT2",$mysoc->pays_code).''.price($objectsrc->total_localtax2)."
'.$langs->trans('TotalTTC').''.price($objectsrc->total_ttc)."
 '.$langs->trans('Label').''.$langs->trans('PriceUHT').''.$langs->trans('VAT').''.$langs->trans('Qty').''.$langs->trans('PriceUTTC').'
 '.$langs->trans('Label').''.$langs->trans('PriceUHT').''.$langs->trans('VAT').''.$langs->trans('Qty').''.$langs->trans('PriceUTTC').'
'.$i.''; - print $html->load_tva('tauxtva'.$i,$value_tauxtva,$societe,$mysoc); - print '
'.$i.''; + print $html->load_tva('tauxtva'.$i,$value_tauxtva,$societe,$mysoc); + print '
\n"; + // Bouton "Create Draft" + print "\n"; - print '
'; + print '
'; - print "
\n"; + print "\n"; + + // Show origin lines + if (is_object($objectsrc)) + { + print '
'; + + $title=$langs->trans('ProductsAndServices'); + print_titre($title); + + print ''; + + $objectsrc->printOriginLinesList($hookmanager); + + print '
'; + } } else { @@ -1212,7 +1227,7 @@ else { /* * View card - */ + */ $head = facturefourn_prepare_head($fac); $titre=$langs->trans('SupplierInvoice'); dol_fiche_head($head, 'card', $titre, 0, 'bill'); @@ -1255,7 +1270,7 @@ else /* * Confirmation de la suppression de la facture fournisseur - */ + */ if ($_GET['action'] == 'delete') { $ret=$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1); @@ -1265,7 +1280,7 @@ else /* * Facture - */ + */ print ''; // Ref @@ -1331,7 +1346,7 @@ else /* * List of payments - */ + */ $nbrows=7; if ($conf->projet->enabled) $nbrows++; @@ -1484,7 +1499,7 @@ else /* * Lines - */ + */ print '
'; print '
'; $var=1; @@ -1636,7 +1651,7 @@ else /* * Form to add new line - */ + */ if ($fac->statut == 0 && $_GET['action'] != 'mod_ligne') { @@ -1743,7 +1758,7 @@ else /* * Boutons actions - */ + */ print '
'; @@ -1830,7 +1845,7 @@ else /* * Documents generes - */ + */ $ref=dol_sanitizeFileName($fac->ref); $subdir = get_exdir($fac->id,2).$ref; @@ -1846,7 +1861,7 @@ else /* * Linked object block - */ + */ $somethingshown=$object->showLinkedObjectBlock(); print '
';