
    F4j&                     |   d dl mZ d dlmZmZmZmZmZmZm	Z	m
Z
mZmZmZmZmZmZmZ d dlmZ d dlmZ  G d de      Z G d de      Z G d	 d
e      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z  G d de      Z! G d d e      Z" G d! d"e      Z# G d# d$e      Z$ G d% d&e      Z% G d' d(e      Z& G d) d*e      Z' G d+ d,e      Z( G d- d.e      Z) G d/ d0e      Z* G d1 d2e      Z+ G d3 d4e      Z,y5)6    )Base)ColumnInteger
BigIntegerStringDateTimeDateTime
ForeignKeyFloatBooleanTextNumericEnumUniqueConstraintselect)column_property)datetimec                   t    e Zd ZdZ eed      Z e ed            Z e e	             Z
 e e	             Zy)AccountTypeModelaccount_typesTprimary_key   N)__name__
__module____qualname____tablename__r   r   idr   account_typer   
added_dateupdated_date     I/var/www/pie360backend.cl/public_html/app/backend/db/models/erp_legacy.pyr   r      9    #M	T	*B&+&L
#J(*%Lr$   r   c                       e Zd ZdZ eed      Z e ed            Z e ed            Z	 e ed            Z
 e e             Zy)SettingModelsettingsTr   r   N)r   r   r   r   r   r   r   r   company_emailcompany_phonecompany_whatsappr   r"   r#   r$   r%   r(   r(      sJ    M	T	*B6#;'M6#;'MfSk*(*%Lr$   r(   c                      e Zd ZdZ eed      Z e ed            Z ee      Z	 ee      Z
 e ed            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e edd            Z e e             Z e edd            Z ee      Z e edd            Z ee      Z  e edd            Z! e e             Z" e e#             Z$ e e#             Z% ee      Z&y)	ShoppingModel	shoppingsTr   d   r   
      N)'r   r   r   r   r   r   r   r   shopping_numbersupplier_id	status_idemailr   totalmaritime_freightmerchandise_insurancemanifest_openingdeconsolidationland_freightport_charges
honorariesphysical_assessment_expensesadministrative_expensesdollar_valuefolder_processingvalija_expensesr   customs_company_supportwire_transfer_amountr	   wire_transfer_date
commissionexchange_rateextra_expensespayment_supportr   r!   r"   prepaid_status_idr#   r$   r%   r.   r.      s   M	T	*BVC[)O/KwI6#;E72q>"Egb!n-"72q>2gb!n-WR^,O'"a.)L'"a.)LA'J#)'"a.#9 $WR^4'"a.)Lwr1~.WR^,O$TVn!'"a.1A'J7OMGBN+NTVnO
#J(*%L wr$   r.   c                       e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 ee      Z
 e edd            Z e edd            Z ee      Z e edd            Z e edd            Z e e             Z e e             Zy)ShoppingProductModelshoppings_productsTr   r1   r2   N)r   r   r   r   r   r   r   shopping_id
product_idunit_measure_idquantityr   quantity_per_packageoriginal_unit_costdiscount_percentagefinal_unit_costamountr   r!   r"   r#   r$   r%   rM   rM   9   s    (M	T	*B/KJWoOgH!'"a.1A/ /WR^,OGBN#F
#J(*%Lr$   rM   c                       e Zd ZdZ eed      Z e ed            Z e ed            Z	 e e
             Z e e             Z e e             Zy)SupplierModel	suppliersTr   r   N)r   r   r   r   r   r   r   r   identification_numbersupplierr   addressr   r!   r"   r#   r$   r%   rY   rY   I   sS    M	T	*B"6#;/fSk"HTVnG
