Merge branch '3.4' of https://github.com/Dolibarr/dolibarr.git into 3.4
This commit is contained in:
commit
b6d5ebf81d
@ -53,7 +53,7 @@ $contactid=GETPOST('contactid','int');
|
|||||||
$socid = GETPOST('socid','int');
|
$socid = GETPOST('socid','int');
|
||||||
$id = GETPOST('id','int');
|
$id = GETPOST('id','int');
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions&allactions', '', 'id');
|
$result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions&allactions', 'fk_soc', 'id');
|
||||||
|
|
||||||
$error=GETPOST("error");
|
$error=GETPOST("error");
|
||||||
$mesg='';
|
$mesg='';
|
||||||
|
|||||||
@ -873,13 +873,17 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
|||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
{
|
{
|
||||||
// If deposit invoice
|
// If deposit invoice
|
||||||
if ($_POST['type'] == 3) {
|
if ($_POST['type'] == 3)
|
||||||
|
{
|
||||||
$typeamount=GETPOST('typedeposit','alpha');
|
$typeamount=GETPOST('typedeposit','alpha');
|
||||||
$valuedeposit=GETPOST('valuedeposit','int');
|
$valuedeposit=GETPOST('valuedeposit','int');
|
||||||
|
|
||||||
if ($typeamount=='amount') {
|
if ($typeamount=='amount')
|
||||||
|
{
|
||||||
$amountdeposit=$valuedeposit;
|
$amountdeposit=$valuedeposit;
|
||||||
}else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$amountdeposit=0;
|
$amountdeposit=0;
|
||||||
|
|
||||||
dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
|
dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
|
||||||
@ -887,19 +891,20 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
|||||||
$classname = ucfirst($subelement);
|
$classname = ucfirst($subelement);
|
||||||
$srcobject = new $classname($db);
|
$srcobject = new $classname($db);
|
||||||
|
|
||||||
dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add deposit line");
|
dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add deposit lines");
|
||||||
$result=$srcobject->fetch($object->origin_id);
|
$result=$srcobject->fetch($object->origin_id);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$totalamount=0;
|
$totalamount=0;
|
||||||
$lines = $srcobject->lines;
|
$lines = $srcobject->lines;
|
||||||
$num=count($lines);
|
$numlines=count($lines);
|
||||||
for ($i=0;$i<$num;$i++)
|
for ($i=0; $i<$numlines; $i++)
|
||||||
{
|
{
|
||||||
$totalamount=+$lines[$i]->subprice;
|
$totalamount += $lines[$i]->subprice;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($totalamount!=0) {
|
if ($totalamount!=0)
|
||||||
|
{
|
||||||
$amountdeposit=($totalamount*$valuedeposit)/100;
|
$amountdeposit=($totalamount*$valuedeposit)/100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2000,8 +2005,7 @@ if ($action == 'create')
|
|||||||
// Ref
|
// Ref
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans('Draft').'</td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans('Draft').'</td></tr>';
|
||||||
|
|
||||||
// Tiers
|
// Thirdparty
|
||||||
print '<tr>';
|
|
||||||
print '<td class="fieldrequired">'.$langs->trans('Customer').'</td>';
|
print '<td class="fieldrequired">'.$langs->trans('Customer').'</td>';
|
||||||
if($soc->id > 0)
|
if($soc->id > 0)
|
||||||
{
|
{
|
||||||
@ -2018,7 +2022,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
// Factures predefinies
|
// Predefined invoices
|
||||||
if (empty($origin) && empty($originid) && $socid > 0)
|
if (empty($origin) && empty($originid) && $socid > 0)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT r.rowid, r.titre, r.total_ttc';
|
$sql = 'SELECT r.rowid, r.titre, r.total_ttc';
|
||||||
@ -2125,10 +2129,13 @@ if ($action == 'create')
|
|||||||
print '</td><td valign="middle" class="nowrap">';
|
print '</td><td valign="middle" class="nowrap">';
|
||||||
$desc=$form->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1);
|
$desc=$form->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1);
|
||||||
print '<table class="nobordernopadding"><tr><td>'.$desc.'</td>';
|
print '<table class="nobordernopadding"><tr><td>'.$desc.'</td>';
|
||||||
if (($origin=='propal') ) {
|
if (($origin=='propal'))
|
||||||
print '<td><select name="typedeposit"><option value="amount">'.$langs->trans('FixAmount').'</option>';
|
{
|
||||||
print '<option value="variable">'.$langs->trans('VarAmount').'</option></select></td>';
|
print '<td class="nowrap" style="padding-left: 5px">';
|
||||||
print '<td>'.$langs->trans('Value').':<input type="text" name="valuedeposit" size="3" value="'.GETPOST('valuedeposit','int').'"/>';
|
$arraylist=array('amount'=>'FixAmount','variable'=>'VarAmount');
|
||||||
|
print $form->selectarray('typedeposit',$arraylist, GETPOST('typedeposit'), 0, 0, 0, '', 1);
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="nowrap" style="padding-left: 5px">'.$langs->trans('Value').':<input type="text" name="valuedeposit" size="3" value="'.GETPOST('valuedeposit','int').'"/>';
|
||||||
}
|
}
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
@ -2395,6 +2402,7 @@ if ($action == 'create')
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
}
|
}
|
||||||
else if ($id > 0 || ! empty($ref))
|
else if ($id > 0 || ! empty($ref))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -145,7 +145,7 @@ class CommActionRapport
|
|||||||
|
|
||||||
$nbpage = $this->_pages($pdf, $outputlangs);
|
$nbpage = $this->_pages($pdf, $outputlangs);
|
||||||
|
|
||||||
$pdf->AliasNbPages();
|
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
$pdf->Close();
|
$pdf->Close();
|
||||||
|
|
||||||
$pdf->Output($file,'F');
|
$pdf->Output($file,'F');
|
||||||
|
|||||||
@ -161,7 +161,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
|||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
$this->_pagefoot($pdf,'',$outputlangs);
|
$this->_pagefoot($pdf,'',$outputlangs);
|
||||||
$pdf->AliasNbPages();
|
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
$pdf->Close();
|
$pdf->Close();
|
||||||
|
|
||||||
|
|||||||
@ -467,7 +467,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||||
$pdf->AliasNbPages();
|
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
$pdf->Close();
|
$pdf->Close();
|
||||||
|
|
||||||
|
|||||||
@ -169,7 +169,7 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
$pagenb=0;
|
$pagenb=0;
|
||||||
$pdf->SetDrawColor(128,128,128);
|
$pdf->SetDrawColor(128,128,128);
|
||||||
|
|
||||||
$pdf->AliasNbPages();
|
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
|
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
|
||||||
$pdf->SetSubject($outputlangs->transnoentities("Sending"));
|
$pdf->SetSubject($outputlangs->transnoentities("Sending"));
|
||||||
@ -323,7 +323,7 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
$this->_pagefoot($pdf, $object, $outputlangs);
|
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||||
$pdf->AliasNbPages();
|
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
$pdf->Close();
|
$pdf->Close();
|
||||||
|
|
||||||
|
|||||||
@ -469,7 +469,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||||
$pdf->AliasNbPages();
|
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
$pdf->Close();
|
$pdf->Close();
|
||||||
|
|
||||||
|
|||||||
@ -319,7 +319,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||||
$pdf->AliasNbPages();
|
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
$pdf->Close();
|
$pdf->Close();
|
||||||
|
|
||||||
|
|||||||
@ -432,7 +432,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||||
$pdf->AliasNbPages();
|
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
// Check product remaining to be delivered
|
// Check product remaining to be delivered
|
||||||
// TODO doit etre modifie
|
// TODO doit etre modifie
|
||||||
@ -492,7 +492,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
|
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||||
|
|
||||||
$pdf->AliasNbPages();
|
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
$pdf->Close();
|
$pdf->Close();
|
||||||
|
|||||||
@ -287,7 +287,7 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
* Pied de page
|
* Pied de page
|
||||||
*/
|
*/
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||||
$pdf->AliasNbPages();
|
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
$pdf->Close();
|
$pdf->Close();
|
||||||
|
|
||||||
|
|||||||
@ -468,7 +468,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||||
$pdf->AliasNbPages();
|
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
$pdf->Close();
|
$pdf->Close();
|
||||||
|
|
||||||
|
|||||||
@ -210,7 +210,7 @@ class pdf_paiement
|
|||||||
|
|
||||||
$this->Body($pdf, 1, $lines, $outputlangs);
|
$this->Body($pdf, 1, $lines, $outputlangs);
|
||||||
|
|
||||||
$pdf->AliasNbPages();
|
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
$pdf->Close();
|
$pdf->Close();
|
||||||
|
|
||||||
|
|||||||
@ -407,7 +407,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
$this->_pagefoot($pdf, $object, $outputlangs);
|
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||||
$pdf->AliasNbPages();
|
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
$pdf->Close();
|
$pdf->Close();
|
||||||
|
|
||||||
|
|||||||
@ -468,7 +468,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
$this->_pagefoot($pdf, $object, $outputlangs);
|
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||||
$pdf->AliasNbPages();
|
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
$pdf->Close();
|
$pdf->Close();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user