Add php files
This commit is contained in:
27
modules/EcmPaymentStates/raport2.php
Executable file
27
modules/EcmPaymentStates/raport2.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
$db = $GLOBALS['db'];
|
||||
|
||||
$inv = $db->query("
|
||||
SELECT t.paid, i.document_no, i.id
|
||||
FROM ecmtransactions as t
|
||||
INNER JOIN ecminvoiceouts as i
|
||||
ON t.record_id = i.id
|
||||
WHERE
|
||||
t.deleted='0' AND
|
||||
t.register_date > '2011-12-31'
|
||||
ORDER BY t.register_date DESC");
|
||||
|
||||
while ($i = $db->fetchByAssoc($inv)) {
|
||||
if ($i['paid']=='1') {
|
||||
$q = "SELECT pi.paid, pi.deleted, t.id
|
||||
FROM ecmpayments2_ecminvoiceouts as pi
|
||||
INNER JOIN ecmtransactions as t
|
||||
ON t.id = pi.ecmpayment_id
|
||||
WHERE
|
||||
ecminvoiceout_id='".$i['id']."'";
|
||||
$payment = $db->query($q);
|
||||
if ($payment->num_rows != 0)
|
||||
echo $q.'<br><br>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user