#J(*%Lr$   rY   c                   t    e Zd ZdZ eed      Z e ed            Z e e	             Z
 e e	             Zy)UnitMeasureModelunit_measuresTr   r   N)r   r   r   r   r   r   r   r   unit_measurer   r!   r"   r#   r$   r%   r_   r_   S   r&   r$   r_   c                   T   e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 ee      Z
 eed      Z ee      Z ee      Z eed      Z ee      Z e e             Z e e             Z e e       ej,                        Z e e       ej,                        Zy)	SaleModelsalesTr   r   defaultN)r   r   r   r   r   r   r   customer_idshipping_method_iddte_type_idr5   folior   subtotaltaxshipping_costr7   r   rJ   delivery_addressr   r   nowr!   r"   r#   r$   r%   rc   rc   [   s    M	T	*B/K/KwI7A&Ee}H
-C5!,M5METVnOdf~
HLL9J(*hll;Lr$   rc   c                       e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 ee      Z
 ee      Z ee      Z ee      Zy)SaleProductModelsales_productsTr   N)r   r   r   r   r   r   r   sale_idrP   inventory_movement_idinventory_idlot_item_idrR   pricer#   r$   r%   rq   rq   m   sS    $M	T	*BWoGJ"7O'?L/KgH7OEr$   rq   c                   t    e Zd ZdZ eed      Z e ed            Z e e	             Z
 e e	             Zy)LocationModel	locationsTr   r   N)r   r   r   r   r   r   r   r   locationr   r!   r"   r#   r$   r%   ry   ry   y   s9    M	T	*BfSk"H
#J(*%Lr$   ry   c                       e Zd ZdZ eed      Z e ed            Z e ed            Z	 e ed            Z
 e e             Z e e             Zy)CategoryModel
categoriesTr   r   N)r   r   r   r   r   r   r   r   categorypublic_namecolorr   r!   r"   r#   r$   r%   r}   r}      sU     M	T	*BfSk"H%K6#;E
#J(*%Lr$   r}   c                       e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 e e
d            Z e e
d            Z e e             Z e e             Zy)LiterFeatureModelliter_featuresTr   r   N)r   r   r   r   r   r   r   rP   rS   quantity_per_palletr   weight_per_literweight_per_palletr   r!   r"   r#   r$   r%   r   r      sf    $M	T	*BJ!'? /fSk*vc{+
#J(*%Lr$   r   c                       e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 ee      Z
 e e             Z e e             Zy)PreInventoryStockModelpre_inventory_stocksTr   N)r   r   r   r   r   r   r   rP   rO   
lot_numberstockr   r!   r"   r#   r$   r%   r   r      sO    *M	T	*BJ/KJ7OE
#J(*%Lr$   r   c                       e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 e e
d            Z e e
d            Z e e             Z e e             Zy)UnitFeatureModelunit_featuresTr   r   N)r   r   r   r   r   r   r   rP   rS   r   r   weight_per_unitr   r   r!   r"   r#   r$   r%   r   r      se    #M	T	*BJ!'? /VC[)Ovc{+
#J(*%Lr$   r   c                      e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	 e e
d            Z e e
d            Z e e             Z e e             Z e e             Z e e             Z e e             Z e e             Z e e             Z ee      Z ee      Z e e             Z e e             Zy)ProductModelproductsTr   r   N)r   r   r   r   r   r   r   r4   category_idrQ   r   codeproductr   rT   rU   rV   short_descriptiondescriptionphotocatalogis_compoundcompound_product_idr   r!   r"   r#   r$   r%   r   r      s    M	T	*B/K/KWoO&+DVC[!G .TVnOtv.K46NETVnG/K /
#J(*%Lr$   r   c                   T    e Zd ZdZ eed      Z ee      Z ee      Z ee      Z	y)CustomerProductDiscountModelcustomers_products_discountsTr   N)
r   r   r   r   r   r   r   rg   rP   rU   r#   r$   r%   r   r      s/    2M	T	*B/KJ /r$   r   c                       e Zd ZdZ eedd      Z ee      Z ee      Z ee      Z	 ee      Z
 e e             Z e e             Zy)InventoryModelinventoriesTr   autoincrementN)r   r   r   r   r   r   r   rP   location_idminimum_stockmaximum_stockr   last_updater!   r#   r$   r%   r   r      sQ    !M	T	>BJ/K7OM7OM$K
