Update work
This commit is contained in:
parent
ae6f547ba5
commit
15e50ecdb3
@ -167,8 +167,8 @@ if ($action == 'delete')
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
@ -194,16 +194,16 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
print "\n".'<script type="text/javascript" language="javascript">';
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
print '$(document).ready(function () {
|
print '$(document).ready(function () {
|
||||||
$("#radiopayment").click(function() {
|
$("#radiopayment").click(function() {
|
||||||
$("#Label").html(document.formvat.Label.value);
|
$("#label").val($(this).data("label"));
|
||||||
document.formvat.refund.value=0;
|
|
||||||
});
|
});
|
||||||
$("#radiorefund").click(function() {
|
$("#radiorefund").click(function() {
|
||||||
$("#Label").html(document.formvat.Label.value);
|
$("#label").val($(this).data("label"));
|
||||||
document.formsoc.refund.value=1;
|
|
||||||
});
|
});
|
||||||
});';
|
});';
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" name="formvat" method="post">';
|
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" name="formvat" method="post">';
|
||||||
@ -215,13 +215,13 @@ if ($action == 'create')
|
|||||||
print $langs->trans("Type").': ';
|
print $langs->trans("Type").': ';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<label for="radiopayment">';
|
print '<label for="radiopayment">';
|
||||||
print '<input type="radio" id="radiopayment" class="flat" name="refund" value="0"'.($refund?'':' checked').'>';
|
print '<input type="radio" id="radiopayment" data-label="'.$langs->trans('VATPayment').'" class="flat" name="refund" value="0"'.($refund?'':' checked="checked"').'>';
|
||||||
print ' ';
|
print ' ';
|
||||||
print $langs->trans("Payment");
|
print $langs->trans("Payment");
|
||||||
print '</label>';
|
print '</label>';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<label for="radiorefund">';
|
print '<label for="radiorefund">';
|
||||||
print '<input type="radio" id="radiorefund" class="flat" name="refund" value="1"'.($refund?' checked':'').'>';
|
print '<input type="radio" id="radiorefund" data-label="'.$langs->trans('VATRefund').'" class="flat" name="refund" value="1"'.($refund?' checked="checked"':'').'>';
|
||||||
print ' ';
|
print ' ';
|
||||||
print $langs->trans("Refund");
|
print $langs->trans("Refund");
|
||||||
print '</label>';
|
print '</label>';
|
||||||
|
|||||||
@ -577,8 +577,12 @@ class Tva extends CommonObject
|
|||||||
$result=$acc->fetch($this->accountid);
|
$result=$acc->fetch($this->accountid);
|
||||||
if ($result <= 0) dol_print_error($this->db);
|
if ($result <= 0) dol_print_error($this->db);
|
||||||
|
|
||||||
$bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, -abs($this->amount), '', '', $user);
|
if ($this->amount > 0) {
|
||||||
|
$bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, -abs($this->amount), '', '', $user);
|
||||||
|
} else {
|
||||||
|
$bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, abs($this->amount), '', '', $user);
|
||||||
|
}
|
||||||
|
|
||||||
// Update fk_bank into llx_tva. So we know vat line used to generate bank transaction
|
// Update fk_bank into llx_tva. So we know vat line used to generate bank transaction
|
||||||
if ($bank_line_id > 0)
|
if ($bank_line_id > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user