Merge remote-tracking branch 'origin/3.4' into develop
Conflicts: htdocs/compta/facture.php htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
This commit is contained in:
commit
b57ed72fc1
@ -71,7 +71,7 @@ if ($_POST["action"] == 'add')
|
||||
|
||||
$account->currency_code = trim($_POST["account_currency_code"]);
|
||||
|
||||
$account->state_id = $_POST["account_departement_id"];
|
||||
$account->state_id = $_POST["account_state_id"];
|
||||
$account->country_id = $_POST["account_country_id"];
|
||||
|
||||
$account->min_allowed = $_POST["account_min_allowed"];
|
||||
|
||||
@ -875,14 +875,18 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
||||
|
||||
if ($id > 0)
|
||||
{
|
||||
//If deposit invoice
|
||||
if ($_POST['type'] == 3) {
|
||||
// If deposit invoice
|
||||
if ($_POST['type'] == 3)
|
||||
{
|
||||
$typeamount=GETPOST('typedeposit','alpha');
|
||||
$valuedeposit=GETPOST('valuedeposit','int');
|
||||
|
||||
if ($typeamount=='amount') {
|
||||
if ($typeamount=='amount')
|
||||
{
|
||||
$amountdeposit=$valuedeposit;
|
||||
}else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$amountdeposit=0;
|
||||
|
||||
dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
|
||||
@ -890,19 +894,20 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
||||
$classname = ucfirst($subelement);
|
||||
$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);
|
||||
if ($result > 0)
|
||||
{
|
||||
$totalamount=0;
|
||||
$lines = $srcobject->lines;
|
||||
$num=count($lines);
|
||||
for ($i=0;$i<$num;$i++)
|
||||
$numlines=count($lines);
|
||||
for ($i=0; $i<$numlines; $i++)
|
||||
{
|
||||
$totalamount=+$lines[$i]->subprice;
|
||||
$totalamount += $lines[$i]->subprice;
|
||||
}
|
||||
|
||||
if ($totalamount!=0) {
|
||||
if ($totalamount!=0)
|
||||
{
|
||||
$amountdeposit=($totalamount*$valuedeposit)/100;
|
||||
}
|
||||
}
|
||||
@ -1585,7 +1590,7 @@ else if ($action == 'down' && $user->rights->facture->creer)
|
||||
|
||||
/*
|
||||
* Add file in email form
|
||||
*/
|
||||
*/
|
||||
if (GETPOST('addfile'))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
@ -1600,7 +1605,7 @@ if (GETPOST('addfile'))
|
||||
|
||||
/*
|
||||
* Remove file in email form
|
||||
*/
|
||||
*/
|
||||
if (! empty($_POST['removedfile']))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
@ -1616,7 +1621,7 @@ if (! empty($_POST['removedfile']))
|
||||
|
||||
/*
|
||||
* Send mail
|
||||
*/
|
||||
*/
|
||||
if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_POST['cancel'])
|
||||
{
|
||||
$langs->load('mails');
|
||||
@ -1790,7 +1795,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
|
||||
/*
|
||||
* Generate document
|
||||
*/
|
||||
*/
|
||||
else if ($action == 'builddoc') // En get ou en post
|
||||
{
|
||||
$object->fetch($id);
|
||||
@ -2058,8 +2063,7 @@ if ($action == 'create')
|
||||
// Ref
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans('Draft').'</td></tr>';
|
||||
|
||||
// Tiers
|
||||
print '<tr>';
|
||||
// Thirdparty
|
||||
print '<td class="fieldrequired">'.$langs->trans('Customer').'</td>';
|
||||
if($soc->id > 0)
|
||||
{
|
||||
@ -2076,7 +2080,7 @@ if ($action == 'create')
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Factures predefinies
|
||||
// Predefined invoices
|
||||
if (empty($origin) && empty($originid) && $socid > 0)
|
||||
{
|
||||
$sql = 'SELECT r.rowid, r.titre, r.total_ttc';
|
||||
@ -2183,10 +2187,13 @@ if ($action == 'create')
|
||||
print '</td><td valign="middle" class="nowrap">';
|
||||
$desc=$form->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1);
|
||||
print '<table class="nobordernopadding"><tr><td>'.$desc.'</td>';
|
||||
if (($origin=='propal') || ($origin=='commande')) {
|
||||
print '<td><select name="typedeposit"><option value="amount">'.$langs->trans('FixAmount').'</option>';
|
||||
print '<option value="variable">'.$langs->trans('VarAmount').'</option></select></td>';
|
||||
print '<td>'.$langs->trans('Value').':<input type="text" name="valuedeposit" size="3" value="'.GETPOST('valuedeposit','int').'"/>';
|
||||
if (($origin=='propal') || ($origin=='commande'))
|
||||
{
|
||||
print '<td class="nowrap" style="padding-left: 5px">';
|
||||
$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>'."\n";
|
||||
@ -2455,6 +2462,7 @@ if ($action == 'create')
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
else if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
|
||||
@ -470,8 +470,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs);
|
||||
}
|
||||
|
||||
// Pied de page
|
||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||
// Pied de page
|
||||
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||
|
||||
$pdf->Close();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user