Results 1 to 3 of 3

Thread: mysql to pdf???

  1. #1
    Meyer is offline Sugar Community Member
    Join Date
    Oct 2006
    Location
    south africa
    Posts
    646

    Default mysql to pdf???

    Hi there

    I am trying to create invoice.
    Below is the query where i inly want invoice to show where curmonth -3
    The query works 100% in mysql, but when i put the code below in i receive all invoices. When i change the operator to '>' i get nothing returned. Please help.

    $where = array(
    'lhs_field' => '!invoice.date_entered',

    'rhs_value' => 'YEAR(date_entered) = YEAR(CURDATE())
    AND MONTH(date_entered) = MONTH(CURDATE())-3',

    'operator' => '=',
    );

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: mysql to pdf???

    Inside which file you are trying to implement such code?

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    Meyer is offline Sugar Community Member
    Join Date
    Oct 2006
    Location
    south africa
    Posts
    646

    Default Re: mysql to pdf???

    hi Andopes

    PDFStatement.php in accounts module.

    -------------

    $last_currency = 0;

    $single_currency = true;

    $balance = $balance_usdollar = 0;

    $this->focus->load_relationship('invoice');

    // Return invoices
    $where = array(
    'lhs_field' => '!invoice.cancelled AND invoice.amount_due ',
    'rhs_value' => '0',
    'operator' => '!=',
    );


    $where = array(
    'lhs_field' => '!invoice.date_entered',
    'rhs_value' => '!CURDATE()-60',
    'operator' => '=',
    );


    $invoices = $this->focus->invoice->getBeans(new Invoice, array(), 0, -1, 0, $where
    );

    $this->moveY('20pt');
    // Currency Start
    $currency =& new Currency;
    $currency->retrieve(-99);
    $symbol = $default_symbol = $currency->getPdfCurrencySymbol();
    $currency_id = $default_currency_id = $currency->id;
    $orig_lm = $this->lMargin;

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Connectiing MySQL GUITools (win) to view SugarCRM schema on MYSQL-UBUNTU
    By paulval in forum Installation and Upgrade Help
    Replies: 1
    Last Post: 2008-03-06, 08:10 PM
  2. Replies: 0
    Last Post: 2008-02-06, 11:09 PM
  3. Replies: 2
    Last Post: 2007-07-30, 02:58 AM
  4. Replies: 2
    Last Post: 2007-07-01, 09:55 PM
  5. Replies: 0
    Last Post: 2005-10-22, 09:23 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •