Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
8aed039a
Commit
8aed039a
authored
9 years ago
by
aspangaro
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Accountancy Bank journal Fix some problem with other module
parent
10f30cf5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/accountancy/journal/bankjournal.php
+34
-45
34 additions, 45 deletions
htdocs/accountancy/journal/bankjournal.php
with
34 additions
and
45 deletions
htdocs/accountancy/journal/bankjournal.php
+
34
−
45
View file @
8aed039a
...
...
@@ -52,8 +52,9 @@ require_once DOL_DOCUMENT_ROOT . '/societe/class/client.class.php';
$langs
->
load
(
"companies"
);
$langs
->
load
(
"other"
);
$langs
->
load
(
"compta"
);
$langs
->
load
(
"bank"
);
$langs
->
load
(
"bank
s
"
);
$langs
->
load
(
'bills'
);
$langs
->
load
(
'donations'
);
$langs
->
load
(
"accountancy"
);
$id_bank_account
=
GETPOST
(
'id_account'
,
'int'
);
...
...
@@ -130,11 +131,12 @@ if ($result) {
$num
=
$db
->
num_rows
(
$result
);
// Variables
$cptfour
=
(
!
empty
(
$conf
->
global
->
ACCOUNTING_ACCOUNT_SUPPLIER
)
?
$conf
->
global
->
ACCOUNTING_ACCOUNT_SUPPLIER
:
$langs
->
trans
(
"CodeNotDef"
));
$cptcli
=
(
!
empty
(
$conf
->
global
->
ACCOUNTING_ACCOUNT_CUSTOMER
)
?
$conf
->
global
->
ACCOUNTING_ACCOUNT_CUSTOMER
:
$langs
->
trans
(
"CodeNotDef"
));
$accountancy_account_salary
=
(
!
empty
(
$conf
->
global
->
SALARIES_ACCOUNTING_ACCOUNT_PAYMENT
)
?
$conf
->
global
->
SALARIES_ACCOUNTING_ACCOUNT_PAYMENT
:
$langs
->
trans
(
"CodeNotDef"
));
$accountancy_account_pay_vat
=
(
!
empty
(
$conf
->
global
->
ACCOUNTING_VAT_PAY_ACCOUNT
)
?
$conf
->
global
->
ACCOUNTING_VAT_PAY_ACCOUNT
:
$langs
->
trans
(
"CodeNotDef"
));
$accountancy_account_pay_donation
=
(
!
empty
(
$conf
->
global
->
DONATION_ACCOUNTINGACCOUNT
)
?
$conf
->
global
->
DONATION_ACCOUNTINGACCOUNT
:
$langs
->
trans
(
"CodeNotDef"
));
$account_supplier
=
(
!
empty
(
$conf
->
global
->
ACCOUNTING_ACCOUNT_SUPPLIER
)
?
$conf
->
global
->
ACCOUNTING_ACCOUNT_SUPPLIER
:
$langs
->
trans
(
"CodeNotDef"
));
$account_customer
=
(
!
empty
(
$conf
->
global
->
ACCOUNTING_ACCOUNT_CUSTOMER
)
?
$conf
->
global
->
ACCOUNTING_ACCOUNT_CUSTOMER
:
$langs
->
trans
(
"CodeNotDef"
));
$account_employee
=
(
!
empty
(
$conf
->
global
->
SALARIES_ACCOUNTING_ACCOUNT_PAYMENT
)
?
$conf
->
global
->
SALARIES_ACCOUNTING_ACCOUNT_PAYMENT
:
$langs
->
trans
(
"CodeNotDef"
));
$account_pay_vat
=
(
!
empty
(
$conf
->
global
->
ACCOUNTING_VAT_PAY_ACCOUNT
)
?
$conf
->
global
->
ACCOUNTING_VAT_PAY_ACCOUNT
:
$langs
->
trans
(
"CodeNotDef"
));
$account_pay_donation
=
(
!
empty
(
$conf
->
global
->
DONATION_ACCOUNTINGACCOUNT
)
?
$conf
->
global
->
DONATION_ACCOUNTINGACCOUNT
:
$langs
->
trans
(
"CodeNotDef"
));
$account_transfer
=
(
!
empty
(
$conf
->
global
->
ACCOUNTING_ACCOUNT_TRANSFER_CASH
)
?
$conf
->
global
->
ACCOUNTING_ACCOUNT_TRANSFER_CASH
:
$langs
->
trans
(
"CodeNotDef"
));
$tabpay
=
array
();
$tabbq
=
array
();
...
...
@@ -154,11 +156,9 @@ if ($result) {
// Controls
$compta_bank
=
$obj
->
account_number
;
if
(
$obj
->
label
==
'(SupplierInvoicePayment)'
)
$compta_soc
=
(
!
empty
(
$obj
->
code_compta_fournisseur
)
?
$obj
->
code_compta_fournisseur
:
$
cptfou
r
);
$compta_soc
=
(
!
empty
(
$obj
->
code_compta_fournisseur
)
?
$obj
->
code_compta_fournisseur
:
$
account_supplie
r
);
if
(
$obj
->
label
==
'(CustomerInvoicePayment)'
)
$compta_soc
=
(
!
empty
(
$obj
->
code_compta
)
?
$obj
->
code_compta
:
$cptcli
);
if
(
$obj
->
typeop
==
'(BankTransfert)'
)
$compta_soc
=
$conf
->
global
->
ACCOUNTING_ACCOUNT_TRANSFER_CASH
;
$compta_soc
=
(
!
empty
(
$obj
->
code_compta
)
?
$obj
->
code_compta
:
$account_customer
);
// Variable bookkeeping
$tabpay
[
$obj
->
rowid
][
"date"
]
=
$obj
->
do
;
...
...
@@ -226,25 +226,23 @@ if ($result) {
$paymentdonstatic
->
id
=
$links
[
$key
][
'url_id'
];
$paymentdonstatic
->
fk_donation
=
$links
[
$key
][
'url_id'
];
$tabpay
[
$obj
->
rowid
][
"lib"
]
.
=
' '
.
$langs
->
trans
(
"PaymentDonation"
);
$tabtp
[
$obj
->
rowid
][
$
accountancy_
account_pay_donation
]
+=
$obj
->
amount
;
$tabtp
[
$obj
->
rowid
][
$account_pay_donation
]
+=
$obj
->
amount
;
}
else
if
(
$links
[
$key
][
'type'
]
==
'payment_vat'
)
{
$paymentvatstatic
->
id
=
$links
[
$key
][
'url_id'
];
$paymentvatstatic
->
ref
=
$links
[
$key
][
'url_id'
];
$paymentvatstatic
->
label
=
$links
[
$key
][
'label'
];
$tabpay
[
$obj
->
rowid
][
"lib"
]
.
=
' '
.
$langs
->
trans
(
"PaymentVat"
);
$tabtp
[
$obj
->
rowid
][
$
accountancy_
account_pay_vat
]
+=
$obj
->
amount
;
$tabtp
[
$obj
->
rowid
][
$account_pay_vat
]
+=
$obj
->
amount
;
}
else
if
(
$links
[
$key
][
'type'
]
==
'payment_salary'
)
{
$paymentsalstatic
->
id
=
$links
[
$key
][
'url_id'
];
$paymentsalstatic
->
ref
=
$links
[
$key
][
'url_id'
];
$paymentsalstatic
->
label
=
$links
[
$key
][
'label'
];
$tabpay
[
$obj
->
rowid
][
"lib"
]
.
=
' '
.
$paymentsalstatic
->
getNomUrl
(
2
);
$tabtp
[
$obj
->
rowid
][
$account
ancy_account_salary
]
+=
$obj
->
amount
;
$tabtp
[
$obj
->
rowid
][
$account
_employee
]
+=
$obj
->
amount
;
}
else
if
(
$links
[
$key
][
'type'
]
==
'banktransfert'
)
{
$tabpay
[
$obj
->
rowid
][
"lib"
]
.
=
' '
.
$
paymentvatstatic
->
getNomUrl
(
2
);
$tabtp
[
$obj
->
rowid
][
$
cpttva
]
+=
$obj
->
amount
;
$tabpay
[
$obj
->
rowid
][
"lib"
]
.
=
' '
.
$
langs
->
trans
(
"BankTransfer"
);
$tabtp
[
$obj
->
rowid
][
$
account_transfer
]
+=
$obj
->
amount
;
}
/*else {
$tabtp [$obj->rowid] [$accountancy_account_salary] += $obj->amount;
}*/
}
}
...
...
@@ -588,24 +586,30 @@ else {
foreach
(
$tabpay
as
$key
=>
$val
)
{
$date
=
dol_print_date
(
$db
->
jdate
(
$val
[
"date"
]),
'day'
);
if
(
$val
[
"lib"
]
==
'(SupplierInvoicePayment)'
)
{
$reflabel
=
$langs
->
trans
(
'SupplierInvoicePayment'
);
$reflabel
=
$val
[
"ref"
];
if
(
$reflabel
==
'(SupplierInvoicePayment)'
)
{
$reflabel
=
$langs
->
trans
(
'Supplier'
);
}
if
(
$val
[
"lib"
]
==
'(CustomerInvoicePayment)'
)
{
$reflabel
=
$langs
->
trans
(
'CustomerInvoicePayment'
);
if
(
$reflabel
==
'(CustomerInvoicePayment)'
)
{
$reflabel
=
$langs
->
trans
(
'Customer'
);
}
if
(
$reflabel
==
'(SocialContributionPayment)'
)
{
$reflabel
=
$langs
->
trans
(
'SocialContribution'
);
}
if
(
$reflabel
==
'(DonationPayment)'
)
{
$reflabel
=
$langs
->
trans
(
'Donation'
);
}
// Bank
foreach
(
$tabbq
[
$key
]
as
$k
=>
$mt
)
{
print
"<tr "
.
$bc
[
$var
]
.
">"
;
print
"<td>"
.
$date
.
"</td>"
;
print
"<td>"
.
$ref
label
.
"</td>"
;
print
"<td>"
.
$ref
.
"</td>"
;
print
"<td>"
.
length_accountg
(
$k
)
.
"</td>"
;
// print "<td>" . $langs->trans('Bank') . "</td>";
if
(
$val
[
'soclib'
]
==
''
)
{
print
"<td>"
.
$
l
an
gs
->
trans
(
'Bank'
)
.
" - "
.
$val
[
"ref"
]
.
"</td>"
;
print
"<td>"
.
$
b
an
k_code_journal
->
label
.
" - "
.
$val
[
"ref"
]
.
"</td>"
;
}
else
{
print
"<td>"
.
$
l
an
gs
->
trans
(
"Bank"
)
.
" - "
.
$val
[
'soclib'
]
.
"</td>"
;
print
"<td>"
.
$
b
an
k_code_journal
->
label
.
" - "
.
$val
[
'soclib'
]
.
"</td>"
;
}
print
"<td>"
.
$val
[
"type_payment"
]
.
"</td>"
;
print
"<td align='right'>"
.
(
$mt
>=
0
?
price
(
$mt
)
:
''
)
.
"</td>"
;
...
...
@@ -619,19 +623,9 @@ else {
if
(
$k
!=
'type'
)
{
print
"<tr "
.
$bc
[
$var
]
.
">"
;
print
"<td>"
.
$date
.
"</td>"
;
print
"<td>"
.
$val
[
"soclib"
]
.
"</td>"
;
// print "<td>" . length_accounta($k) . "</td>";
if
(
length_accounta
(
$k
)
==
''
)
{
print
"<td>"
.
length_accounta
(
$conf
->
global
->
ACCOUNTING_ACCOUNT_TRANSFER_CASH
)
.
"</td>"
;
}
else
{
print
"<td>"
.
$ref
.
"</td>"
;
print
"<td>"
.
length_accounta
(
$k
)
.
"</td>"
;
}
// print "<td>" . $langs->trans('ThirdParty') . " (" . $val['soclib'] . ")</td>";
if
(
$val
[
'soclib'
]
==
''
)
{
print
"<td>"
.
$langs
->
trans
(
'ThirdParty'
)
.
" - "
.
$val
[
"ref"
]
.
"</td>"
;
}
else
{
print
"<td>"
.
$langs
->
trans
(
"ThirdParty"
)
.
' - '
.
$val
[
'soclib'
]
.
"</td>"
;
}
print
"<td>"
.
$reflabel
.
' '
.
$val
[
'soclib'
]
.
"</td>"
;
print
"<td>"
.
$val
[
"type_payment"
]
.
"</td>"
;
print
"<td align='right'>"
.
(
$mt
<
0
?
price
(
-
$mt
)
:
''
)
.
"</td>"
;
print
"<td align='right'>"
.
(
$mt
>=
0
?
price
(
$mt
)
:
''
)
.
"</td>"
;
...
...
@@ -642,14 +636,9 @@ else {
foreach
(
$tabbq
[
$key
]
as
$k
=>
$mt
)
{
print
"<tr "
.
$bc
[
$var
]
.
">"
;
print
"<td>"
.
$date
.
"</td>"
;
print
"<td>"
.
$ref
label
.
"</td>"
;
print
"<td>"
.
$ref
.
"</td>"
;
print
"<td>"
.
length_accountg
(
$conf
->
global
->
ACCOUNTING_ACCOUNT_SUSPENSE
)
.
"</td>"
;
// print "<td>" . $langs->trans('ThirdParty') . "</td>";
if
(
$val
[
'soclib'
]
==
''
)
{
print
"<td>"
.
$langs
->
trans
(
'ThirdParty'
)
.
" - "
.
$val
[
"ref"
]
.
"</td>"
;
}
else
{
print
"<td>"
.
$langs
->
trans
(
"ThirdParty"
)
.
' - '
.
$val
[
'soclib'
]
.
"</td>"
;
}
print
"<td>"
.
$reflabel
.
"</td>"
;
print
"<td> </td>"
;
print
"<td align='right'>"
.
(
$mt
<
0
?
price
(
-
$mt
)
:
''
)
.
"</td>"
;
print
"<td align='right'>"
.
(
$mt
>=
0
?
price
(
$mt
)
:
''
)
.
"</td>"
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment