This page contains developer documentation for the Priceinfo class importable from priceinfoclass - currently, more a notepad for me than real documentation.
Contents
Public methods
Priceinfo.__init__()
(Priceinfo) = Priceinfo( invID = 0 )
Data presentation
Priceinfo.__str__()
(string) = __str__()
Priceinfo.html_table()
(string) = html_table( id = 0, [colorid = None], [color = 'green'] )
id may be a numeric priceinfo ID or 'all'.
Priceinfo.cteur()
(string) = cteur( ct = 0 )
Database interaction
Priceinfo.store()
store()
Data queries
Priceinfo.cheapest()
({'ID', 'supplierID', 'supplierID_txt', 'unitsize', 'datechanged', 'quant', 'ppu', 'ordercode', 'cntprice', 'oneprice'}) = \
cheapest(
[count = 1]
)
count is the amount of single items for which the price is requested. This may be adjusted to a higher number of single items if there is a minimum number to be ordered from a supplier, and this is the cheapest option known. The adjusted count of units (which each include unitsize single items) to be ordered is returned in quant. To receive count single items, quant units must be ordered from supplier, and each will cost ppu cent.
cntprice is the price for the number of units that must be ordered to get count items, i.e. the price for quant units.
oneprice is the price for one single item when ordering quant units.
To make more sense of the above, remember that a unit may contain more than one item, and to get count items, we may have to order "one and a half" unit, which is not possible - price calculation still confuses me.
ID is the priceinfo.ID that has been used.
Priceinfo.getprice()
({'ID', 'supplierID', 'supplierID_txt', 'unitsize', 'datechanged', 'quant', 'ppu', 'ordercode'}) = \
getprice(
supplierID = 0,
[count = 1]
)
count is the amount of single items for which the price is requested. This may be adjusted to a higher number of single items if there is a minimum number to be ordered from a supplier, and this is the cheapest option known. The adjusted count of units (which each include unitsize single items) to be ordered is returned in quant. To receive count single items, quant units must be ordered from supplier, and each will cost ppu cent.
ID is the priceinfo.ID that has been used.
Priceinfo.value()
(int) = value( [count = 1] )
Data manipulation
Priceinfo.delete()
delete( id = 0 )
Priceinfo.append()
append( supplierID = '', ordercode = '', unitsize = 1, [quantA = 0], [ppuA = 0], [quantB = 0], [ppuB = 0], [quantC = 0], [ppuC = 0], [datechanged = 0] )
Priceinfo.update()
update( entryid = 0, supplierID = '', ordercode = '', unitsize = 1, [quantA = 0], [ppuA = 0], [quantB = 0], [ppuB = 0], [quantC = 0], [ppuC = 0], [datechanged = 0] )
Exceptions
InvalidData
'DATAMISSING': 'Data missing for operation', \
'DUPLICATE': 'Attempting to insert duplicate entry.', \
'IDMISSING': 'Part ID missing.', \
'INVALID': 'Invalid data.', \
'NOINFO': 'No order information for this part.', \
'NOTFOUND': 'ID not found in list.', \
'UNDEF': 'Undefined InvalidData error.' \
THIS DATA IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DATA, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
All product and brand names mentioned on there pages and in the source code are registered names and/or trademarks of the respective owner and are mentioned for identification purposes only.
For a full copyright notice, please see this link. For imprint and contact information, please see http://www.thiemo.net/.