NEW : interface
This commit is contained in:
parent
480b08bd0b
commit
c433829d27
@ -2591,8 +2591,8 @@ else if ($id > 0 || ! empty($ref))
|
||||
$filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
|
||||
$filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
|
||||
} else {
|
||||
$filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description LIKE '(DEPOSIT)%')";
|
||||
$filtercreditnote = "fk_facture_source IS NOT NULL AND description NOT LIKE '(DEPOSIT)%'";
|
||||
$filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND (description LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%'))";
|
||||
$filtercreditnote = "fk_facture_source IS NOT NULL AND description NOT LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%'";
|
||||
}
|
||||
|
||||
$absolute_discount = $soc->getAvailableDiscounts('', $filterabsolutediscount);
|
||||
@ -3740,7 +3740,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
// For standard invoice with excess received
|
||||
if ($object->type == Facture::TYPE_STANDARD && empty($object->paye) && ($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits) < 0 && $user->rights->facture->creer && empty($discount->id))
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=converttoreduc">'.$langs->trans('ConvertToReduc').'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=converttoreduc">'.$langs->trans('ConvertExcessReceivedToReduc').'</a></div>';
|
||||
}
|
||||
// For credit note
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $user->rights->facture->creer && $object->getSommePaiement() == 0) {
|
||||
|
||||
@ -3411,6 +3411,12 @@ abstract class CommonObject
|
||||
$discount->fetch($line->fk_remise_except);
|
||||
$this->tpl['description'] = $langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0));
|
||||
}
|
||||
elseif ($line->desc == '(EXCESS RECEIVED)')
|
||||
{
|
||||
$discount=new DiscountAbsolute($this->db);
|
||||
$discount->fetch($line->fk_remise_except);
|
||||
$this->tpl['description'] = $langs->transnoentities("DiscountFromExcessReceived",$discount->getNomUrl(0));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->tpl['description'] = dol_trunc($line->desc,60);
|
||||
|
||||
@ -1130,6 +1130,7 @@ class Form
|
||||
$desc=dol_trunc($obj->description,40);
|
||||
if (preg_match('/\(CREDIT_NOTE\)/', $desc)) $desc=preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $desc);
|
||||
if (preg_match('/\(DEPOSIT\)/', $desc)) $desc=preg_replace('/\(DEPOSIT\)/', $langs->trans("Deposit"), $desc);
|
||||
if (preg_match('/\(EXCESS RECEIVED\)/', $desc)) $desc=preg_replace('/\(EXCESS RECEIVED\)/', $langs->trans("ExcessReceived"), $desc);
|
||||
|
||||
$selectstring='';
|
||||
if ($selected > 0 && $selected == $obj->rowid) $selectstring=' selected';
|
||||
@ -3762,7 +3763,7 @@ class Form
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description LIKE '(DEPOSIT)%')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': ';
|
||||
if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND (description LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%'))") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': ';
|
||||
else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)).': ';
|
||||
}
|
||||
$newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles
|
||||
|
||||
@ -83,6 +83,12 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
|
||||
// Add date of deposit
|
||||
if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) $libelleproduitservice.=' ('.dol_print_date($discount->datec,'day','',$outputlangs).')';
|
||||
}
|
||||
elseif ($desc == '(EXCESS RECEIVED)' && $line->fk_remise_except)
|
||||
{
|
||||
$discount=new DiscountAbsolute($db);
|
||||
$discount->fetch($line->fk_remise_except);
|
||||
$libelleproduitservice=$outputlangs->transnoentitiesnoconv("DiscountFromExcessReceived",$discount->ref_facture_source);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($idprod)
|
||||
|
||||
@ -1149,6 +1149,12 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
|
||||
// Add date of deposit
|
||||
if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec,'day','',$outputlangs).')';
|
||||
}
|
||||
if ($desc == '(EXCESS RECEIVED)' && $object->lines[$i]->fk_remise_except)
|
||||
{
|
||||
$discount=new DiscountAbsolute($db);
|
||||
$discount->fetch($object->lines[$i]->fk_remise_except);
|
||||
$libelleproduitservice=$outputlangs->transnoentitiesnoconv("DiscountFromExcessReceived",$discount->ref_facture_source);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($idprod)
|
||||
|
||||
@ -61,6 +61,7 @@ if (empty($usemargins)) $usemargins=0;
|
||||
$txt='';
|
||||
print img_object($langs->trans("ShowReduc"),'reduc').' ';
|
||||
if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit");
|
||||
elseif ($line->description == '(EXCESS RECEIVED)') $txt=$langs->trans("ExcessReceived");
|
||||
//else $txt=$langs->trans("Discount");
|
||||
print $txt;
|
||||
?>
|
||||
@ -82,6 +83,12 @@ if (empty($usemargins)) $usemargins=0;
|
||||
// Add date of deposit
|
||||
if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')';
|
||||
}
|
||||
elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0)
|
||||
{
|
||||
$discount=new DiscountAbsolute($this->db);
|
||||
$discount->fetch($line->fk_remise_except);
|
||||
echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessReceived",$discount->getNomUrl(0));
|
||||
}
|
||||
else
|
||||
{
|
||||
echo ($txt?' - ':'').dol_htmlentitiesbr($line->description);
|
||||
|
||||
@ -99,6 +99,7 @@ SendRemindByMail=Send reminder by EMail
|
||||
DoPayment=Do payment
|
||||
DoPaymentBack=Do payment back
|
||||
ConvertToReduc=Convert into future discount
|
||||
ConvertExcessReceivedToReduc=Convert excess received into future discount
|
||||
EnterPaymentReceivedFromCustomer=Enter payment received from customer
|
||||
EnterPaymentDueToCustomer=Make payment due to customer
|
||||
DisabledBecauseRemainderToPayIsZero=Disabled because remaining unpaid is zero
|
||||
@ -255,6 +256,7 @@ Deposit=Deposit
|
||||
Deposits=Deposits
|
||||
DiscountFromCreditNote=Discount from credit note %s
|
||||
DiscountFromDeposit=Payments from deposit invoice %s
|
||||
DiscountFromExcessReceived=Payments from excess received of invoice %s
|
||||
AbsoluteDiscountUse=This kind of credit can be used on invoice before its validation
|
||||
CreditNoteDepositUse=Invoice must be validated to use this king of credits
|
||||
NewGlobalDiscount=New absolute discount
|
||||
|
||||
@ -461,6 +461,7 @@ if ($sql_select)
|
||||
$txt='';
|
||||
print img_object($langs->trans("ShowReduc"),'reduc').' ';
|
||||
if ($objp->description == '(DEPOSIT)') $txt=$langs->trans("Deposit");
|
||||
elseif ($objp->description == '(EXCESS RECEIVED)') $txt=$langs->trans("ExcessReceived");
|
||||
//else $txt=$langs->trans("Discount");
|
||||
print $txt;
|
||||
?>
|
||||
@ -474,6 +475,12 @@ if ($sql_select)
|
||||
$discount->fetch($objp->fk_remise_except);
|
||||
echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0));
|
||||
}
|
||||
if ($objp->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0)
|
||||
{
|
||||
$discount=new DiscountAbsolute($db);
|
||||
$discount->fetch($objp->fk_remise_except);
|
||||
echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessReceived",$discount->getNomUrl(0));
|
||||
}
|
||||
elseif ($objp->description == '(DEPOSIT)' && $objp->fk_remise_except > 0)
|
||||
{
|
||||
$discount=new DiscountAbsolute($db);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user