<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid
getResourceUid
getInventoriatedQuantity
getSourceUid
getDestinationUid
getSourceSectionUid
getDestinationSectionUid
isMovement
getSourcePaymentUid
getDestinationPaymentUid
getSimulationState
getPrice
getStartDate
getStopDate
isAccountable
getPortalType
getVariationText</params>
<dtml-if isMovement>
<dtml-if getResourceUid>
<dtml-if getDestinationUid>
INSERT INTO
  stock
VALUES
(
  <dtml-sqlvar uid type="int">,
  <dtml-sqlvar getDestinationUid type="int">,
  <dtml-if getDestinationSectionUid><dtml-sqlvar getDestinationSectionUid type="int"><dtml-else>NULL</dtml-if>,
  <dtml-if getDestinationPaymentUid><dtml-sqlvar getDestinationPaymentUid type="int"><dtml-else>NULL</dtml-if>,
  <dtml-if getSourceSectionUid><dtml-sqlvar getSourceSectionUid type="int"><dtml-else>NULL</dtml-if>, 
  <dtml-sqlvar getResourceUid type="int">,
  <dtml-if getInventoriatedQuantity><dtml-sqlvar "getInventoriatedQuantity" type="float"><dtml-else>NULL</dtml-if>,
  <dtml-if getStopDate><dtml-sqlvar getStopDate type="datetime"><dtml-else>NULL</dtml-if>,
  <dtml-if getPrice><dtml-sqlvar getPrice type="float"><dtml-else>NULL</dtml-if>,
  <dtml-if isAccountable><dtml-sqlvar isAccountable type="int"><dtml-else>NULL</dtml-if>,
  <dtml-if getPortalType><dtml-sqlvar getPortalType type="string"><dtml-else>NULL</dtml-if>,
  <dtml-if getSimulationState><dtml-sqlvar getSimulationState type="string"><dtml-else>NULL</dtml-if>,
  <dtml-if "getVariationText is not None"><dtml-sqlvar getVariationText type="string"><dtml-else>NULL</dtml-if>
)
<dtml-if getSourceUid>
,
(
  <dtml-sqlvar uid type="int">,
  <dtml-sqlvar getSourceUid type="int">,  
  <dtml-if getSourceSectionUid><dtml-sqlvar getSourceSectionUid type="int"><dtml-else>NULL</dtml-if>, 
  <dtml-if getSourcePaymentUid><dtml-sqlvar getSourcePaymentUid type="int"><dtml-else>NULL</dtml-if>, 
  <dtml-if getDestinationSectionUid><dtml-sqlvar getDestinationSectionUid type="int"><dtml-else>NULL</dtml-if>,
  <dtml-sqlvar getResourceUid type="int">, 
  <dtml-if getInventoriatedQuantity><dtml-sqlvar "-getInventoriatedQuantity" type="float"><dtml-else>NULL</dtml-if>, 
  <dtml-if getStartDate><dtml-sqlvar getStartDate type="datetime"><dtml-else>NULL</dtml-if>,
  <dtml-if getPrice><dtml-sqlvar getPrice type="float"><dtml-else>NULL</dtml-if>,
  <dtml-if isAccountable><dtml-sqlvar isAccountable type="int"><dtml-else>NULL</dtml-if>,
  <dtml-if getPortalType><dtml-sqlvar getPortalType type="string"><dtml-else>NULL</dtml-if>,
  <dtml-if getSimulationState><dtml-sqlvar getSimulationState type="string"><dtml-else>NULL</dtml-if>,
  <dtml-if "getVariationText is not None"><dtml-sqlvar getVariationText type="string"><dtml-else>NULL</dtml-if>
)
</dtml-if>
<dtml-else>
<dtml-if getSourceUid>
INSERT INTO
  stock
VALUES
(
  <dtml-sqlvar uid type="int">,
  <dtml-sqlvar getSourceUid type="int">,  
  <dtml-if getSourceSectionUid><dtml-sqlvar getSourceSectionUid type="int"><dtml-else>NULL</dtml-if>, 
  <dtml-if getSourcePaymentUid><dtml-sqlvar getSourcePaymentUid type="int"><dtml-else>NULL</dtml-if>, 
  <dtml-if getDestinationSectionUid><dtml-sqlvar getDestinationSectionUid type="int"><dtml-else>NULL</dtml-if>,
  <dtml-sqlvar getResourceUid type="int">, 
  <dtml-if getInventoriatedQuantity><dtml-sqlvar "-getInventoriatedQuantity" type="float"><dtml-else>NULL</dtml-if>, 
  <dtml-if getStartDate><dtml-sqlvar getStartDate type="datetime"><dtml-else>NULL</dtml-if>,
  <dtml-if getPrice><dtml-sqlvar getPrice type="float"><dtml-else>NULL</dtml-if>,
  <dtml-if isAccountable><dtml-sqlvar isAccountable type="int"><dtml-else>NULL</dtml-if>,
  <dtml-if getPortalType><dtml-sqlvar getPortalType type="string"><dtml-else>NULL</dtml-if>,
  <dtml-if getSimulationState><dtml-sqlvar getSimulationState type="string"><dtml-else>NULL</dtml-if>,
  <dtml-if "getVariationText is not None"><dtml-sqlvar getVariationText type="string"><dtml-else>NULL</dtml-if>
)
</dtml-if>
</dtml-if>
</dtml-if>
</dtml-if>