#Jr$   r   c                       e Zd ZdZ eedd      Z ee      Z e ed            Z	 e e
             Z e e             Z e e             Zy)LotModellotsTr   r   N)r   r   r   r   r   r   r   r4   r   r   r	   arrival_dater   r!   r"   r#   r$   r%   r   r      sO    M	T	>B/Ks$J$&>L
#J(*%Lr$   r   c                       e Zd ZdZ eedd      Z ee      Z ee      Z ee      Z	 ee      Z
 ee      Z ee      Z e e             Z e e             Zy)LotItemModel	lot_itemsTr   N)r   r   r   r   r   r   r   lot_idrP   rR   	unit_costpublic_sale_priceprivate_sale_pricer   r!   r"   r#   r$   r%   r   r      se    M	T	>BG_FJgHwIw
#J(*%Lr$   r   c                       e Zd ZdZ eedd      Z ee ed            Z ee ed            Z	 ee      Z
 e e             Z e e             Zy)InventoryLotItemModelinventories_lotsTr   inventories.idzlots.idN)r   r   r   r   r   r   r   r   ru   rv   rR   r   r!   r"   r#   r$   r%   r   r      sY    &M	T	>B':.>#?@L*Y"78KgH
#J(*%Lr$   r   c                   v    e Zd ZdZ eedd      Z e ed            Z e e	             Z
 e e	             Zy)MovementTypeModelmovement_typesTr   r   N)r   r   r   r   r   r   r   r   movement_typer   r!   r"   r#   r$   r%   r   r      s;    $M	T	>B6#;'M
#J(*%Lr$   r   c                       e Zd ZdZ eedd      Z ee ed            Z ee ed            Z	 ee ed            Z
 ee      Z ee      Z e e             Z e e             Zy)InventoryMovementModelinventories_movementsTr   r   zlot_items.idzmovement_types.idN)r   r   r   r   r   r   r   r   ru   rv   movement_type_idrR   r   r   reasonr   r!   r#   r$   r%   r   r      st    +M	T	>B':.>#?@L*^"<=Kgz2E'FGgHwIDF^F
#Jr$   r   c                       e Zd ZdZ eedd      Z ee ed            Z ee ed            Z	 ee      Z
 ee      Z e e             Z e e       ej                         Zy)InventoryAuditModelinventories_auditsTr   zusers.idr   re   N)r   r   r   r   r   r   r   r   user_idru   previous_stock	new_stockr   r   r   r   ro   r!   r#   r$   r%   r   r     sg    (M	T	>BWj45G':.>#?@LG_NwIDF^F
HLL9Jr$   r   c                       e Zd ZdZ eedd      Z ee ed            Z ee ed            Z	 e e
       ej                        Z e e
             Zy)SupplierCategoryModelsuppliers_categoriesTr   zsuppliers.idzcategories.idre   N)r   r   r   r   r   r   r   r   r4   r   r   r   ro   r!   r"   r#   r$   r%   r   r     sU    *M	T	>B*^"<=K*_"=>K
HLL9J(*%Lr$   r   c                       e Zd ZdZ eedd      Z ee ed            Z eed      Z	 eed      Z
 e e       ej                        Z e e       ej                        Zy)KardexValuesModelkardex_valuesTr   zproducts.idr   re   N)r   r   r   r   r   r   r   r   rP   rR   average_costr   r   ro   r!   r"   r#   r$   r%   r   r     sb    #M	T	>BM!:;Jgq)H'1-L
HLL9J(*hll;Lr$   r   N)-app.backend.db.databaser   
sqlalchemyr   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   sqlalchemy.ormr   r   r   r(   r.   rM   rY   r_   rc   rq   ry   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r#   r$   r%   <module>r      sM   ( \  \  \  \  \ * &t &&4 & (D  (D&4 & &D &&t &< <$
t 
&D &&D &
& 
&	&T 	&
&t 
&&4 &**4 *	$T 	$&t &&4 &&D && &
$T 
$	:$ 	:&D &< <r$   