New: Some changes to support the type of line in entities.
This commit is contained in:
parent
681a787fea
commit
861899f272
@ -35,7 +35,7 @@ if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/project.class.php')
|
|||||||
|
|
||||||
|
|
||||||
if (!$user->rights->fournisseur->facture->lire)
|
if (!$user->rights->fournisseur->facture->lire)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
$langs->load('bills');
|
$langs->load('bills');
|
||||||
$langs->load('suppliers');
|
$langs->load('suppliers');
|
||||||
@ -87,7 +87,7 @@ if ($_REQUEST['action'] == 'confirm_valid' && $_REQUEST['confirm'] == 'yes' && $
|
|||||||
{
|
{
|
||||||
$facturefourn=new FactureFournisseur($db);
|
$facturefourn=new FactureFournisseur($db);
|
||||||
$facturefourn->fetch($_GET['facid']);
|
$facturefourn->fetch($_GET['facid']);
|
||||||
$result = $facturefourn->set_valid($user);
|
$result = $facturefourn->set_valid($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes')
|
if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes')
|
||||||
@ -111,20 +111,20 @@ if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes')
|
|||||||
|
|
||||||
if ($_POST['action'] == 'confirm_deleteproductline' && $_POST['confirm'] == 'yes')
|
if ($_POST['action'] == 'confirm_deleteproductline' && $_POST['confirm'] == 'yes')
|
||||||
{
|
{
|
||||||
if ($user->rights->fournisseur->facture->creer)
|
if ($user->rights->fournisseur->facture->creer)
|
||||||
{
|
{
|
||||||
$facturefourn = new FactureFournisseur($db);
|
$facturefourn = new FactureFournisseur($db);
|
||||||
$facturefourn->fetch($_GET['facid']);
|
$facturefourn->fetch($_GET['facid']);
|
||||||
$facturefourn->deleteline($_GET['ligne_id']);
|
$facturefourn->deleteline($_GET['ligne_id']);
|
||||||
$_GET['action'] = '';
|
$_GET['action'] = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_REQUEST['action'] == 'confirm_payed' && $_REQUEST['confirm'] == 'yes' && $user->rights->fournisseur->facture->creer)
|
if ($_REQUEST['action'] == 'confirm_payed' && $_REQUEST['confirm'] == 'yes' && $user->rights->fournisseur->facture->creer)
|
||||||
{
|
{
|
||||||
$facturefourn=new FactureFournisseur($db);
|
$facturefourn=new FactureFournisseur($db);
|
||||||
$facturefourn->fetch($_GET['facid']);
|
$facturefourn->fetch($_GET['facid']);
|
||||||
$facturefourn->set_payed($user);
|
$facturefourn->set_payed($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_GET['action'] == 'deletepaiement')
|
if($_GET['action'] == 'deletepaiement')
|
||||||
@ -268,9 +268,9 @@ if ($_REQUEST['action'] == 'update_line')
|
|||||||
$price_base_type='TTC';
|
$price_base_type='TTC';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST['idprod'])
|
if ($_POST['idprod'])
|
||||||
{
|
{
|
||||||
$prod = new Product($db);
|
$prod = new Product($db);
|
||||||
$prod->fetch($_POST['idprod']);
|
$prod->fetch($_POST['idprod']);
|
||||||
$label = $prod->libelle;
|
$label = $prod->libelle;
|
||||||
}
|
}
|
||||||
@ -356,8 +356,8 @@ if ($_POST['action'] == 'classin')
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader('','','');
|
llxHeader('','','');
|
||||||
|
|
||||||
@ -504,7 +504,7 @@ else
|
|||||||
|
|
||||||
print '<tr><td>'.$langs->trans('DateEcheance').'</td><td nowrap="nowrap">';
|
print '<tr><td>'.$langs->trans('DateEcheance').'</td><td nowrap="nowrap">';
|
||||||
$html->select_date($fac->date_echeance,'ech','','','',"update");
|
$html->select_date($fac->date_echeance,'ech','','','',"update");
|
||||||
if (($fac->paye == 0) && ($fac->statut > 0) && $fac->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning");
|
if (($fac->paye == 0) && ($fac->statut > 0) && $fac->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans('AmountHT').'</td><td nowrap="nowrap"><b>'.price($fac->total_ht).'</b></td></tr>';
|
print '<tr><td>'.$langs->trans('AmountHT').'</td><td nowrap="nowrap"><b>'.price($fac->total_ht).'</b></td></tr>';
|
||||||
@ -557,7 +557,7 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -573,8 +573,8 @@ else
|
|||||||
// Confirmation de la suppression d'une ligne produit
|
// Confirmation de la suppression d'une ligne produit
|
||||||
if ($_GET['action'] == 'confirm_delete_line')
|
if ($_GET['action'] == 'confirm_delete_line')
|
||||||
{
|
{
|
||||||
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&ligne_id='.$_GET["ligne_id"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline');
|
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&ligne_id='.$_GET["ligne_id"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline');
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clone confirmation
|
// Clone confirmation
|
||||||
@ -605,8 +605,8 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de la suppression de la facture fournisseur
|
* Confirmation de la suppression de la facture fournisseur
|
||||||
*/
|
*/
|
||||||
if ($_GET['action'] == 'delete')
|
if ($_GET['action'] == 'delete')
|
||||||
{
|
{
|
||||||
$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete');
|
$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete');
|
||||||
@ -621,17 +621,17 @@ else
|
|||||||
*/
|
*/
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td nowrap="nowrap">'.$langs->trans("Ref").'</td><td colspan="3">';
|
print '<tr><td nowrap="nowrap">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||||
print $html->showrefnav($fac,'facid','',1,'rowid','ref',$morehtmlref);
|
print $html->showrefnav($fac,'facid','',1,'rowid','ref',$morehtmlref);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Ref supplier
|
// Ref supplier
|
||||||
print '<tr><td nowrap="nowrap">'.$langs->trans("RefSupplier").'</td><td colspan="3">'.$fac->ref_supplier.'</td>';
|
print '<tr><td nowrap="nowrap">'.$langs->trans("RefSupplier").'</td><td colspan="3">'.$fac->ref_supplier.'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Societe
|
// Societe
|
||||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">'.$societe->getNomUrl(1).'</td>';
|
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">'.$societe->getNomUrl(1).'</td>';
|
||||||
print '<td align="right"><a href="index.php?socid='.$fac->socid.'">'.$langs->trans('OtherBills').'</a></td>';
|
print '<td align="right"><a href="index.php?socid='.$fac->socid.'">'.$langs->trans('OtherBills').'</a></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -647,7 +647,7 @@ else
|
|||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans('DateEcheance').'</td><td colspan="3">';
|
print '<td>'.$langs->trans('DateEcheance').'</td><td colspan="3">';
|
||||||
print dol_print_date($fac->date_echeance,'daytext');
|
print dol_print_date($fac->date_echeance,'daytext');
|
||||||
if (($fac->paye == 0) && ($fac->statut > 0) && $fac->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning");
|
if (($fac->paye == 0) && ($fac->statut > 0) && $fac->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
@ -776,7 +776,7 @@ else
|
|||||||
/*
|
/*
|
||||||
* Lines of invoice
|
* Lines of invoice
|
||||||
*/
|
*/
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
$var=1;
|
$var=1;
|
||||||
for ($i = 0 ; $i < sizeof($fac->lignes) ; $i++)
|
for ($i = 0 ; $i < sizeof($fac->lignes) ; $i++)
|
||||||
@ -915,9 +915,16 @@ else
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Form to add new line
|
||||||
|
*/
|
||||||
|
|
||||||
if ($fac->statut == 0 && $_GET['action'] != 'mod_ligne')
|
if ($fac->statut == 0 && $_GET['action'] != 'mod_ligne')
|
||||||
{
|
{
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans('Label').'</td>';
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>';
|
||||||
|
print '<a name="add"></a>'; // ancre
|
||||||
|
print $langs->trans('AddNewLine').' - '.$langs->trans("FreeZone").'</td>';
|
||||||
print '<td align="right">'.$langs->trans('VAT').'</td>';
|
print '<td align="right">'.$langs->trans('VAT').'</td>';
|
||||||
print '<td align="right">'.$langs->trans('PriceUHT').'</td>';
|
print '<td align="right">'.$langs->trans('PriceUHT').'</td>';
|
||||||
print '<td align="right">'.$langs->trans('PriceUTTC').'</td>';
|
print '<td align="right">'.$langs->trans('PriceUTTC').'</td>';
|
||||||
@ -928,17 +935,35 @@ else
|
|||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
/* Nouvelle ligne */
|
// Add free products/services form
|
||||||
$var=!$var;
|
|
||||||
print '<form action="fiche.php?facid='.$fac->id.'&action=add_ligne" method="post">';
|
print '<form action="fiche.php?facid='.$fac->id.'&action=add_ligne" method="post">';
|
||||||
print '<input type="hidden" name="facid" value="'.$fac->id.'">';
|
print '<input type="hidden" name="facid" value="'.$fac->id.'">';
|
||||||
print '<input type="hidden" name="socid" value="'.$societe->id.'">';
|
print '<input type="hidden" name="socid" value="'.$societe->id.'">';
|
||||||
|
|
||||||
|
$var=true;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<textarea class="flat" cols="70" rows="'.ROWS_2.'" name="label"></textarea>';
|
|
||||||
|
print $html->select_type_of_lines(-1,'type',1);
|
||||||
|
if ($conf->produit->enabled && $conf->service->enabled) print '<br>';
|
||||||
|
|
||||||
|
// Editor wysiwyg
|
||||||
|
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS)
|
||||||
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||||
|
$doleditor=new DolEditor('label','',100,'dolibarr_details');
|
||||||
|
$doleditor->Create();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<textarea class="flat" cols="70" name="label" rows="'.ROWS_2.'"></textarea>';
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right">';
|
print '<td align="center">';
|
||||||
$html->select_tva('tauxtva','',$societe,$mysoc);
|
//if($mysoc->tva_assuj == "0")
|
||||||
|
//print '<input type="hidden" name="tva_tx" value="0">0';
|
||||||
|
//else
|
||||||
|
print $html->select_tva('tauxtva',$conf->defaulttx,$societe,$mysoc);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
print '<input size="6" name="amount" type="text">';
|
print '<input size="6" name="amount" type="text">';
|
||||||
@ -954,25 +979,42 @@ else
|
|||||||
print '<td align="center" valign="middle" colspan="2"><input type="submit" class="button" value="'.$langs->trans('Add').'"></td></tr>';
|
print '<td align="center" valign="middle" colspan="2"><input type="submit" class="button" value="'.$langs->trans('Add').'"></td></tr>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
// Ajout de produits/services predefinis
|
// Ajout de produits/services predefinis
|
||||||
if ($conf->produit->enabled)
|
if ($conf->produit->enabled)
|
||||||
{
|
{
|
||||||
print '<form name="addligne_predef" action="fiche.php?facid='.$fac->id.'&action=add_ligne" method="post">';
|
print '<tr class="liste_titre">';
|
||||||
print '<input type="hidden" name="socid" value="'. $fac->socid .'">';
|
print '<td colspan="4">';
|
||||||
print '<input type="hidden" name="facid" value="'.$fac->id.'">';
|
print $langs->trans("AddNewLine").' - ';
|
||||||
print '<input type="hidden" name="socid" value="'.$fac->socid.'">';
|
if ($conf->service->enabled)
|
||||||
$var=! $var;
|
{
|
||||||
print '<tr '.$bc[$var].'>';
|
print $langs->trans('RecordedProductsAndServices');
|
||||||
print '<td colspan="4">';
|
}
|
||||||
$html->select_produits_fournisseurs($fac->socid,'','prodfournpriceid','',$filtre);
|
else
|
||||||
print '</td>';
|
{
|
||||||
print '<td align="right"><input type="text" name="qty" value="1" size="1"></td>';
|
print $langs->trans('RecordedProducts');
|
||||||
print '<td> </td>';
|
}
|
||||||
print '<td> </td>';
|
print '</td>';
|
||||||
print '<td align="center" valign="middle" rowspan="2" colspan="2"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
|
print '<td align="right">'.$langs->trans('Qty').'</td>';
|
||||||
print '</tr>';
|
print '<td align="right"> </td>';
|
||||||
print '</form>';
|
print '<td colspan="4"> </td>';
|
||||||
}
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<form name="addligne_predef" action="fiche.php?facid='.$fac->id.'&action=add_ligne" method="post">';
|
||||||
|
print '<input type="hidden" name="socid" value="'. $fac->socid .'">';
|
||||||
|
print '<input type="hidden" name="facid" value="'.$fac->id.'">';
|
||||||
|
print '<input type="hidden" name="socid" value="'.$fac->socid.'">';
|
||||||
|
$var=! $var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td colspan="4">';
|
||||||
|
$html->select_produits_fournisseurs($fac->socid,'','prodfournpriceid','',$filtre);
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="right"><input type="text" name="qty" value="1" size="1"></td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td align="center" valign="middle" rowspan="2" colspan="2"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
|
||||||
|
print '</tr>';
|
||||||
|
print '</form>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user