All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ning.billing.invoice.dao.InvoiceSqlDao.sql.stg Maven / Gradle / Ivy

There is a newer version: 0.8.14
Show newest version
group InvoiceDao: EntitySqlDao;

tableName() ::= "invoices"

tableFields(prefix) ::= <<
  account_id
, invoice_date
, target_date
, currency
, migrated
, created_by
, created_date
>>

tableValues() ::= <<
  :accountId
, :invoiceDate
, :targetDate
, :currency
, :migrated
, :createdBy
, :createdDate
>>

extraTableFieldsWithComma(prefix) ::= <<
, record_id as invoice_number
>>

getInvoicesByAccount() ::= <<
  SELECT 
  FROM 
  WHERE account_id = :accountId AND migrated = '0'
  
  ORDER BY target_date ASC;
>>

getAllInvoicesByAccount() ::= <<
  SELECT 
  FROM 
  WHERE account_id = :accountId
  
  ORDER BY target_date ASC;
>>

getInvoicesByAccountAfterDate() ::= <<
  SELECT 
  FROM 
  WHERE account_id = :accountId AND target_date >= :fromDate AND migrated = '0'
  
  ORDER BY target_date ASC;
>>

getInvoicesBySubscription() ::= <<
  SELECT 
  FROM  i
  JOIN invoice_items ii ON i.id = ii.invoice_id
  WHERE ii.subscription_id = :subscriptionId AND i.migrated = '0'
  
  
  ;
>>

getInvoiceIdByPaymentId() ::= <<
  SELECT i.id
    FROM  i, invoice_payments ip
   WHERE ip.invoice_id = i.id
     AND ip.payment_id = :paymentId
   
   
>>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy