Commit e130cc8b authored by Jérome Perrin's avatar Jérome Perrin

when searching by date, use start_date for source section, and stop_date for...

when searching by date, use start_date for source section, and stop_date for destination section. Also use DateTime.latestTime instead of DateTime + 1

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23785 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5b604909
...@@ -17,12 +17,6 @@ ...@@ -17,12 +17,6 @@
</list> </list>
</value> </value>
</item> </item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_arg</string> </key> <key> <string>_arg</string> </key>
<value> <value>
...@@ -360,12 +354,6 @@ ...@@ -360,12 +354,6 @@
</object> </object>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>allow_simple_one_argument_traversal</string> </key> <key> <string>allow_simple_one_argument_traversal</string> </key>
<value> <value>
...@@ -767,16 +755,11 @@ destination_section_where_expression</string> </value> ...@@ -767,16 +755,11 @@ destination_section_where_expression</string> </value>
AND <dtml-sqltest delivery_mirror_section_title type=string op=like column=mirror_section_catalog.title>\n AND <dtml-sqltest delivery_mirror_section_title type=string op=like column=mirror_section_catalog.title>\n
</dtml-if>\n </dtml-if>\n
\n \n
<dtml-comment>\n
-- FIXME: we want stop date when we are destination_section and start_date when\n
-- we are source_section (one solution is to read in stock.date, but we try\n
-- to avoid the use of stock table here)\n
</dtml-comment>\n
<dtml-if from_date>\n <dtml-if from_date>\n
AND movement.start_date >= <dtml-sqlvar from_date type="datetime">\n AND movement.start_date >= <dtml-sqlvar from_date type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if to_date>\n <dtml-if to_date>\n
AND movement.start_date <= <dtml-sqlvar expr="to_date+1" type="datetime">\n AND movement.start_date <= <dtml-sqlvar expr="to_date.latestTime()" type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if at_date>\n <dtml-if at_date>\n
AND movement.start_date < <dtml-sqlvar at_date type="datetime">\n AND movement.start_date < <dtml-sqlvar at_date type="datetime">\n
...@@ -956,19 +939,14 @@ UNION\n ...@@ -956,19 +939,14 @@ UNION\n
AND <dtml-sqltest delivery_mirror_section_title type=string op=like column=mirror_section_catalog.title>\n AND <dtml-sqltest delivery_mirror_section_title type=string op=like column=mirror_section_catalog.title>\n
</dtml-if>\n </dtml-if>\n
\n \n
<dtml-comment>\n
-- FIXME: we want stop date when we are destination_section and start_date when\n
-- we are source_section (one solution is to read in stock.date, but we try\n
-- to avoid the use of stock table here)\n
</dtml-comment>\n
<dtml-if from_date>\n <dtml-if from_date>\n
AND movement.start_date >= <dtml-sqlvar from_date type="datetime">\n AND movement.stop_date >= <dtml-sqlvar from_date type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if to_date>\n <dtml-if to_date>\n
AND movement.start_date <= <dtml-sqlvar expr="to_date+1" type="datetime">\n AND movement.stop_date <= <dtml-sqlvar expr="to_date.latestTime()" type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if at_date>\n <dtml-if at_date>\n
AND movement.start_date < <dtml-sqlvar at_date type="datetime">\n AND movement.stop_date < <dtml-sqlvar at_date type="datetime">\n
</dtml-if>\n </dtml-if>\n
\n \n
<dtml-if node>\n <dtml-if node>\n
...@@ -1426,16 +1404,11 @@ UNION\n ...@@ -1426,16 +1404,11 @@ UNION\n
AND <dtml-sqltest delivery_mirror_section_title type=string op=like column=mirror_section_catalog.title>\n AND <dtml-sqltest delivery_mirror_section_title type=string op=like column=mirror_section_catalog.title>\n
</dtml-if>\n </dtml-if>\n
\n \n
<dtml-comment>\n
-- FIXME: we want stop date when we are destination_section and start_date when\n
-- we are source_section (one solution is to read in stock.date, but we try\n
-- to avoid the use of stock table here)\n
</dtml-comment>\n
<dtml-if from_date>\n <dtml-if from_date>\n
AND movement.start_date >= <dtml-sqlvar from_date type="datetime">\n AND movement.start_date >= <dtml-sqlvar from_date type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if to_date>\n <dtml-if to_date>\n
AND movement.start_date <= <dtml-sqlvar expr="to_date+1" type="datetime">\n AND movement.start_date <= <dtml-sqlvar expr="to_date.latestTime()" type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if at_date>\n <dtml-if at_date>\n
AND movement.start_date < <dtml-sqlvar at_date type="datetime">\n AND movement.start_date < <dtml-sqlvar at_date type="datetime">\n
...@@ -1615,19 +1588,14 @@ UNION\n ...@@ -1615,19 +1588,14 @@ UNION\n
AND <dtml-sqltest delivery_mirror_section_title type=string op=like column=mirror_section_catalog.title>\n AND <dtml-sqltest delivery_mirror_section_title type=string op=like column=mirror_section_catalog.title>\n
</dtml-if>\n </dtml-if>\n
\n \n
<dtml-comment>\n
-- FIXME: we want stop date when we are destination_section and start_date when\n
-- we are source_section (one solution is to read in stock.date, but we try\n
-- to avoid the use of stock table here)\n
</dtml-comment>\n
<dtml-if from_date>\n <dtml-if from_date>\n
AND movement.start_date >= <dtml-sqlvar from_date type="datetime">\n AND movement.stop_date >= <dtml-sqlvar from_date type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if to_date>\n <dtml-if to_date>\n
AND movement.start_date <= <dtml-sqlvar expr="to_date+1" type="datetime">\n AND movement.stop_date <= <dtml-sqlvar expr="to_date.latestTime()" type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if at_date>\n <dtml-if at_date>\n
AND movement.start_date < <dtml-sqlvar at_date type="datetime">\n AND movement.stop_date < <dtml-sqlvar at_date type="datetime">\n
</dtml-if>\n </dtml-if>\n
\n \n
<dtml-if node>\n <dtml-if node>\n
......
779 780
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment