<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Dear Henk,<br>
    </p>
    Could you please describe what do you mean by "manually" generated
    invoices? <br>
    Did you use WEB interface for this? <br>
    <br>
    Thanks in advance.<br>
    <br>
    Best regards,<br>
    Irina Peshinskaya<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 15.01.2017 19:56, Henk wrote:<br>
    </div>
    <blockquote
      cite="mid:08108fa6-4ade-8db9-5e27-760fe4f6d6c0@voipdigit.nl"
      type="cite">
      <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
      <p>Sorry, that format wasn't working. I hope this will be more
        readable<br>
      </p>
      I'm on mr5.0.1.1 and have the wrong billing profile on my
      (manually) generated invoices from january.<br>
      After some research I found the date selection on billing_mappings
      isn't working. The start_date is 10-1-2017. Only the records with
      start_date NULL are selected.<br>
      <br>
      From the sql query log:<br>
      <br>
      select * FROM billing_mappings <br>
              where contract_id = '17' <br>
                  and (billing_mappings.start_date <= '1485903599' OR
      billing_mappings.start_date is null)<br>
                  and (billing_mappings.end_date >= '1483225200' OR
      billing_mappings.end_date is null)<br>
              order by billing_mappings.start_date desc,
      billing_mappings.id desc limit 1<br>
      <br>
      If I add from_unixtime it's working and I get the right one:<br>
      <br>
      select * FROM billing_mappings <br>
              where contract_id = '17' <br>
                  and (billing_mappings.start_date <= <code
        class="sql">from_unixtime(</code>'1485903599') OR
      billing_mappings.start_date is null)<br>
                  and (billing_mappings.end_date >= <code
        class="sql">from_unixtime(</code>'1483225200') OR
      billing_mappings.end_date is null)<br>
              order by billing_mappings.start_date desc,
      billing_mappings.id desc limit 1<br>
      <br>
      Maybe this is related to MariaDB?<br>
      <br>
      Regards,<br>
      <br>
      Henk Plessius<br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Spce-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Spce-user@lists.sipwise.com">Spce-user@lists.sipwise.com</a>
<a class="moz-txt-link-freetext" href="https://lists.sipwise.com/listinfo/spce-user">https://lists.sipwise.com/listinfo/spce-user</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>