1 # Copyright (C) 2010-2011 Richard Lincoln
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to
5 # deal in the Software without restriction, including without limitation the
6 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 # sell copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 from CIM15
.IEC61970
.Core
.IdentifiedObject
import IdentifiedObject
23 class ErpQuoteLineItem(IdentifiedObject
):
24 """Of an ErpQuote, the item or product quoted along with quantity, price and other descriptive information.Of an ErpQuote, the item or product quoted along with quantity, price and other descriptive information.
27 def __init__(self
, ErpQuote
=None, AssetModelCatalogueItem
=None, status
=None, Design
=None, ErpInvoiceLineItem
=None, ErpReqLineItem
=None, Request
=None, *args
, **kw_args
):
28 """Initialises a new 'ErpQuoteLineItem' instance.
31 @param AssetModelCatalogueItem:
34 @param ErpInvoiceLineItem: Some utilities provide quotes to customer for services, where the customer accepts the quote by making a payment. An invoice is required for this to occur.
35 @param ErpReqLineItem:
39 self
.ErpQuote
= ErpQuote
41 self
._AssetModelCatalogueItem
= None
42 self
.AssetModelCatalogueItem
= AssetModelCatalogueItem
49 self
._ErpInvoiceLineItem
= None
50 self
.ErpInvoiceLineItem
= ErpInvoiceLineItem
52 self
._ErpReqLineItem
= None
53 self
.ErpReqLineItem
= ErpReqLineItem
56 self
.Request
= Request
58 super(ErpQuoteLineItem
, self
).__init
__(*args
, **kw_args
)
64 _refs
= ["ErpQuote", "AssetModelCatalogueItem", "status", "Design", "ErpInvoiceLineItem", "ErpReqLineItem", "Request"]
67 def getErpQuote(self
):
71 def setErpQuote(self
, value
):
72 if self
._ErpQuote
is not None:
73 filtered
= [x
for x
in self
.ErpQuote
.ErpQuoteLineItems
if x
!= self
]
74 self
._ErpQuote
._ErpQuoteLineItems
= filtered
76 self
._ErpQuote
= value
77 if self
._ErpQuote
is not None:
78 if self
not in self
._ErpQuote
._ErpQuoteLineItems
:
79 self
._ErpQuote
._ErpQuoteLineItems
.append(self
)
81 ErpQuote
= property(getErpQuote
, setErpQuote
)
83 def getAssetModelCatalogueItem(self
):
85 return self
._AssetModelCatalogueItem
87 def setAssetModelCatalogueItem(self
, value
):
88 if self
._AssetModelCatalogueItem
is not None:
89 filtered
= [x
for x
in self
.AssetModelCatalogueItem
.ErpQuoteLineItems
if x
!= self
]
90 self
._AssetModelCatalogueItem
._ErpQuoteLineItems
= filtered
92 self
._AssetModelCatalogueItem
= value
93 if self
._AssetModelCatalogueItem
is not None:
94 if self
not in self
._AssetModelCatalogueItem
._ErpQuoteLineItems
:
95 self
._AssetModelCatalogueItem
._ErpQuoteLineItems
.append(self
)
97 AssetModelCatalogueItem
= property(getAssetModelCatalogueItem
, setAssetModelCatalogueItem
)
105 def setDesign(self
, value
):
106 if self
._Design
is not None:
107 self
._Design
._ErpQuoteLineItem
= None
110 if self
._Design
is not None:
111 self
._Design
.ErpQuoteLineItem
= None
112 self
._Design
._ErpQuoteLineItem
= self
114 Design
= property(getDesign
, setDesign
)
116 def getErpInvoiceLineItem(self
):
117 """Some utilities provide quotes to customer for services, where the customer accepts the quote by making a payment. An invoice is required for this to occur.
119 return self
._ErpInvoiceLineItem
121 def setErpInvoiceLineItem(self
, value
):
122 if self
._ErpInvoiceLineItem
is not None:
123 self
._ErpInvoiceLineItem
._ErpQuoteLineItem
= None
125 self
._ErpInvoiceLineItem
= value
126 if self
._ErpInvoiceLineItem
is not None:
127 self
._ErpInvoiceLineItem
.ErpQuoteLineItem
= None
128 self
._ErpInvoiceLineItem
._ErpQuoteLineItem
= self
130 ErpInvoiceLineItem
= property(getErpInvoiceLineItem
, setErpInvoiceLineItem
)
132 def getErpReqLineItem(self
):
134 return self
._ErpReqLineItem
136 def setErpReqLineItem(self
, value
):
137 if self
._ErpReqLineItem
is not None:
138 self
._ErpReqLineItem
._ErpQuoteLineItem
= None
140 self
._ErpReqLineItem
= value
141 if self
._ErpReqLineItem
is not None:
142 self
._ErpReqLineItem
.ErpQuoteLineItem
= None
143 self
._ErpReqLineItem
._ErpQuoteLineItem
= self
145 ErpReqLineItem
= property(getErpReqLineItem
, setErpReqLineItem
)
147 def getRequest(self
):
151 def setRequest(self
, value
):
152 if self
._Request
is not None:
153 self
._Request
._ErpQuoteLineItem
= None
155 self
._Request
= value
156 if self
._Request
is not None:
157 self
._Request
.ErpQuoteLineItem
= None
158 self
._Request
._ErpQuoteLineItem
= self
160 Request
= property(getRequest
, setRequest
)