Task #8618
This commit is contained in:
parent
bca7312d3d
commit
af4fabc531
@ -982,6 +982,8 @@ class FactureFournisseur extends Facture
|
|||||||
{
|
{
|
||||||
global $user,$langs,$conf;
|
global $user,$langs,$conf;
|
||||||
|
|
||||||
|
$now = dol_now();
|
||||||
|
|
||||||
// Charge tableau des produits prodids
|
// Charge tableau des produits prodids
|
||||||
$prodids = array();
|
$prodids = array();
|
||||||
|
|
||||||
@ -1007,7 +1009,7 @@ class FactureFournisseur extends Facture
|
|||||||
$this->ref = 'SPECIMEN';
|
$this->ref = 'SPECIMEN';
|
||||||
$this->specimen=1;
|
$this->specimen=1;
|
||||||
$this->socid = 1;
|
$this->socid = 1;
|
||||||
$this->date = time();
|
$this->date = $now;
|
||||||
$this->date_lim_reglement=$this->date+3600*24*30;
|
$this->date_lim_reglement=$this->date+3600*24*30;
|
||||||
$this->cond_reglement_code = 'RECEP';
|
$this->cond_reglement_code = 'RECEP';
|
||||||
$this->mode_reglement_code = 'CHQ';
|
$this->mode_reglement_code = 'CHQ';
|
||||||
|
|||||||
@ -155,17 +155,32 @@ if($_GET['action'] == 'deletepaiement')
|
|||||||
|
|
||||||
if ($_POST['action'] == 'update' && ! $_POST['cancel'])
|
if ($_POST['action'] == 'update' && ! $_POST['cancel'])
|
||||||
{
|
{
|
||||||
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
$error=0;
|
||||||
|
|
||||||
|
$date = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||||
$date_echeance = dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']);
|
$date_echeance = dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']);
|
||||||
|
|
||||||
|
if (! $date)
|
||||||
|
{
|
||||||
|
$msg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateEch"));
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
if ($date_echeance && $date_echeance < $date)
|
||||||
|
{
|
||||||
|
$date_echeance = $date;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture_fourn set ';
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture_fourn set ';
|
||||||
$sql .= " facnumber='".addslashes(trim($_POST['facnumber']))."'";
|
$sql .= " facnumber='".$db->escape(trim($_POST['facnumber']))."'";
|
||||||
$sql .= ", libelle='".addslashes(trim($_POST['libelle']))."'";
|
$sql .= ", libelle='".$db->escape(trim($_POST['libelle']))."'";
|
||||||
$sql .= ", note='".$_POST['note']."'";
|
$sql .= ", note='".$db->escape($_POST['note'])."'";
|
||||||
$sql .= ", datef = '".$db->idate($datefacture)."'";
|
$sql .= ", datef = '".$db->idate($date)."'";
|
||||||
$sql .= ", date_lim_reglement = '".$db->idate($date_echeance)."'";
|
$sql .= ", date_lim_reglement = '".$db->idate($date_echeance)."'";
|
||||||
$sql .= ' WHERE rowid = '.$_GET['facid'].' ;';
|
$sql .= ' WHERE rowid = '.$_GET['facid'].' ;';
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Action creation
|
* Action creation
|
||||||
@ -399,7 +414,7 @@ if ($_POST['action'] == 'classin')
|
|||||||
{
|
{
|
||||||
$facture = new FactureFournisseur($db,'',$_GET['facid']);
|
$facture = new FactureFournisseur($db,'',$_GET['facid']);
|
||||||
$facture->fetch($_GET['facid']);
|
$facture->fetch($_GET['facid']);
|
||||||
$facture->setProject($_POST['projectid']);
|
$result=$facture->setProject($_POST['projectid']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1288,7 +1303,8 @@ else
|
|||||||
}
|
}
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
if ($_GET['action'] != 'edit')
|
||||||
|
{
|
||||||
print '<table width="100%"><tr><td width="50%" valign="top">';
|
print '<table width="100%"><tr><td width="50%" valign="top">';
|
||||||
print '<a name="builddoc"></a>'; // ancre
|
print '<a name="builddoc"></a>'; // ancre
|
||||||
|
|
||||||
@ -1318,6 +1334,7 @@ else
|
|||||||
|
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -152,7 +152,7 @@ function facture_pdf_create($db, $object, $message, $modele, $outputlangs)
|
|||||||
// Positionne modele sur le nom du modele a utiliser
|
// Positionne modele sur le nom du modele a utiliser
|
||||||
if (! dol_strlen($modele))
|
if (! dol_strlen($modele))
|
||||||
{
|
{
|
||||||
if ($conf->global->FACTURE_ADDON_PDF)
|
if (! empty($conf->global->FACTURE_ADDON_PDF))
|
||||||
{
|
{
|
||||||
$modele = $conf->global->FACTURE_ADDON_PDF;
|
$modele = $conf->global->FACTURE_ADDON_PDF;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,8 +80,9 @@ function supplier_invoice_pdf_create($db, $object, $model, $outputlangs)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("Error")." ".$langs->trans("Error_INVOICE_SUPPLIER_ADDON_PDF_NotDefined");
|
$model = 'canelle';
|
||||||
return 0;
|
//print $langs->trans("Error")." ".$langs->trans("Error_INVOICE_SUPPLIER_ADDON_PDF_NotDefined");
|
||||||
|
//return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Charge le modele
|
// Charge le modele
|
||||||
|
|||||||
@ -614,10 +614,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
|
|
||||||
$posy+=6;
|
$posy+=6;
|
||||||
$pdf->SetXY(100,$posy);
|
$pdf->SetXY(100,$posy);
|
||||||
if ($object->date_facture)
|
if ($object->date)
|
||||||
{
|
{
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_facture,"day",false,$outputlangs,true), '', 'R');
|
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date,"day",false,$outputlangs,true), '', 'R');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user