BaseKataoSupplierInvoice.php 87 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306
  1. <?php
  2. /**
  3. * Base class that represents a row from the 'katao_supplier_invoice' table.
  4. *
  5. *
  6. *
  7. * @package lib.model.om
  8. */
  9. abstract class BaseKataoSupplierInvoice extends BaseObject implements Persistent {
  10. /**
  11. * The Peer class.
  12. * Instance provides a convenient way of calling static methods on a class
  13. * that calling code may not be able to identify.
  14. * @var KataoSupplierInvoicePeer
  15. */
  16. protected static $peer;
  17. /**
  18. * The value for the id field.
  19. * @var int
  20. */
  21. protected $id;
  22. /**
  23. * The value for the katao_supplier_id field.
  24. * @var int
  25. */
  26. protected $katao_supplier_id;
  27. /**
  28. * The value for the katao_period_id field.
  29. * @var int
  30. */
  31. protected $katao_period_id;
  32. /**
  33. * The value for the status field.
  34. * @var int
  35. */
  36. protected $status = 1;
  37. /**
  38. * The value for the supplier_name field.
  39. * @var string
  40. */
  41. protected $supplier_name;
  42. /**
  43. * The value for the supplier_email field.
  44. * @var string
  45. */
  46. protected $supplier_email;
  47. /**
  48. * The value for the supplier_address1 field.
  49. * @var string
  50. */
  51. protected $supplier_address1;
  52. /**
  53. * The value for the supplier_address2 field.
  54. * @var string
  55. */
  56. protected $supplier_address2;
  57. /**
  58. * The value for the supplier_zip field.
  59. * @var string
  60. */
  61. protected $supplier_zip;
  62. /**
  63. * The value for the supplier_city field.
  64. * @var string
  65. */
  66. protected $supplier_city;
  67. /**
  68. * The value for the katao_name field.
  69. * @var string
  70. */
  71. protected $katao_name;
  72. /**
  73. * The value for the katao_address field.
  74. * @var string
  75. */
  76. protected $katao_address;
  77. /**
  78. * The value for the katao_siret_number field.
  79. * @var string
  80. */
  81. protected $katao_siret_number;
  82. /**
  83. * The value for the katao_rcs_number field.
  84. * @var string
  85. */
  86. protected $katao_rcs_number;
  87. /**
  88. * The value for the katao_capital field.
  89. * @var int
  90. */
  91. protected $katao_capital;
  92. /**
  93. * The value for the reference field.
  94. * @var string
  95. */
  96. protected $reference;
  97. /**
  98. * The value for the invoice_date field.
  99. * @var int
  100. */
  101. protected $invoice_date;
  102. /**
  103. * The value for the due_date field.
  104. * @var int
  105. */
  106. protected $due_date;
  107. /**
  108. * The value for the payment_date field.
  109. * @var int
  110. */
  111. protected $payment_date;
  112. /**
  113. * The value for the payment_mode field.
  114. * @var int
  115. */
  116. protected $payment_mode = 1;
  117. /**
  118. * The value for the payment_details field.
  119. * @var string
  120. */
  121. protected $payment_details;
  122. /**
  123. * The value for the payment_amount_euro field.
  124. * @var double
  125. */
  126. protected $payment_amount_euro = 0;
  127. /**
  128. * The value for the payment_amount_sol field.
  129. * @var double
  130. */
  131. protected $payment_amount_sol = 0;
  132. /**
  133. * The value for the taux0_bases_ht field.
  134. * @var double
  135. */
  136. protected $taux0_bases_ht = 0;
  137. /**
  138. * The value for the taux0_discount_ht field.
  139. * @var double
  140. */
  141. protected $taux0_discount_ht = 0;
  142. /**
  143. * The value for the taux0_amount field.
  144. * @var double
  145. */
  146. protected $taux0_amount = 0;
  147. /**
  148. * The value for the taux1_bases_ht field.
  149. * @var double
  150. */
  151. protected $taux1_bases_ht = 0;
  152. /**
  153. * The value for the taux1_discount_ht field.
  154. * @var double
  155. */
  156. protected $taux1_discount_ht = 0;
  157. /**
  158. * The value for the taux1_amount field.
  159. * @var double
  160. */
  161. protected $taux1_amount = 0;
  162. /**
  163. * The value for the taux2_bases_ht field.
  164. * @var double
  165. */
  166. protected $taux2_bases_ht = 0;
  167. /**
  168. * The value for the taux2_discount_ht field.
  169. * @var double
  170. */
  171. protected $taux2_discount_ht = 0;
  172. /**
  173. * The value for the taux2_amount field.
  174. * @var double
  175. */
  176. protected $taux2_amount = 0;
  177. /**
  178. * The value for the total_ht field.
  179. * @var double
  180. */
  181. protected $total_ht = 0;
  182. /**
  183. * The value for the total_tva field.
  184. * @var double
  185. */
  186. protected $total_tva = 0;
  187. /**
  188. * The value for the comment field.
  189. * @var string
  190. */
  191. protected $comment;
  192. /**
  193. * The value for the fees_shipping_ht field.
  194. * @var double
  195. */
  196. protected $fees_shipping_ht = 0;
  197. /**
  198. * The value for the fees_shipping_rate field.
  199. * @var double
  200. */
  201. protected $fees_shipping_rate = 0;
  202. /**
  203. * The value for the fees_shipping_tva field.
  204. * @var double
  205. */
  206. protected $fees_shipping_tva = 0;
  207. /**
  208. * The value for the fees_billing_ht field.
  209. * @var double
  210. */
  211. protected $fees_billing_ht = 0;
  212. /**
  213. * The value for the fees_billing_rate field.
  214. * @var double
  215. */
  216. protected $fees_billing_rate = 0;
  217. /**
  218. * The value for the fees_billing_tva field.
  219. * @var double
  220. */
  221. protected $fees_billing_tva = 0;
  222. /**
  223. * The value for the created_at field.
  224. * @var int
  225. */
  226. protected $created_at;
  227. /**
  228. * The value for the updated_at field.
  229. * @var int
  230. */
  231. protected $updated_at;
  232. /**
  233. * @var KataoSupplier
  234. */
  235. protected $aKataoSupplier;
  236. /**
  237. * @var KataoPeriod
  238. */
  239. protected $aKataoPeriod;
  240. /**
  241. * Collection to store aggregation of collKataoSupplierInvoiceProducts.
  242. * @var array
  243. */
  244. protected $collKataoSupplierInvoiceProducts;
  245. /**
  246. * The criteria used to select the current contents of collKataoSupplierInvoiceProducts.
  247. * @var Criteria
  248. */
  249. protected $lastKataoSupplierInvoiceProductCriteria = null;
  250. /**
  251. * Collection to store aggregation of collKataoSupplierInvoiceOrders.
  252. * @var array
  253. */
  254. protected $collKataoSupplierInvoiceOrders;
  255. /**
  256. * The criteria used to select the current contents of collKataoSupplierInvoiceOrders.
  257. * @var Criteria
  258. */
  259. protected $lastKataoSupplierInvoiceOrderCriteria = null;
  260. /**
  261. * Flag to prevent endless save loop, if this object is referenced
  262. * by another object which falls in this transaction.
  263. * @var boolean
  264. */
  265. protected $alreadyInSave = false;
  266. /**
  267. * Flag to prevent endless validation loop, if this object is referenced
  268. * by another object which falls in this transaction.
  269. * @var boolean
  270. */
  271. protected $alreadyInValidation = false;
  272. /**
  273. * Get the [id] column value.
  274. *
  275. * @return int
  276. */
  277. public function getId()
  278. {
  279. return $this->id;
  280. }
  281. /**
  282. * Get the [katao_supplier_id] column value.
  283. *
  284. * @return int
  285. */
  286. public function getKataoSupplierId()
  287. {
  288. return $this->katao_supplier_id;
  289. }
  290. /**
  291. * Get the [katao_period_id] column value.
  292. *
  293. * @return int
  294. */
  295. public function getKataoPeriodId()
  296. {
  297. return $this->katao_period_id;
  298. }
  299. /**
  300. * Get the [status] column value.
  301. *
  302. * @return int
  303. */
  304. public function getStatus()
  305. {
  306. return $this->status;
  307. }
  308. /**
  309. * Get the [supplier_name] column value.
  310. *
  311. * @return string
  312. */
  313. public function getSupplierName()
  314. {
  315. return $this->supplier_name;
  316. }
  317. /**
  318. * Get the [supplier_email] column value.
  319. *
  320. * @return string
  321. */
  322. public function getSupplierEmail()
  323. {
  324. return $this->supplier_email;
  325. }
  326. /**
  327. * Get the [supplier_address1] column value.
  328. *
  329. * @return string
  330. */
  331. public function getSupplierAddress1()
  332. {
  333. return $this->supplier_address1;
  334. }
  335. /**
  336. * Get the [supplier_address2] column value.
  337. *
  338. * @return string
  339. */
  340. public function getSupplierAddress2()
  341. {
  342. return $this->supplier_address2;
  343. }
  344. /**
  345. * Get the [supplier_zip] column value.
  346. *
  347. * @return string
  348. */
  349. public function getSupplierZip()
  350. {
  351. return $this->supplier_zip;
  352. }
  353. /**
  354. * Get the [supplier_city] column value.
  355. *
  356. * @return string
  357. */
  358. public function getSupplierCity()
  359. {
  360. return $this->supplier_city;
  361. }
  362. /**
  363. * Get the [katao_name] column value.
  364. *
  365. * @return string
  366. */
  367. public function getKataoName()
  368. {
  369. return $this->katao_name;
  370. }
  371. /**
  372. * Get the [katao_address] column value.
  373. *
  374. * @return string
  375. */
  376. public function getKataoAddress()
  377. {
  378. return $this->katao_address;
  379. }
  380. /**
  381. * Get the [katao_siret_number] column value.
  382. *
  383. * @return string
  384. */
  385. public function getKataoSiretNumber()
  386. {
  387. return $this->katao_siret_number;
  388. }
  389. /**
  390. * Get the [katao_rcs_number] column value.
  391. *
  392. * @return string
  393. */
  394. public function getKataoRcsNumber()
  395. {
  396. return $this->katao_rcs_number;
  397. }
  398. /**
  399. * Get the [katao_capital] column value.
  400. *
  401. * @return int
  402. */
  403. public function getKataoCapital()
  404. {
  405. return $this->katao_capital;
  406. }
  407. /**
  408. * Get the [reference] column value.
  409. *
  410. * @return string
  411. */
  412. public function getReference()
  413. {
  414. return $this->reference;
  415. }
  416. /**
  417. * Get the [optionally formatted] [invoice_date] column value.
  418. *
  419. * @param string $format The date/time format string (either date()-style or strftime()-style).
  420. * If format is NULL, then the integer unix timestamp will be returned.
  421. * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
  422. * @throws PropelException - if unable to convert the date/time to timestamp.
  423. */
  424. public function getInvoiceDate($format = 'Y-m-d H:i:s')
  425. {
  426. if ($this->invoice_date === null || $this->invoice_date === '') {
  427. return null;
  428. } elseif (!is_int($this->invoice_date)) {
  429. // a non-timestamp value was set externally, so we convert it
  430. $ts = strtotime($this->invoice_date);
  431. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  432. throw new PropelException("Unable to parse value of [invoice_date] as date/time value: " . var_export($this->invoice_date, true));
  433. }
  434. } else {
  435. $ts = $this->invoice_date;
  436. }
  437. if ($format === null) {
  438. return $ts;
  439. } elseif (strpos($format, '%') !== false) {
  440. return strftime($format, $ts);
  441. } else {
  442. return date($format, $ts);
  443. }
  444. }
  445. /**
  446. * Get the [optionally formatted] [due_date] column value.
  447. *
  448. * @param string $format The date/time format string (either date()-style or strftime()-style).
  449. * If format is NULL, then the integer unix timestamp will be returned.
  450. * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
  451. * @throws PropelException - if unable to convert the date/time to timestamp.
  452. */
  453. public function getDueDate($format = 'Y-m-d H:i:s')
  454. {
  455. if ($this->due_date === null || $this->due_date === '') {
  456. return null;
  457. } elseif (!is_int($this->due_date)) {
  458. // a non-timestamp value was set externally, so we convert it
  459. $ts = strtotime($this->due_date);
  460. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  461. throw new PropelException("Unable to parse value of [due_date] as date/time value: " . var_export($this->due_date, true));
  462. }
  463. } else {
  464. $ts = $this->due_date;
  465. }
  466. if ($format === null) {
  467. return $ts;
  468. } elseif (strpos($format, '%') !== false) {
  469. return strftime($format, $ts);
  470. } else {
  471. return date($format, $ts);
  472. }
  473. }
  474. /**
  475. * Get the [optionally formatted] [payment_date] column value.
  476. *
  477. * @param string $format The date/time format string (either date()-style or strftime()-style).
  478. * If format is NULL, then the integer unix timestamp will be returned.
  479. * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
  480. * @throws PropelException - if unable to convert the date/time to timestamp.
  481. */
  482. public function getPaymentDate($format = 'Y-m-d H:i:s')
  483. {
  484. if ($this->payment_date === null || $this->payment_date === '') {
  485. return null;
  486. } elseif (!is_int($this->payment_date)) {
  487. // a non-timestamp value was set externally, so we convert it
  488. $ts = strtotime($this->payment_date);
  489. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  490. throw new PropelException("Unable to parse value of [payment_date] as date/time value: " . var_export($this->payment_date, true));
  491. }
  492. } else {
  493. $ts = $this->payment_date;
  494. }
  495. if ($format === null) {
  496. return $ts;
  497. } elseif (strpos($format, '%') !== false) {
  498. return strftime($format, $ts);
  499. } else {
  500. return date($format, $ts);
  501. }
  502. }
  503. /**
  504. * Get the [payment_mode] column value.
  505. *
  506. * @return int
  507. */
  508. public function getPaymentMode()
  509. {
  510. return $this->payment_mode;
  511. }
  512. /**
  513. * Get the [payment_details] column value.
  514. *
  515. * @return string
  516. */
  517. public function getPaymentDetails()
  518. {
  519. return $this->payment_details;
  520. }
  521. /**
  522. * Get the [payment_amount_euro] column value.
  523. *
  524. * @return double
  525. */
  526. public function getPaymentAmountEuro()
  527. {
  528. return $this->payment_amount_euro;
  529. }
  530. /**
  531. * Get the [payment_amount_sol] column value.
  532. *
  533. * @return double
  534. */
  535. public function getPaymentAmountSol()
  536. {
  537. return $this->payment_amount_sol;
  538. }
  539. /**
  540. * Get the [taux0_bases_ht] column value.
  541. *
  542. * @return double
  543. */
  544. public function getTaux0BasesHt()
  545. {
  546. return $this->taux0_bases_ht;
  547. }
  548. /**
  549. * Get the [taux0_discount_ht] column value.
  550. *
  551. * @return double
  552. */
  553. public function getTaux0DiscountHt()
  554. {
  555. return $this->taux0_discount_ht;
  556. }
  557. /**
  558. * Get the [taux0_amount] column value.
  559. *
  560. * @return double
  561. */
  562. public function getTaux0Amount()
  563. {
  564. return $this->taux0_amount;
  565. }
  566. /**
  567. * Get the [taux1_bases_ht] column value.
  568. *
  569. * @return double
  570. */
  571. public function getTaux1BasesHt()
  572. {
  573. return $this->taux1_bases_ht;
  574. }
  575. /**
  576. * Get the [taux1_discount_ht] column value.
  577. *
  578. * @return double
  579. */
  580. public function getTaux1DiscountHt()
  581. {
  582. return $this->taux1_discount_ht;
  583. }
  584. /**
  585. * Get the [taux1_amount] column value.
  586. *
  587. * @return double
  588. */
  589. public function getTaux1Amount()
  590. {
  591. return $this->taux1_amount;
  592. }
  593. /**
  594. * Get the [taux2_bases_ht] column value.
  595. *
  596. * @return double
  597. */
  598. public function getTaux2BasesHt()
  599. {
  600. return $this->taux2_bases_ht;
  601. }
  602. /**
  603. * Get the [taux2_discount_ht] column value.
  604. *
  605. * @return double
  606. */
  607. public function getTaux2DiscountHt()
  608. {
  609. return $this->taux2_discount_ht;
  610. }
  611. /**
  612. * Get the [taux2_amount] column value.
  613. *
  614. * @return double
  615. */
  616. public function getTaux2Amount()
  617. {
  618. return $this->taux2_amount;
  619. }
  620. /**
  621. * Get the [total_ht] column value.
  622. *
  623. * @return double
  624. */
  625. public function getTotalHt()
  626. {
  627. return $this->total_ht;
  628. }
  629. /**
  630. * Get the [total_tva] column value.
  631. *
  632. * @return double
  633. */
  634. public function getTotalTva()
  635. {
  636. return $this->total_tva;
  637. }
  638. /**
  639. * Get the [comment] column value.
  640. *
  641. * @return string
  642. */
  643. public function getComment()
  644. {
  645. return $this->comment;
  646. }
  647. /**
  648. * Get the [fees_shipping_ht] column value.
  649. *
  650. * @return double
  651. */
  652. public function getFeesShippingHt()
  653. {
  654. return $this->fees_shipping_ht;
  655. }
  656. /**
  657. * Get the [fees_shipping_rate] column value.
  658. *
  659. * @return double
  660. */
  661. public function getFeesShippingRate()
  662. {
  663. return $this->fees_shipping_rate;
  664. }
  665. /**
  666. * Get the [fees_shipping_tva] column value.
  667. *
  668. * @return double
  669. */
  670. public function getFeesShippingTva()
  671. {
  672. return $this->fees_shipping_tva;
  673. }
  674. /**
  675. * Get the [fees_billing_ht] column value.
  676. *
  677. * @return double
  678. */
  679. public function getFeesBillingHt()
  680. {
  681. return $this->fees_billing_ht;
  682. }
  683. /**
  684. * Get the [fees_billing_rate] column value.
  685. *
  686. * @return double
  687. */
  688. public function getFeesBillingRate()
  689. {
  690. return $this->fees_billing_rate;
  691. }
  692. /**
  693. * Get the [fees_billing_tva] column value.
  694. *
  695. * @return double
  696. */
  697. public function getFeesBillingTva()
  698. {
  699. return $this->fees_billing_tva;
  700. }
  701. /**
  702. * Get the [optionally formatted] [created_at] column value.
  703. *
  704. * @param string $format The date/time format string (either date()-style or strftime()-style).
  705. * If format is NULL, then the integer unix timestamp will be returned.
  706. * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
  707. * @throws PropelException - if unable to convert the date/time to timestamp.
  708. */
  709. public function getCreatedAt($format = 'Y-m-d H:i:s')
  710. {
  711. if ($this->created_at === null || $this->created_at === '') {
  712. return null;
  713. } elseif (!is_int($this->created_at)) {
  714. // a non-timestamp value was set externally, so we convert it
  715. $ts = strtotime($this->created_at);
  716. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  717. throw new PropelException("Unable to parse value of [created_at] as date/time value: " . var_export($this->created_at, true));
  718. }
  719. } else {
  720. $ts = $this->created_at;
  721. }
  722. if ($format === null) {
  723. return $ts;
  724. } elseif (strpos($format, '%') !== false) {
  725. return strftime($format, $ts);
  726. } else {
  727. return date($format, $ts);
  728. }
  729. }
  730. /**
  731. * Get the [optionally formatted] [updated_at] column value.
  732. *
  733. * @param string $format The date/time format string (either date()-style or strftime()-style).
  734. * If format is NULL, then the integer unix timestamp will be returned.
  735. * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
  736. * @throws PropelException - if unable to convert the date/time to timestamp.
  737. */
  738. public function getUpdatedAt($format = 'Y-m-d H:i:s')
  739. {
  740. if ($this->updated_at === null || $this->updated_at === '') {
  741. return null;
  742. } elseif (!is_int($this->updated_at)) {
  743. // a non-timestamp value was set externally, so we convert it
  744. $ts = strtotime($this->updated_at);
  745. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  746. throw new PropelException("Unable to parse value of [updated_at] as date/time value: " . var_export($this->updated_at, true));
  747. }
  748. } else {
  749. $ts = $this->updated_at;
  750. }
  751. if ($format === null) {
  752. return $ts;
  753. } elseif (strpos($format, '%') !== false) {
  754. return strftime($format, $ts);
  755. } else {
  756. return date($format, $ts);
  757. }
  758. }
  759. /**
  760. * Set the value of [id] column.
  761. *
  762. * @param int $v new value
  763. * @return void
  764. */
  765. public function setId($v)
  766. {
  767. // Since the native PHP type for this column is integer,
  768. // we will cast the input value to an int (if it is not).
  769. if ($v !== null && !is_int($v) && is_numeric($v)) {
  770. $v = (int) $v;
  771. }
  772. if ($this->id !== $v) {
  773. $this->id = $v;
  774. $this->modifiedColumns[] = KataoSupplierInvoicePeer::ID;
  775. }
  776. } // setId()
  777. /**
  778. * Set the value of [katao_supplier_id] column.
  779. *
  780. * @param int $v new value
  781. * @return void
  782. */
  783. public function setKataoSupplierId($v)
  784. {
  785. // Since the native PHP type for this column is integer,
  786. // we will cast the input value to an int (if it is not).
  787. if ($v !== null && !is_int($v) && is_numeric($v)) {
  788. $v = (int) $v;
  789. }
  790. if ($this->katao_supplier_id !== $v) {
  791. $this->katao_supplier_id = $v;
  792. $this->modifiedColumns[] = KataoSupplierInvoicePeer::KATAO_SUPPLIER_ID;
  793. }
  794. if ($this->aKataoSupplier !== null && $this->aKataoSupplier->getId() !== $v) {
  795. $this->aKataoSupplier = null;
  796. }
  797. } // setKataoSupplierId()
  798. /**
  799. * Set the value of [katao_period_id] column.
  800. *
  801. * @param int $v new value
  802. * @return void
  803. */
  804. public function setKataoPeriodId($v)
  805. {
  806. // Since the native PHP type for this column is integer,
  807. // we will cast the input value to an int (if it is not).
  808. if ($v !== null && !is_int($v) && is_numeric($v)) {
  809. $v = (int) $v;
  810. }
  811. if ($this->katao_period_id !== $v) {
  812. $this->katao_period_id = $v;
  813. $this->modifiedColumns[] = KataoSupplierInvoicePeer::KATAO_PERIOD_ID;
  814. }
  815. if ($this->aKataoPeriod !== null && $this->aKataoPeriod->getId() !== $v) {
  816. $this->aKataoPeriod = null;
  817. }
  818. } // setKataoPeriodId()
  819. /**
  820. * Set the value of [status] column.
  821. *
  822. * @param int $v new value
  823. * @return void
  824. */
  825. public function setStatus($v)
  826. {
  827. // Since the native PHP type for this column is integer,
  828. // we will cast the input value to an int (if it is not).
  829. if ($v !== null && !is_int($v) && is_numeric($v)) {
  830. $v = (int) $v;
  831. }
  832. if ($this->status !== $v || $v === 1) {
  833. $this->status = $v;
  834. $this->modifiedColumns[] = KataoSupplierInvoicePeer::STATUS;
  835. }
  836. } // setStatus()
  837. /**
  838. * Set the value of [supplier_name] column.
  839. *
  840. * @param string $v new value
  841. * @return void
  842. */
  843. public function setSupplierName($v)
  844. {
  845. // Since the native PHP type for this column is string,
  846. // we will cast the input to a string (if it is not).
  847. if ($v !== null && !is_string($v)) {
  848. $v = (string) $v;
  849. }
  850. if ($this->supplier_name !== $v) {
  851. $this->supplier_name = $v;
  852. $this->modifiedColumns[] = KataoSupplierInvoicePeer::SUPPLIER_NAME;
  853. }
  854. } // setSupplierName()
  855. /**
  856. * Set the value of [supplier_email] column.
  857. *
  858. * @param string $v new value
  859. * @return void
  860. */
  861. public function setSupplierEmail($v)
  862. {
  863. // Since the native PHP type for this column is string,
  864. // we will cast the input to a string (if it is not).
  865. if ($v !== null && !is_string($v)) {
  866. $v = (string) $v;
  867. }
  868. if ($this->supplier_email !== $v) {
  869. $this->supplier_email = $v;
  870. $this->modifiedColumns[] = KataoSupplierInvoicePeer::SUPPLIER_EMAIL;
  871. }
  872. } // setSupplierEmail()
  873. /**
  874. * Set the value of [supplier_address1] column.
  875. *
  876. * @param string $v new value
  877. * @return void
  878. */
  879. public function setSupplierAddress1($v)
  880. {
  881. // Since the native PHP type for this column is string,
  882. // we will cast the input to a string (if it is not).
  883. if ($v !== null && !is_string($v)) {
  884. $v = (string) $v;
  885. }
  886. if ($this->supplier_address1 !== $v) {
  887. $this->supplier_address1 = $v;
  888. $this->modifiedColumns[] = KataoSupplierInvoicePeer::SUPPLIER_ADDRESS1;
  889. }
  890. } // setSupplierAddress1()
  891. /**
  892. * Set the value of [supplier_address2] column.
  893. *
  894. * @param string $v new value
  895. * @return void
  896. */
  897. public function setSupplierAddress2($v)
  898. {
  899. // Since the native PHP type for this column is string,
  900. // we will cast the input to a string (if it is not).
  901. if ($v !== null && !is_string($v)) {
  902. $v = (string) $v;
  903. }
  904. if ($this->supplier_address2 !== $v) {
  905. $this->supplier_address2 = $v;
  906. $this->modifiedColumns[] = KataoSupplierInvoicePeer::SUPPLIER_ADDRESS2;
  907. }
  908. } // setSupplierAddress2()
  909. /**
  910. * Set the value of [supplier_zip] column.
  911. *
  912. * @param string $v new value
  913. * @return void
  914. */
  915. public function setSupplierZip($v)
  916. {
  917. // Since the native PHP type for this column is string,
  918. // we will cast the input to a string (if it is not).
  919. if ($v !== null && !is_string($v)) {
  920. $v = (string) $v;
  921. }
  922. if ($this->supplier_zip !== $v) {
  923. $this->supplier_zip = $v;
  924. $this->modifiedColumns[] = KataoSupplierInvoicePeer::SUPPLIER_ZIP;
  925. }
  926. } // setSupplierZip()
  927. /**
  928. * Set the value of [supplier_city] column.
  929. *
  930. * @param string $v new value
  931. * @return void
  932. */
  933. public function setSupplierCity($v)
  934. {
  935. // Since the native PHP type for this column is string,
  936. // we will cast the input to a string (if it is not).
  937. if ($v !== null && !is_string($v)) {
  938. $v = (string) $v;
  939. }
  940. if ($this->supplier_city !== $v) {
  941. $this->supplier_city = $v;
  942. $this->modifiedColumns[] = KataoSupplierInvoicePeer::SUPPLIER_CITY;
  943. }
  944. } // setSupplierCity()
  945. /**
  946. * Set the value of [katao_name] column.
  947. *
  948. * @param string $v new value
  949. * @return void
  950. */
  951. public function setKataoName($v)
  952. {
  953. // Since the native PHP type for this column is string,
  954. // we will cast the input to a string (if it is not).
  955. if ($v !== null && !is_string($v)) {
  956. $v = (string) $v;
  957. }
  958. if ($this->katao_name !== $v) {
  959. $this->katao_name = $v;
  960. $this->modifiedColumns[] = KataoSupplierInvoicePeer::KATAO_NAME;
  961. }
  962. } // setKataoName()
  963. /**
  964. * Set the value of [katao_address] column.
  965. *
  966. * @param string $v new value
  967. * @return void
  968. */
  969. public function setKataoAddress($v)
  970. {
  971. // Since the native PHP type for this column is string,
  972. // we will cast the input to a string (if it is not).
  973. if ($v !== null && !is_string($v)) {
  974. $v = (string) $v;
  975. }
  976. if ($this->katao_address !== $v) {
  977. $this->katao_address = $v;
  978. $this->modifiedColumns[] = KataoSupplierInvoicePeer::KATAO_ADDRESS;
  979. }
  980. } // setKataoAddress()
  981. /**
  982. * Set the value of [katao_siret_number] column.
  983. *
  984. * @param string $v new value
  985. * @return void
  986. */
  987. public function setKataoSiretNumber($v)
  988. {
  989. // Since the native PHP type for this column is string,
  990. // we will cast the input to a string (if it is not).
  991. if ($v !== null && !is_string($v)) {
  992. $v = (string) $v;
  993. }
  994. if ($this->katao_siret_number !== $v) {
  995. $this->katao_siret_number = $v;
  996. $this->modifiedColumns[] = KataoSupplierInvoicePeer::KATAO_SIRET_NUMBER;
  997. }
  998. } // setKataoSiretNumber()
  999. /**
  1000. * Set the value of [katao_rcs_number] column.
  1001. *
  1002. * @param string $v new value
  1003. * @return void
  1004. */
  1005. public function setKataoRcsNumber($v)
  1006. {
  1007. // Since the native PHP type for this column is string,
  1008. // we will cast the input to a string (if it is not).
  1009. if ($v !== null && !is_string($v)) {
  1010. $v = (string) $v;
  1011. }
  1012. if ($this->katao_rcs_number !== $v) {
  1013. $this->katao_rcs_number = $v;
  1014. $this->modifiedColumns[] = KataoSupplierInvoicePeer::KATAO_RCS_NUMBER;
  1015. }
  1016. } // setKataoRcsNumber()
  1017. /**
  1018. * Set the value of [katao_capital] column.
  1019. *
  1020. * @param int $v new value
  1021. * @return void
  1022. */
  1023. public function setKataoCapital($v)
  1024. {
  1025. // Since the native PHP type for this column is integer,
  1026. // we will cast the input value to an int (if it is not).
  1027. if ($v !== null && !is_int($v) && is_numeric($v)) {
  1028. $v = (int) $v;
  1029. }
  1030. if ($this->katao_capital !== $v) {
  1031. $this->katao_capital = $v;
  1032. $this->modifiedColumns[] = KataoSupplierInvoicePeer::KATAO_CAPITAL;
  1033. }
  1034. } // setKataoCapital()
  1035. /**
  1036. * Set the value of [reference] column.
  1037. *
  1038. * @param string $v new value
  1039. * @return void
  1040. */
  1041. public function setReference($v)
  1042. {
  1043. // Since the native PHP type for this column is string,
  1044. // we will cast the input to a string (if it is not).
  1045. if ($v !== null && !is_string($v)) {
  1046. $v = (string) $v;
  1047. }
  1048. if ($this->reference !== $v) {
  1049. $this->reference = $v;
  1050. $this->modifiedColumns[] = KataoSupplierInvoicePeer::REFERENCE;
  1051. }
  1052. } // setReference()
  1053. /**
  1054. * Set the value of [invoice_date] column.
  1055. *
  1056. * @param int $v new value
  1057. * @return void
  1058. */
  1059. public function setInvoiceDate($v)
  1060. {
  1061. if ($v !== null && !is_int($v)) {
  1062. $ts = strtotime($v);
  1063. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  1064. throw new PropelException("Unable to parse date/time value for [invoice_date] from input: " . var_export($v, true));
  1065. }
  1066. } else {
  1067. $ts = $v;
  1068. }
  1069. if ($this->invoice_date !== $ts) {
  1070. $this->invoice_date = $ts;
  1071. $this->modifiedColumns[] = KataoSupplierInvoicePeer::INVOICE_DATE;
  1072. }
  1073. } // setInvoiceDate()
  1074. /**
  1075. * Set the value of [due_date] column.
  1076. *
  1077. * @param int $v new value
  1078. * @return void
  1079. */
  1080. public function setDueDate($v)
  1081. {
  1082. if ($v !== null && !is_int($v)) {
  1083. $ts = strtotime($v);
  1084. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  1085. throw new PropelException("Unable to parse date/time value for [due_date] from input: " . var_export($v, true));
  1086. }
  1087. } else {
  1088. $ts = $v;
  1089. }
  1090. if ($this->due_date !== $ts) {
  1091. $this->due_date = $ts;
  1092. $this->modifiedColumns[] = KataoSupplierInvoicePeer::DUE_DATE;
  1093. }
  1094. } // setDueDate()
  1095. /**
  1096. * Set the value of [payment_date] column.
  1097. *
  1098. * @param int $v new value
  1099. * @return void
  1100. */
  1101. public function setPaymentDate($v)
  1102. {
  1103. if ($v !== null && !is_int($v)) {
  1104. $ts = strtotime($v);
  1105. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  1106. throw new PropelException("Unable to parse date/time value for [payment_date] from input: " . var_export($v, true));
  1107. }
  1108. } else {
  1109. $ts = $v;
  1110. }
  1111. if ($this->payment_date !== $ts) {
  1112. $this->payment_date = $ts;
  1113. $this->modifiedColumns[] = KataoSupplierInvoicePeer::PAYMENT_DATE;
  1114. }
  1115. } // setPaymentDate()
  1116. /**
  1117. * Set the value of [payment_mode] column.
  1118. *
  1119. * @param int $v new value
  1120. * @return void
  1121. */
  1122. public function setPaymentMode($v)
  1123. {
  1124. // Since the native PHP type for this column is integer,
  1125. // we will cast the input value to an int (if it is not).
  1126. if ($v !== null && !is_int($v) && is_numeric($v)) {
  1127. $v = (int) $v;
  1128. }
  1129. if ($this->payment_mode !== $v || $v === 1) {
  1130. $this->payment_mode = $v;
  1131. $this->modifiedColumns[] = KataoSupplierInvoicePeer::PAYMENT_MODE;
  1132. }
  1133. } // setPaymentMode()
  1134. /**
  1135. * Set the value of [payment_details] column.
  1136. *
  1137. * @param string $v new value
  1138. * @return void
  1139. */
  1140. public function setPaymentDetails($v)
  1141. {
  1142. // Since the native PHP type for this column is string,
  1143. // we will cast the input to a string (if it is not).
  1144. if ($v !== null && !is_string($v)) {
  1145. $v = (string) $v;
  1146. }
  1147. if ($this->payment_details !== $v) {
  1148. $this->payment_details = $v;
  1149. $this->modifiedColumns[] = KataoSupplierInvoicePeer::PAYMENT_DETAILS;
  1150. }
  1151. } // setPaymentDetails()
  1152. /**
  1153. * Set the value of [payment_amount_euro] column.
  1154. *
  1155. * @param double $v new value
  1156. * @return void
  1157. */
  1158. public function setPaymentAmountEuro($v)
  1159. {
  1160. if ($this->payment_amount_euro !== $v || $v === 0) {
  1161. $this->payment_amount_euro = $v;
  1162. $this->modifiedColumns[] = KataoSupplierInvoicePeer::PAYMENT_AMOUNT_EURO;
  1163. }
  1164. } // setPaymentAmountEuro()
  1165. /**
  1166. * Set the value of [payment_amount_sol] column.
  1167. *
  1168. * @param double $v new value
  1169. * @return void
  1170. */
  1171. public function setPaymentAmountSol($v)
  1172. {
  1173. if ($this->payment_amount_sol !== $v || $v === 0) {
  1174. $this->payment_amount_sol = $v;
  1175. $this->modifiedColumns[] = KataoSupplierInvoicePeer::PAYMENT_AMOUNT_SOL;
  1176. }
  1177. } // setPaymentAmountSol()
  1178. /**
  1179. * Set the value of [taux0_bases_ht] column.
  1180. *
  1181. * @param double $v new value
  1182. * @return void
  1183. */
  1184. public function setTaux0BasesHt($v)
  1185. {
  1186. if ($this->taux0_bases_ht !== $v || $v === 0) {
  1187. $this->taux0_bases_ht = $v;
  1188. $this->modifiedColumns[] = KataoSupplierInvoicePeer::TAUX0_BASES_HT;
  1189. }
  1190. } // setTaux0BasesHt()
  1191. /**
  1192. * Set the value of [taux0_discount_ht] column.
  1193. *
  1194. * @param double $v new value
  1195. * @return void
  1196. */
  1197. public function setTaux0DiscountHt($v)
  1198. {
  1199. if ($this->taux0_discount_ht !== $v || $v === 0) {
  1200. $this->taux0_discount_ht = $v;
  1201. $this->modifiedColumns[] = KataoSupplierInvoicePeer::TAUX0_DISCOUNT_HT;
  1202. }
  1203. } // setTaux0DiscountHt()
  1204. /**
  1205. * Set the value of [taux0_amount] column.
  1206. *
  1207. * @param double $v new value
  1208. * @return void
  1209. */
  1210. public function setTaux0Amount($v)
  1211. {
  1212. if ($this->taux0_amount !== $v || $v === 0) {
  1213. $this->taux0_amount = $v;
  1214. $this->modifiedColumns[] = KataoSupplierInvoicePeer::TAUX0_AMOUNT;
  1215. }
  1216. } // setTaux0Amount()
  1217. /**
  1218. * Set the value of [taux1_bases_ht] column.
  1219. *
  1220. * @param double $v new value
  1221. * @return void
  1222. */
  1223. public function setTaux1BasesHt($v)
  1224. {
  1225. if ($this->taux1_bases_ht !== $v || $v === 0) {
  1226. $this->taux1_bases_ht = $v;
  1227. $this->modifiedColumns[] = KataoSupplierInvoicePeer::TAUX1_BASES_HT;
  1228. }
  1229. } // setTaux1BasesHt()
  1230. /**
  1231. * Set the value of [taux1_discount_ht] column.
  1232. *
  1233. * @param double $v new value
  1234. * @return void
  1235. */
  1236. public function setTaux1DiscountHt($v)
  1237. {
  1238. if ($this->taux1_discount_ht !== $v || $v === 0) {
  1239. $this->taux1_discount_ht = $v;
  1240. $this->modifiedColumns[] = KataoSupplierInvoicePeer::TAUX1_DISCOUNT_HT;
  1241. }
  1242. } // setTaux1DiscountHt()
  1243. /**
  1244. * Set the value of [taux1_amount] column.
  1245. *
  1246. * @param double $v new value
  1247. * @return void
  1248. */
  1249. public function setTaux1Amount($v)
  1250. {
  1251. if ($this->taux1_amount !== $v || $v === 0) {
  1252. $this->taux1_amount = $v;
  1253. $this->modifiedColumns[] = KataoSupplierInvoicePeer::TAUX1_AMOUNT;
  1254. }
  1255. } // setTaux1Amount()
  1256. /**
  1257. * Set the value of [taux2_bases_ht] column.
  1258. *
  1259. * @param double $v new value
  1260. * @return void
  1261. */
  1262. public function setTaux2BasesHt($v)
  1263. {
  1264. if ($this->taux2_bases_ht !== $v || $v === 0) {
  1265. $this->taux2_bases_ht = $v;
  1266. $this->modifiedColumns[] = KataoSupplierInvoicePeer::TAUX2_BASES_HT;
  1267. }
  1268. } // setTaux2BasesHt()
  1269. /**
  1270. * Set the value of [taux2_discount_ht] column.
  1271. *
  1272. * @param double $v new value
  1273. * @return void
  1274. */
  1275. public function setTaux2DiscountHt($v)
  1276. {
  1277. if ($this->taux2_discount_ht !== $v || $v === 0) {
  1278. $this->taux2_discount_ht = $v;
  1279. $this->modifiedColumns[] = KataoSupplierInvoicePeer::TAUX2_DISCOUNT_HT;
  1280. }
  1281. } // setTaux2DiscountHt()
  1282. /**
  1283. * Set the value of [taux2_amount] column.
  1284. *
  1285. * @param double $v new value
  1286. * @return void
  1287. */
  1288. public function setTaux2Amount($v)
  1289. {
  1290. if ($this->taux2_amount !== $v || $v === 0) {
  1291. $this->taux2_amount = $v;
  1292. $this->modifiedColumns[] = KataoSupplierInvoicePeer::TAUX2_AMOUNT;
  1293. }
  1294. } // setTaux2Amount()
  1295. /**
  1296. * Set the value of [total_ht] column.
  1297. *
  1298. * @param double $v new value
  1299. * @return void
  1300. */
  1301. public function setTotalHt($v)
  1302. {
  1303. if ($this->total_ht !== $v || $v === 0) {
  1304. $this->total_ht = $v;
  1305. $this->modifiedColumns[] = KataoSupplierInvoicePeer::TOTAL_HT;
  1306. }
  1307. } // setTotalHt()
  1308. /**
  1309. * Set the value of [total_tva] column.
  1310. *
  1311. * @param double $v new value
  1312. * @return void
  1313. */
  1314. public function setTotalTva($v)
  1315. {
  1316. if ($this->total_tva !== $v || $v === 0) {
  1317. $this->total_tva = $v;
  1318. $this->modifiedColumns[] = KataoSupplierInvoicePeer::TOTAL_TVA;
  1319. }
  1320. } // setTotalTva()
  1321. /**
  1322. * Set the value of [comment] column.
  1323. *
  1324. * @param string $v new value
  1325. * @return void
  1326. */
  1327. public function setComment($v)
  1328. {
  1329. // Since the native PHP type for this column is string,
  1330. // we will cast the input to a string (if it is not).
  1331. if ($v !== null && !is_string($v)) {
  1332. $v = (string) $v;
  1333. }
  1334. if ($this->comment !== $v) {
  1335. $this->comment = $v;
  1336. $this->modifiedColumns[] = KataoSupplierInvoicePeer::COMMENT;
  1337. }
  1338. } // setComment()
  1339. /**
  1340. * Set the value of [fees_shipping_ht] column.
  1341. *
  1342. * @param double $v new value
  1343. * @return void
  1344. */
  1345. public function setFeesShippingHt($v)
  1346. {
  1347. if ($this->fees_shipping_ht !== $v || $v === 0) {
  1348. $this->fees_shipping_ht = $v;
  1349. $this->modifiedColumns[] = KataoSupplierInvoicePeer::FEES_SHIPPING_HT;
  1350. }
  1351. } // setFeesShippingHt()
  1352. /**
  1353. * Set the value of [fees_shipping_rate] column.
  1354. *
  1355. * @param double $v new value
  1356. * @return void
  1357. */
  1358. public function setFeesShippingRate($v)
  1359. {
  1360. if ($this->fees_shipping_rate !== $v || $v === 0) {
  1361. $this->fees_shipping_rate = $v;
  1362. $this->modifiedColumns[] = KataoSupplierInvoicePeer::FEES_SHIPPING_RATE;
  1363. }
  1364. } // setFeesShippingRate()
  1365. /**
  1366. * Set the value of [fees_shipping_tva] column.
  1367. *
  1368. * @param double $v new value
  1369. * @return void
  1370. */
  1371. public function setFeesShippingTva($v)
  1372. {
  1373. if ($this->fees_shipping_tva !== $v || $v === 0) {
  1374. $this->fees_shipping_tva = $v;
  1375. $this->modifiedColumns[] = KataoSupplierInvoicePeer::FEES_SHIPPING_TVA;
  1376. }
  1377. } // setFeesShippingTva()
  1378. /**
  1379. * Set the value of [fees_billing_ht] column.
  1380. *
  1381. * @param double $v new value
  1382. * @return void
  1383. */
  1384. public function setFeesBillingHt($v)
  1385. {
  1386. if ($this->fees_billing_ht !== $v || $v === 0) {
  1387. $this->fees_billing_ht = $v;
  1388. $this->modifiedColumns[] = KataoSupplierInvoicePeer::FEES_BILLING_HT;
  1389. }
  1390. } // setFeesBillingHt()
  1391. /**
  1392. * Set the value of [fees_billing_rate] column.
  1393. *
  1394. * @param double $v new value
  1395. * @return void
  1396. */
  1397. public function setFeesBillingRate($v)
  1398. {
  1399. if ($this->fees_billing_rate !== $v || $v === 0) {
  1400. $this->fees_billing_rate = $v;
  1401. $this->modifiedColumns[] = KataoSupplierInvoicePeer::FEES_BILLING_RATE;
  1402. }
  1403. } // setFeesBillingRate()
  1404. /**
  1405. * Set the value of [fees_billing_tva] column.
  1406. *
  1407. * @param double $v new value
  1408. * @return void
  1409. */
  1410. public function setFeesBillingTva($v)
  1411. {
  1412. if ($this->fees_billing_tva !== $v || $v === 0) {
  1413. $this->fees_billing_tva = $v;
  1414. $this->modifiedColumns[] = KataoSupplierInvoicePeer::FEES_BILLING_TVA;
  1415. }
  1416. } // setFeesBillingTva()
  1417. /**
  1418. * Set the value of [created_at] column.
  1419. *
  1420. * @param int $v new value
  1421. * @return void
  1422. */
  1423. public function setCreatedAt($v)
  1424. {
  1425. if ($v !== null && !is_int($v)) {
  1426. $ts = strtotime($v);
  1427. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  1428. throw new PropelException("Unable to parse date/time value for [created_at] from input: " . var_export($v, true));
  1429. }
  1430. } else {
  1431. $ts = $v;
  1432. }
  1433. if ($this->created_at !== $ts) {
  1434. $this->created_at = $ts;
  1435. $this->modifiedColumns[] = KataoSupplierInvoicePeer::CREATED_AT;
  1436. }
  1437. } // setCreatedAt()
  1438. /**
  1439. * Set the value of [updated_at] column.
  1440. *
  1441. * @param int $v new value
  1442. * @return void
  1443. */
  1444. public function setUpdatedAt($v)
  1445. {
  1446. if ($v !== null && !is_int($v)) {
  1447. $ts = strtotime($v);
  1448. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  1449. throw new PropelException("Unable to parse date/time value for [updated_at] from input: " . var_export($v, true));
  1450. }
  1451. } else {
  1452. $ts = $v;
  1453. }
  1454. if ($this->updated_at !== $ts) {
  1455. $this->updated_at = $ts;
  1456. $this->modifiedColumns[] = KataoSupplierInvoicePeer::UPDATED_AT;
  1457. }
  1458. } // setUpdatedAt()
  1459. /**
  1460. * Hydrates (populates) the object variables with values from the database resultset.
  1461. *
  1462. * An offset (1-based "start column") is specified so that objects can be hydrated
  1463. * with a subset of the columns in the resultset rows. This is needed, for example,
  1464. * for results of JOIN queries where the resultset row includes columns from two or
  1465. * more tables.
  1466. *
  1467. * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
  1468. * @param int $startcol 1-based offset column which indicates which restultset column to start with.
  1469. * @return int next starting column
  1470. * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
  1471. */
  1472. public function hydrate(ResultSet $rs, $startcol = 1)
  1473. {
  1474. try {
  1475. $this->id = $rs->getInt($startcol + 0);
  1476. $this->katao_supplier_id = $rs->getInt($startcol + 1);
  1477. $this->katao_period_id = $rs->getInt($startcol + 2);
  1478. $this->status = $rs->getInt($startcol + 3);
  1479. $this->supplier_name = $rs->getString($startcol + 4);
  1480. $this->supplier_email = $rs->getString($startcol + 5);
  1481. $this->supplier_address1 = $rs->getString($startcol + 6);
  1482. $this->supplier_address2 = $rs->getString($startcol + 7);
  1483. $this->supplier_zip = $rs->getString($startcol + 8);
  1484. $this->supplier_city = $rs->getString($startcol + 9);
  1485. $this->katao_name = $rs->getString($startcol + 10);
  1486. $this->katao_address = $rs->getString($startcol + 11);
  1487. $this->katao_siret_number = $rs->getString($startcol + 12);
  1488. $this->katao_rcs_number = $rs->getString($startcol + 13);
  1489. $this->katao_capital = $rs->getInt($startcol + 14);
  1490. $this->reference = $rs->getString($startcol + 15);
  1491. $this->invoice_date = $rs->getTimestamp($startcol + 16, null);
  1492. $this->due_date = $rs->getTimestamp($startcol + 17, null);
  1493. $this->payment_date = $rs->getTimestamp($startcol + 18, null);
  1494. $this->payment_mode = $rs->getInt($startcol + 19);
  1495. $this->payment_details = $rs->getString($startcol + 20);
  1496. $this->payment_amount_euro = $rs->getFloat($startcol + 21);
  1497. $this->payment_amount_sol = $rs->getFloat($startcol + 22);
  1498. $this->taux0_bases_ht = $rs->getFloat($startcol + 23);
  1499. $this->taux0_discount_ht = $rs->getFloat($startcol + 24);
  1500. $this->taux0_amount = $rs->getFloat($startcol + 25);
  1501. $this->taux1_bases_ht = $rs->getFloat($startcol + 26);
  1502. $this->taux1_discount_ht = $rs->getFloat($startcol + 27);
  1503. $this->taux1_amount = $rs->getFloat($startcol + 28);
  1504. $this->taux2_bases_ht = $rs->getFloat($startcol + 29);
  1505. $this->taux2_discount_ht = $rs->getFloat($startcol + 30);
  1506. $this->taux2_amount = $rs->getFloat($startcol + 31);
  1507. $this->total_ht = $rs->getFloat($startcol + 32);
  1508. $this->total_tva = $rs->getFloat($startcol + 33);
  1509. $this->comment = $rs->getString($startcol + 34);
  1510. $this->fees_shipping_ht = $rs->getFloat($startcol + 35);
  1511. $this->fees_shipping_rate = $rs->getFloat($startcol + 36);
  1512. $this->fees_shipping_tva = $rs->getFloat($startcol + 37);
  1513. $this->fees_billing_ht = $rs->getFloat($startcol + 38);
  1514. $this->fees_billing_rate = $rs->getFloat($startcol + 39);
  1515. $this->fees_billing_tva = $rs->getFloat($startcol + 40);
  1516. $this->created_at = $rs->getTimestamp($startcol + 41, null);
  1517. $this->updated_at = $rs->getTimestamp($startcol + 42, null);
  1518. $this->resetModified();
  1519. $this->setNew(false);
  1520. // FIXME - using NUM_COLUMNS may be clearer.
  1521. return $startcol + 43; // 43 = KataoSupplierInvoicePeer::NUM_COLUMNS - KataoSupplierInvoicePeer::NUM_LAZY_LOAD_COLUMNS).
  1522. } catch (Exception $e) {
  1523. throw new PropelException("Error populating KataoSupplierInvoice object", $e);
  1524. }
  1525. }
  1526. /**
  1527. * Removes this object from datastore and sets delete attribute.
  1528. *
  1529. * @param Connection $con
  1530. * @return void
  1531. * @throws PropelException
  1532. * @see BaseObject::setDeleted()
  1533. * @see BaseObject::isDeleted()
  1534. */
  1535. public function delete($con = null)
  1536. {
  1537. foreach (sfMixer::getCallables('BaseKataoSupplierInvoice:delete:pre') as $callable)
  1538. {
  1539. $ret = call_user_func($callable, $this, $con);
  1540. if ($ret)
  1541. {
  1542. return;
  1543. }
  1544. }
  1545. if ($this->isDeleted()) {
  1546. throw new PropelException("This object has already been deleted.");
  1547. }
  1548. if ($con === null) {
  1549. $con = Propel::getConnection(KataoSupplierInvoicePeer::DATABASE_NAME);
  1550. }
  1551. try {
  1552. $con->begin();
  1553. KataoSupplierInvoicePeer::doDelete($this, $con);
  1554. $this->setDeleted(true);
  1555. $con->commit();
  1556. } catch (PropelException $e) {
  1557. $con->rollback();
  1558. throw $e;
  1559. }
  1560. foreach (sfMixer::getCallables('BaseKataoSupplierInvoice:delete:post') as $callable)
  1561. {
  1562. call_user_func($callable, $this, $con);
  1563. }
  1564. }
  1565. /**
  1566. * Stores the object in the database. If the object is new,
  1567. * it inserts it; otherwise an update is performed. This method
  1568. * wraps the doSave() worker method in a transaction.
  1569. *
  1570. * @param Connection $con
  1571. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  1572. * @throws PropelException
  1573. * @see doSave()
  1574. */
  1575. public function save($con = null)
  1576. {
  1577. foreach (sfMixer::getCallables('BaseKataoSupplierInvoice:save:pre') as $callable)
  1578. {
  1579. $affectedRows = call_user_func($callable, $this, $con);
  1580. if (is_int($affectedRows))
  1581. {
  1582. return $affectedRows;
  1583. }
  1584. }
  1585. if ($this->isNew() && !$this->isColumnModified(KataoSupplierInvoicePeer::CREATED_AT))
  1586. {
  1587. $this->setCreatedAt(time());
  1588. }
  1589. if ($this->isModified() && !$this->isColumnModified(KataoSupplierInvoicePeer::UPDATED_AT))
  1590. {
  1591. $this->setUpdatedAt(time());
  1592. }
  1593. if ($this->isDeleted()) {
  1594. throw new PropelException("You cannot save an object that has been deleted.");
  1595. }
  1596. if ($con === null) {
  1597. $con = Propel::getConnection(KataoSupplierInvoicePeer::DATABASE_NAME);
  1598. }
  1599. try {
  1600. $con->begin();
  1601. $affectedRows = $this->doSave($con);
  1602. $con->commit();
  1603. foreach (sfMixer::getCallables('BaseKataoSupplierInvoice:save:post') as $callable)
  1604. {
  1605. call_user_func($callable, $this, $con, $affectedRows);
  1606. }
  1607. return $affectedRows;
  1608. } catch (PropelException $e) {
  1609. $con->rollback();
  1610. throw $e;
  1611. }
  1612. }
  1613. /**
  1614. * Stores the object in the database.
  1615. *
  1616. * If the object is new, it inserts it; otherwise an update is performed.
  1617. * All related objects are also updated in this method.
  1618. *
  1619. * @param Connection $con
  1620. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  1621. * @throws PropelException
  1622. * @see save()
  1623. */
  1624. protected function doSave($con)
  1625. {
  1626. $affectedRows = 0; // initialize var to track total num of affected rows
  1627. if (!$this->alreadyInSave) {
  1628. $this->alreadyInSave = true;
  1629. // We call the save method on the following object(s) if they
  1630. // were passed to this object by their coresponding set
  1631. // method. This object relates to these object(s) by a
  1632. // foreign key reference.
  1633. if ($this->aKataoSupplier !== null) {
  1634. if ($this->aKataoSupplier->isModified()) {
  1635. $affectedRows += $this->aKataoSupplier->save($con);
  1636. }
  1637. $this->setKataoSupplier($this->aKataoSupplier);
  1638. }
  1639. if ($this->aKataoPeriod !== null) {
  1640. if ($this->aKataoPeriod->isModified()) {
  1641. $affectedRows += $this->aKataoPeriod->save($con);
  1642. }
  1643. $this->setKataoPeriod($this->aKataoPeriod);
  1644. }
  1645. // If this object has been modified, then save it to the database.
  1646. if ($this->isModified()) {
  1647. if ($this->isNew()) {
  1648. $pk = KataoSupplierInvoicePeer::doInsert($this, $con);
  1649. $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
  1650. // should always be true here (even though technically
  1651. // BasePeer::doInsert() can insert multiple rows).
  1652. $this->setId($pk); //[IMV] update autoincrement primary key
  1653. $this->setNew(false);
  1654. } else {
  1655. $affectedRows += KataoSupplierInvoicePeer::doUpdate($this, $con);
  1656. }
  1657. $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
  1658. }
  1659. if ($this->collKataoSupplierInvoiceProducts !== null) {
  1660. foreach($this->collKataoSupplierInvoiceProducts as $referrerFK) {
  1661. if (!$referrerFK->isDeleted()) {
  1662. $affectedRows += $referrerFK->save($con);
  1663. }
  1664. }
  1665. }
  1666. if ($this->collKataoSupplierInvoiceOrders !== null) {
  1667. foreach($this->collKataoSupplierInvoiceOrders as $referrerFK) {
  1668. if (!$referrerFK->isDeleted()) {
  1669. $affectedRows += $referrerFK->save($con);
  1670. }
  1671. }
  1672. }
  1673. $this->alreadyInSave = false;
  1674. }
  1675. return $affectedRows;
  1676. } // doSave()
  1677. /**
  1678. * Array of ValidationFailed objects.
  1679. * @var array ValidationFailed[]
  1680. */
  1681. protected $validationFailures = array();
  1682. /**
  1683. * Gets any ValidationFailed objects that resulted from last call to validate().
  1684. *
  1685. *
  1686. * @return array ValidationFailed[]
  1687. * @see validate()
  1688. */
  1689. public function getValidationFailures()
  1690. {
  1691. return $this->validationFailures;
  1692. }
  1693. /**
  1694. * Validates the objects modified field values and all objects related to this table.
  1695. *
  1696. * If $columns is either a column name or an array of column names
  1697. * only those columns are validated.
  1698. *
  1699. * @param mixed $columns Column name or an array of column names.
  1700. * @return boolean Whether all columns pass validation.
  1701. * @see doValidate()
  1702. * @see getValidationFailures()
  1703. */
  1704. public function validate($columns = null)
  1705. {
  1706. $res = $this->doValidate($columns);
  1707. if ($res === true) {
  1708. $this->validationFailures = array();
  1709. return true;
  1710. } else {
  1711. $this->validationFailures = $res;
  1712. return false;
  1713. }
  1714. }
  1715. /**
  1716. * This function performs the validation work for complex object models.
  1717. *
  1718. * In addition to checking the current object, all related objects will
  1719. * also be validated. If all pass then <code>true</code> is returned; otherwise
  1720. * an aggreagated array of ValidationFailed objects will be returned.
  1721. *
  1722. * @param array $columns Array of column names to validate.
  1723. * @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
  1724. */
  1725. protected function doValidate($columns = null)
  1726. {
  1727. if (!$this->alreadyInValidation) {
  1728. $this->alreadyInValidation = true;
  1729. $retval = null;
  1730. $failureMap = array();
  1731. // We call the validate method on the following object(s) if they
  1732. // were passed to this object by their coresponding set
  1733. // method. This object relates to these object(s) by a
  1734. // foreign key reference.
  1735. if ($this->aKataoSupplier !== null) {
  1736. if (!$this->aKataoSupplier->validate($columns)) {
  1737. $failureMap = array_merge($failureMap, $this->aKataoSupplier->getValidationFailures());
  1738. }
  1739. }
  1740. if ($this->aKataoPeriod !== null) {
  1741. if (!$this->aKataoPeriod->validate($columns)) {
  1742. $failureMap = array_merge($failureMap, $this->aKataoPeriod->getValidationFailures());
  1743. }
  1744. }
  1745. if (($retval = KataoSupplierInvoicePeer::doValidate($this, $columns)) !== true) {
  1746. $failureMap = array_merge($failureMap, $retval);
  1747. }
  1748. if ($this->collKataoSupplierInvoiceProducts !== null) {
  1749. foreach($this->collKataoSupplierInvoiceProducts as $referrerFK) {
  1750. if (!$referrerFK->validate($columns)) {
  1751. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  1752. }
  1753. }
  1754. }
  1755. if ($this->collKataoSupplierInvoiceOrders !== null) {
  1756. foreach($this->collKataoSupplierInvoiceOrders as $referrerFK) {
  1757. if (!$referrerFK->validate($columns)) {
  1758. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  1759. }
  1760. }
  1761. }
  1762. $this->alreadyInValidation = false;
  1763. }
  1764. return (!empty($failureMap) ? $failureMap : true);
  1765. }
  1766. /**
  1767. * Retrieves a field from the object by name passed in as a string.
  1768. *
  1769. * @param string $name name
  1770. * @param string $type The type of fieldname the $name is of:
  1771. * one of the class type constants TYPE_PHPNAME,
  1772. * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
  1773. * @return mixed Value of field.
  1774. */
  1775. public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
  1776. {
  1777. $pos = KataoSupplierInvoicePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  1778. return $this->getByPosition($pos);
  1779. }
  1780. /**
  1781. * Retrieves a field from the object by Position as specified in the xml schema.
  1782. * Zero-based.
  1783. *
  1784. * @param int $pos position in xml schema
  1785. * @return mixed Value of field at $pos
  1786. */
  1787. public function getByPosition($pos)
  1788. {
  1789. switch($pos) {
  1790. case 0:
  1791. return $this->getId();
  1792. break;
  1793. case 1:
  1794. return $this->getKataoSupplierId();
  1795. break;
  1796. case 2:
  1797. return $this->getKataoPeriodId();
  1798. break;
  1799. case 3:
  1800. return $this->getStatus();
  1801. break;
  1802. case 4:
  1803. return $this->getSupplierName();
  1804. break;
  1805. case 5:
  1806. return $this->getSupplierEmail();
  1807. break;
  1808. case 6:
  1809. return $this->getSupplierAddress1();
  1810. break;
  1811. case 7:
  1812. return $this->getSupplierAddress2();
  1813. break;
  1814. case 8:
  1815. return $this->getSupplierZip();
  1816. break;
  1817. case 9:
  1818. return $this->getSupplierCity();
  1819. break;
  1820. case 10:
  1821. return $this->getKataoName();
  1822. break;
  1823. case 11:
  1824. return $this->getKataoAddress();
  1825. break;
  1826. case 12:
  1827. return $this->getKataoSiretNumber();
  1828. break;
  1829. case 13:
  1830. return $this->getKataoRcsNumber();
  1831. break;
  1832. case 14:
  1833. return $this->getKataoCapital();
  1834. break;
  1835. case 15:
  1836. return $this->getReference();
  1837. break;
  1838. case 16:
  1839. return $this->getInvoiceDate();
  1840. break;
  1841. case 17:
  1842. return $this->getDueDate();
  1843. break;
  1844. case 18:
  1845. return $this->getPaymentDate();
  1846. break;
  1847. case 19:
  1848. return $this->getPaymentMode();
  1849. break;
  1850. case 20:
  1851. return $this->getPaymentDetails();
  1852. break;
  1853. case 21:
  1854. return $this->getPaymentAmountEuro();
  1855. break;
  1856. case 22:
  1857. return $this->getPaymentAmountSol();
  1858. break;
  1859. case 23:
  1860. return $this->getTaux0BasesHt();
  1861. break;
  1862. case 24:
  1863. return $this->getTaux0DiscountHt();
  1864. break;
  1865. case 25:
  1866. return $this->getTaux0Amount();
  1867. break;
  1868. case 26:
  1869. return $this->getTaux1BasesHt();
  1870. break;
  1871. case 27:
  1872. return $this->getTaux1DiscountHt();
  1873. break;
  1874. case 28:
  1875. return $this->getTaux1Amount();
  1876. break;
  1877. case 29:
  1878. return $this->getTaux2BasesHt();
  1879. break;
  1880. case 30:
  1881. return $this->getTaux2DiscountHt();
  1882. break;
  1883. case 31:
  1884. return $this->getTaux2Amount();
  1885. break;
  1886. case 32:
  1887. return $this->getTotalHt();
  1888. break;
  1889. case 33:
  1890. return $this->getTotalTva();
  1891. break;
  1892. case 34:
  1893. return $this->getComment();
  1894. break;
  1895. case 35:
  1896. return $this->getFeesShippingHt();
  1897. break;
  1898. case 36:
  1899. return $this->getFeesShippingRate();
  1900. break;
  1901. case 37:
  1902. return $this->getFeesShippingTva();
  1903. break;
  1904. case 38:
  1905. return $this->getFeesBillingHt();
  1906. break;
  1907. case 39:
  1908. return $this->getFeesBillingRate();
  1909. break;
  1910. case 40:
  1911. return $this->getFeesBillingTva();
  1912. break;
  1913. case 41:
  1914. return $this->getCreatedAt();
  1915. break;
  1916. case 42:
  1917. return $this->getUpdatedAt();
  1918. break;
  1919. default:
  1920. return null;
  1921. break;
  1922. } // switch()
  1923. }
  1924. /**
  1925. * Exports the object as an array.
  1926. *
  1927. * You can specify the key type of the array by passing one of the class
  1928. * type constants.
  1929. *
  1930. * @param string $keyType One of the class type constants TYPE_PHPNAME,
  1931. * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
  1932. * @return an associative array containing the field names (as keys) and field values
  1933. */
  1934. public function toArray($keyType = BasePeer::TYPE_PHPNAME)
  1935. {
  1936. $keys = KataoSupplierInvoicePeer::getFieldNames($keyType);
  1937. $result = array(
  1938. $keys[0] => $this->getId(),
  1939. $keys[1] => $this->getKataoSupplierId(),
  1940. $keys[2] => $this->getKataoPeriodId(),
  1941. $keys[3] => $this->getStatus(),
  1942. $keys[4] => $this->getSupplierName(),
  1943. $keys[5] => $this->getSupplierEmail(),
  1944. $keys[6] => $this->getSupplierAddress1(),
  1945. $keys[7] => $this->getSupplierAddress2(),
  1946. $keys[8] => $this->getSupplierZip(),
  1947. $keys[9] => $this->getSupplierCity(),
  1948. $keys[10] => $this->getKataoName(),
  1949. $keys[11] => $this->getKataoAddress(),
  1950. $keys[12] => $this->getKataoSiretNumber(),
  1951. $keys[13] => $this->getKataoRcsNumber(),
  1952. $keys[14] => $this->getKataoCapital(),
  1953. $keys[15] => $this->getReference(),
  1954. $keys[16] => $this->getInvoiceDate(),
  1955. $keys[17] => $this->getDueDate(),
  1956. $keys[18] => $this->getPaymentDate(),
  1957. $keys[19] => $this->getPaymentMode(),
  1958. $keys[20] => $this->getPaymentDetails(),
  1959. $keys[21] => $this->getPaymentAmountEuro(),
  1960. $keys[22] => $this->getPaymentAmountSol(),
  1961. $keys[23] => $this->getTaux0BasesHt(),
  1962. $keys[24] => $this->getTaux0DiscountHt(),
  1963. $keys[25] => $this->getTaux0Amount(),
  1964. $keys[26] => $this->getTaux1BasesHt(),
  1965. $keys[27] => $this->getTaux1DiscountHt(),
  1966. $keys[28] => $this->getTaux1Amount(),
  1967. $keys[29] => $this->getTaux2BasesHt(),
  1968. $keys[30] => $this->getTaux2DiscountHt(),
  1969. $keys[31] => $this->getTaux2Amount(),
  1970. $keys[32] => $this->getTotalHt(),
  1971. $keys[33] => $this->getTotalTva(),
  1972. $keys[34] => $this->getComment(),
  1973. $keys[35] => $this->getFeesShippingHt(),
  1974. $keys[36] => $this->getFeesShippingRate(),
  1975. $keys[37] => $this->getFeesShippingTva(),
  1976. $keys[38] => $this->getFeesBillingHt(),
  1977. $keys[39] => $this->getFeesBillingRate(),
  1978. $keys[40] => $this->getFeesBillingTva(),
  1979. $keys[41] => $this->getCreatedAt(),
  1980. $keys[42] => $this->getUpdatedAt(),
  1981. );
  1982. return $result;
  1983. }
  1984. /**
  1985. * Sets a field from the object by name passed in as a string.
  1986. *
  1987. * @param string $name peer name
  1988. * @param mixed $value field value
  1989. * @param string $type The type of fieldname the $name is of:
  1990. * one of the class type constants TYPE_PHPNAME,
  1991. * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
  1992. * @return void
  1993. */
  1994. public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
  1995. {
  1996. $pos = KataoSupplierInvoicePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  1997. return $this->setByPosition($pos, $value);
  1998. }
  1999. /**
  2000. * Sets a field from the object by Position as specified in the xml schema.
  2001. * Zero-based.
  2002. *
  2003. * @param int $pos position in xml schema
  2004. * @param mixed $value field value
  2005. * @return void
  2006. */
  2007. public function setByPosition($pos, $value)
  2008. {
  2009. switch($pos) {
  2010. case 0:
  2011. $this->setId($value);
  2012. break;
  2013. case 1:
  2014. $this->setKataoSupplierId($value);
  2015. break;
  2016. case 2:
  2017. $this->setKataoPeriodId($value);
  2018. break;
  2019. case 3:
  2020. $this->setStatus($value);
  2021. break;
  2022. case 4:
  2023. $this->setSupplierName($value);
  2024. break;
  2025. case 5:
  2026. $this->setSupplierEmail($value);
  2027. break;
  2028. case 6:
  2029. $this->setSupplierAddress1($value);
  2030. break;
  2031. case 7:
  2032. $this->setSupplierAddress2($value);
  2033. break;
  2034. case 8:
  2035. $this->setSupplierZip($value);
  2036. break;
  2037. case 9:
  2038. $this->setSupplierCity($value);
  2039. break;
  2040. case 10:
  2041. $this->setKataoName($value);
  2042. break;
  2043. case 11:
  2044. $this->setKataoAddress($value);
  2045. break;
  2046. case 12:
  2047. $this->setKataoSiretNumber($value);
  2048. break;
  2049. case 13:
  2050. $this->setKataoRcsNumber($value);
  2051. break;
  2052. case 14:
  2053. $this->setKataoCapital($value);
  2054. break;
  2055. case 15:
  2056. $this->setReference($value);
  2057. break;
  2058. case 16:
  2059. $this->setInvoiceDate($value);
  2060. break;
  2061. case 17:
  2062. $this->setDueDate($value);
  2063. break;
  2064. case 18:
  2065. $this->setPaymentDate($value);
  2066. break;
  2067. case 19:
  2068. $this->setPaymentMode($value);
  2069. break;
  2070. case 20:
  2071. $this->setPaymentDetails($value);
  2072. break;
  2073. case 21:
  2074. $this->setPaymentAmountEuro($value);
  2075. break;
  2076. case 22:
  2077. $this->setPaymentAmountSol($value);
  2078. break;
  2079. case 23:
  2080. $this->setTaux0BasesHt($value);
  2081. break;
  2082. case 24:
  2083. $this->setTaux0DiscountHt($value);
  2084. break;
  2085. case 25:
  2086. $this->setTaux0Amount($value);
  2087. break;
  2088. case 26:
  2089. $this->setTaux1BasesHt($value);
  2090. break;
  2091. case 27:
  2092. $this->setTaux1DiscountHt($value);
  2093. break;
  2094. case 28:
  2095. $this->setTaux1Amount($value);
  2096. break;
  2097. case 29:
  2098. $this->setTaux2BasesHt($value);
  2099. break;
  2100. case 30:
  2101. $this->setTaux2DiscountHt($value);
  2102. break;
  2103. case 31:
  2104. $this->setTaux2Amount($value);
  2105. break;
  2106. case 32:
  2107. $this->setTotalHt($value);
  2108. break;
  2109. case 33:
  2110. $this->setTotalTva($value);
  2111. break;
  2112. case 34:
  2113. $this->setComment($value);
  2114. break;
  2115. case 35:
  2116. $this->setFeesShippingHt($value);
  2117. break;
  2118. case 36:
  2119. $this->setFeesShippingRate($value);
  2120. break;
  2121. case 37:
  2122. $this->setFeesShippingTva($value);
  2123. break;
  2124. case 38:
  2125. $this->setFeesBillingHt($value);
  2126. break;
  2127. case 39:
  2128. $this->setFeesBillingRate($value);
  2129. break;
  2130. case 40:
  2131. $this->setFeesBillingTva($value);
  2132. break;
  2133. case 41:
  2134. $this->setCreatedAt($value);
  2135. break;
  2136. case 42:
  2137. $this->setUpdatedAt($value);
  2138. break;
  2139. } // switch()
  2140. }
  2141. /**
  2142. * Populates the object using an array.
  2143. *
  2144. * This is particularly useful when populating an object from one of the
  2145. * request arrays (e.g. $_POST). This method goes through the column
  2146. * names, checking to see whether a matching key exists in populated
  2147. * array. If so the setByName() method is called for that column.
  2148. *
  2149. * You can specify the key type of the array by additionally passing one
  2150. * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
  2151. * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
  2152. *
  2153. * @param array $arr An array to populate the object from.
  2154. * @param string $keyType The type of keys the array uses.
  2155. * @return void
  2156. */
  2157. public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
  2158. {
  2159. $keys = KataoSupplierInvoicePeer::getFieldNames($keyType);
  2160. if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
  2161. if (array_key_exists($keys[1], $arr)) $this->setKataoSupplierId($arr[$keys[1]]);
  2162. if (array_key_exists($keys[2], $arr)) $this->setKataoPeriodId($arr[$keys[2]]);
  2163. if (array_key_exists($keys[3], $arr)) $this->setStatus($arr[$keys[3]]);
  2164. if (array_key_exists($keys[4], $arr)) $this->setSupplierName($arr[$keys[4]]);
  2165. if (array_key_exists($keys[5], $arr)) $this->setSupplierEmail($arr[$keys[5]]);
  2166. if (array_key_exists($keys[6], $arr)) $this->setSupplierAddress1($arr[$keys[6]]);
  2167. if (array_key_exists($keys[7], $arr)) $this->setSupplierAddress2($arr[$keys[7]]);
  2168. if (array_key_exists($keys[8], $arr)) $this->setSupplierZip($arr[$keys[8]]);
  2169. if (array_key_exists($keys[9], $arr)) $this->setSupplierCity($arr[$keys[9]]);
  2170. if (array_key_exists($keys[10], $arr)) $this->setKataoName($arr[$keys[10]]);
  2171. if (array_key_exists($keys[11], $arr)) $this->setKataoAddress($arr[$keys[11]]);
  2172. if (array_key_exists($keys[12], $arr)) $this->setKataoSiretNumber($arr[$keys[12]]);
  2173. if (array_key_exists($keys[13], $arr)) $this->setKataoRcsNumber($arr[$keys[13]]);
  2174. if (array_key_exists($keys[14], $arr)) $this->setKataoCapital($arr[$keys[14]]);
  2175. if (array_key_exists($keys[15], $arr)) $this->setReference($arr[$keys[15]]);
  2176. if (array_key_exists($keys[16], $arr)) $this->setInvoiceDate($arr[$keys[16]]);
  2177. if (array_key_exists($keys[17], $arr)) $this->setDueDate($arr[$keys[17]]);
  2178. if (array_key_exists($keys[18], $arr)) $this->setPaymentDate($arr[$keys[18]]);
  2179. if (array_key_exists($keys[19], $arr)) $this->setPaymentMode($arr[$keys[19]]);
  2180. if (array_key_exists($keys[20], $arr)) $this->setPaymentDetails($arr[$keys[20]]);
  2181. if (array_key_exists($keys[21], $arr)) $this->setPaymentAmountEuro($arr[$keys[21]]);
  2182. if (array_key_exists($keys[22], $arr)) $this->setPaymentAmountSol($arr[$keys[22]]);
  2183. if (array_key_exists($keys[23], $arr)) $this->setTaux0BasesHt($arr[$keys[23]]);
  2184. if (array_key_exists($keys[24], $arr)) $this->setTaux0DiscountHt($arr[$keys[24]]);
  2185. if (array_key_exists($keys[25], $arr)) $this->setTaux0Amount($arr[$keys[25]]);
  2186. if (array_key_exists($keys[26], $arr)) $this->setTaux1BasesHt($arr[$keys[26]]);
  2187. if (array_key_exists($keys[27], $arr)) $this->setTaux1DiscountHt($arr[$keys[27]]);
  2188. if (array_key_exists($keys[28], $arr)) $this->setTaux1Amount($arr[$keys[28]]);
  2189. if (array_key_exists($keys[29], $arr)) $this->setTaux2BasesHt($arr[$keys[29]]);
  2190. if (array_key_exists($keys[30], $arr)) $this->setTaux2DiscountHt($arr[$keys[30]]);
  2191. if (array_key_exists($keys[31], $arr)) $this->setTaux2Amount($arr[$keys[31]]);
  2192. if (array_key_exists($keys[32], $arr)) $this->setTotalHt($arr[$keys[32]]);
  2193. if (array_key_exists($keys[33], $arr)) $this->setTotalTva($arr[$keys[33]]);
  2194. if (array_key_exists($keys[34], $arr)) $this->setComment($arr[$keys[34]]);
  2195. if (array_key_exists($keys[35], $arr)) $this->setFeesShippingHt($arr[$keys[35]]);
  2196. if (array_key_exists($keys[36], $arr)) $this->setFeesShippingRate($arr[$keys[36]]);
  2197. if (array_key_exists($keys[37], $arr)) $this->setFeesShippingTva($arr[$keys[37]]);
  2198. if (array_key_exists($keys[38], $arr)) $this->setFeesBillingHt($arr[$keys[38]]);
  2199. if (array_key_exists($keys[39], $arr)) $this->setFeesBillingRate($arr[$keys[39]]);
  2200. if (array_key_exists($keys[40], $arr)) $this->setFeesBillingTva($arr[$keys[40]]);
  2201. if (array_key_exists($keys[41], $arr)) $this->setCreatedAt($arr[$keys[41]]);
  2202. if (array_key_exists($keys[42], $arr)) $this->setUpdatedAt($arr[$keys[42]]);
  2203. }
  2204. /**
  2205. * Build a Criteria object containing the values of all modified columns in this object.
  2206. *
  2207. * @return Criteria The Criteria object containing all modified values.
  2208. */
  2209. public function buildCriteria()
  2210. {
  2211. $criteria = new Criteria(KataoSupplierInvoicePeer::DATABASE_NAME);
  2212. if ($this->isColumnModified(KataoSupplierInvoicePeer::ID)) $criteria->add(KataoSupplierInvoicePeer::ID, $this->id);
  2213. if ($this->isColumnModified(KataoSupplierInvoicePeer::KATAO_SUPPLIER_ID)) $criteria->add(KataoSupplierInvoicePeer::KATAO_SUPPLIER_ID, $this->katao_supplier_id);
  2214. if ($this->isColumnModified(KataoSupplierInvoicePeer::KATAO_PERIOD_ID)) $criteria->add(KataoSupplierInvoicePeer::KATAO_PERIOD_ID, $this->katao_period_id);
  2215. if ($this->isColumnModified(KataoSupplierInvoicePeer::STATUS)) $criteria->add(KataoSupplierInvoicePeer::STATUS, $this->status);
  2216. if ($this->isColumnModified(KataoSupplierInvoicePeer::SUPPLIER_NAME)) $criteria->add(KataoSupplierInvoicePeer::SUPPLIER_NAME, $this->supplier_name);
  2217. if ($this->isColumnModified(KataoSupplierInvoicePeer::SUPPLIER_EMAIL)) $criteria->add(KataoSupplierInvoicePeer::SUPPLIER_EMAIL, $this->supplier_email);
  2218. if ($this->isColumnModified(KataoSupplierInvoicePeer::SUPPLIER_ADDRESS1)) $criteria->add(KataoSupplierInvoicePeer::SUPPLIER_ADDRESS1, $this->supplier_address1);
  2219. if ($this->isColumnModified(KataoSupplierInvoicePeer::SUPPLIER_ADDRESS2)) $criteria->add(KataoSupplierInvoicePeer::SUPPLIER_ADDRESS2, $this->supplier_address2);
  2220. if ($this->isColumnModified(KataoSupplierInvoicePeer::SUPPLIER_ZIP)) $criteria->add(KataoSupplierInvoicePeer::SUPPLIER_ZIP, $this->supplier_zip);
  2221. if ($this->isColumnModified(KataoSupplierInvoicePeer::SUPPLIER_CITY)) $criteria->add(KataoSupplierInvoicePeer::SUPPLIER_CITY, $this->supplier_city);
  2222. if ($this->isColumnModified(KataoSupplierInvoicePeer::KATAO_NAME)) $criteria->add(KataoSupplierInvoicePeer::KATAO_NAME, $this->katao_name);
  2223. if ($this->isColumnModified(KataoSupplierInvoicePeer::KATAO_ADDRESS)) $criteria->add(KataoSupplierInvoicePeer::KATAO_ADDRESS, $this->katao_address);
  2224. if ($this->isColumnModified(KataoSupplierInvoicePeer::KATAO_SIRET_NUMBER)) $criteria->add(KataoSupplierInvoicePeer::KATAO_SIRET_NUMBER, $this->katao_siret_number);
  2225. if ($this->isColumnModified(KataoSupplierInvoicePeer::KATAO_RCS_NUMBER)) $criteria->add(KataoSupplierInvoicePeer::KATAO_RCS_NUMBER, $this->katao_rcs_number);
  2226. if ($this->isColumnModified(KataoSupplierInvoicePeer::KATAO_CAPITAL)) $criteria->add(KataoSupplierInvoicePeer::KATAO_CAPITAL, $this->katao_capital);
  2227. if ($this->isColumnModified(KataoSupplierInvoicePeer::REFERENCE)) $criteria->add(KataoSupplierInvoicePeer::REFERENCE, $this->reference);
  2228. if ($this->isColumnModified(KataoSupplierInvoicePeer::INVOICE_DATE)) $criteria->add(KataoSupplierInvoicePeer::INVOICE_DATE, $this->invoice_date);
  2229. if ($this->isColumnModified(KataoSupplierInvoicePeer::DUE_DATE)) $criteria->add(KataoSupplierInvoicePeer::DUE_DATE, $this->due_date);
  2230. if ($this->isColumnModified(KataoSupplierInvoicePeer::PAYMENT_DATE)) $criteria->add(KataoSupplierInvoicePeer::PAYMENT_DATE, $this->payment_date);
  2231. if ($this->isColumnModified(KataoSupplierInvoicePeer::PAYMENT_MODE)) $criteria->add(KataoSupplierInvoicePeer::PAYMENT_MODE, $this->payment_mode);
  2232. if ($this->isColumnModified(KataoSupplierInvoicePeer::PAYMENT_DETAILS)) $criteria->add(KataoSupplierInvoicePeer::PAYMENT_DETAILS, $this->payment_details);
  2233. if ($this->isColumnModified(KataoSupplierInvoicePeer::PAYMENT_AMOUNT_EURO)) $criteria->add(KataoSupplierInvoicePeer::PAYMENT_AMOUNT_EURO, $this->payment_amount_euro);
  2234. if ($this->isColumnModified(KataoSupplierInvoicePeer::PAYMENT_AMOUNT_SOL)) $criteria->add(KataoSupplierInvoicePeer::PAYMENT_AMOUNT_SOL, $this->payment_amount_sol);
  2235. if ($this->isColumnModified(KataoSupplierInvoicePeer::TAUX0_BASES_HT)) $criteria->add(KataoSupplierInvoicePeer::TAUX0_BASES_HT, $this->taux0_bases_ht);
  2236. if ($this->isColumnModified(KataoSupplierInvoicePeer::TAUX0_DISCOUNT_HT)) $criteria->add(KataoSupplierInvoicePeer::TAUX0_DISCOUNT_HT, $this->taux0_discount_ht);
  2237. if ($this->isColumnModified(KataoSupplierInvoicePeer::TAUX0_AMOUNT)) $criteria->add(KataoSupplierInvoicePeer::TAUX0_AMOUNT, $this->taux0_amount);
  2238. if ($this->isColumnModified(KataoSupplierInvoicePeer::TAUX1_BASES_HT)) $criteria->add(KataoSupplierInvoicePeer::TAUX1_BASES_HT, $this->taux1_bases_ht);
  2239. if ($this->isColumnModified(KataoSupplierInvoicePeer::TAUX1_DISCOUNT_HT)) $criteria->add(KataoSupplierInvoicePeer::TAUX1_DISCOUNT_HT, $this->taux1_discount_ht);
  2240. if ($this->isColumnModified(KataoSupplierInvoicePeer::TAUX1_AMOUNT)) $criteria->add(KataoSupplierInvoicePeer::TAUX1_AMOUNT, $this->taux1_amount);
  2241. if ($this->isColumnModified(KataoSupplierInvoicePeer::TAUX2_BASES_HT)) $criteria->add(KataoSupplierInvoicePeer::TAUX2_BASES_HT, $this->taux2_bases_ht);
  2242. if ($this->isColumnModified(KataoSupplierInvoicePeer::TAUX2_DISCOUNT_HT)) $criteria->add(KataoSupplierInvoicePeer::TAUX2_DISCOUNT_HT, $this->taux2_discount_ht);
  2243. if ($this->isColumnModified(KataoSupplierInvoicePeer::TAUX2_AMOUNT)) $criteria->add(KataoSupplierInvoicePeer::TAUX2_AMOUNT, $this->taux2_amount);
  2244. if ($this->isColumnModified(KataoSupplierInvoicePeer::TOTAL_HT)) $criteria->add(KataoSupplierInvoicePeer::TOTAL_HT, $this->total_ht);
  2245. if ($this->isColumnModified(KataoSupplierInvoicePeer::TOTAL_TVA)) $criteria->add(KataoSupplierInvoicePeer::TOTAL_TVA, $this->total_tva);
  2246. if ($this->isColumnModified(KataoSupplierInvoicePeer::COMMENT)) $criteria->add(KataoSupplierInvoicePeer::COMMENT, $this->comment);
  2247. if ($this->isColumnModified(KataoSupplierInvoicePeer::FEES_SHIPPING_HT)) $criteria->add(KataoSupplierInvoicePeer::FEES_SHIPPING_HT, $this->fees_shipping_ht);
  2248. if ($this->isColumnModified(KataoSupplierInvoicePeer::FEES_SHIPPING_RATE)) $criteria->add(KataoSupplierInvoicePeer::FEES_SHIPPING_RATE, $this->fees_shipping_rate);
  2249. if ($this->isColumnModified(KataoSupplierInvoicePeer::FEES_SHIPPING_TVA)) $criteria->add(KataoSupplierInvoicePeer::FEES_SHIPPING_TVA, $this->fees_shipping_tva);
  2250. if ($this->isColumnModified(KataoSupplierInvoicePeer::FEES_BILLING_HT)) $criteria->add(KataoSupplierInvoicePeer::FEES_BILLING_HT, $this->fees_billing_ht);
  2251. if ($this->isColumnModified(KataoSupplierInvoicePeer::FEES_BILLING_RATE)) $criteria->add(KataoSupplierInvoicePeer::FEES_BILLING_RATE, $this->fees_billing_rate);
  2252. if ($this->isColumnModified(KataoSupplierInvoicePeer::FEES_BILLING_TVA)) $criteria->add(KataoSupplierInvoicePeer::FEES_BILLING_TVA, $this->fees_billing_tva);
  2253. if ($this->isColumnModified(KataoSupplierInvoicePeer::CREATED_AT)) $criteria->add(KataoSupplierInvoicePeer::CREATED_AT, $this->created_at);
  2254. if ($this->isColumnModified(KataoSupplierInvoicePeer::UPDATED_AT)) $criteria->add(KataoSupplierInvoicePeer::UPDATED_AT, $this->updated_at);
  2255. return $criteria;
  2256. }
  2257. /**
  2258. * Builds a Criteria object containing the primary key for this object.
  2259. *
  2260. * Unlike buildCriteria() this method includes the primary key values regardless
  2261. * of whether or not they have been modified.
  2262. *
  2263. * @return Criteria The Criteria object containing value(s) for primary key(s).
  2264. */
  2265. public function buildPkeyCriteria()
  2266. {
  2267. $criteria = new Criteria(KataoSupplierInvoicePeer::DATABASE_NAME);
  2268. $criteria->add(KataoSupplierInvoicePeer::ID, $this->id);
  2269. return $criteria;
  2270. }
  2271. /**
  2272. * Returns the primary key for this object (row).
  2273. * @return int
  2274. */
  2275. public function getPrimaryKey()
  2276. {
  2277. return $this->getId();
  2278. }
  2279. /**
  2280. * Generic method to set the primary key (id column).
  2281. *
  2282. * @param int $key Primary key.
  2283. * @return void
  2284. */
  2285. public function setPrimaryKey($key)
  2286. {
  2287. $this->setId($key);
  2288. }
  2289. /**
  2290. * Sets contents of passed object to values from current object.
  2291. *
  2292. * If desired, this method can also make copies of all associated (fkey referrers)
  2293. * objects.
  2294. *
  2295. * @param object $copyObj An object of KataoSupplierInvoice (or compatible) type.
  2296. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  2297. * @throws PropelException
  2298. */
  2299. public function copyInto($copyObj, $deepCopy = false)
  2300. {
  2301. $copyObj->setKataoSupplierId($this->katao_supplier_id);
  2302. $copyObj->setKataoPeriodId($this->katao_period_id);
  2303. $copyObj->setStatus($this->status);
  2304. $copyObj->setSupplierName($this->supplier_name);
  2305. $copyObj->setSupplierEmail($this->supplier_email);
  2306. $copyObj->setSupplierAddress1($this->supplier_address1);
  2307. $copyObj->setSupplierAddress2($this->supplier_address2);
  2308. $copyObj->setSupplierZip($this->supplier_zip);
  2309. $copyObj->setSupplierCity($this->supplier_city);
  2310. $copyObj->setKataoName($this->katao_name);
  2311. $copyObj->setKataoAddress($this->katao_address);
  2312. $copyObj->setKataoSiretNumber($this->katao_siret_number);
  2313. $copyObj->setKataoRcsNumber($this->katao_rcs_number);
  2314. $copyObj->setKataoCapital($this->katao_capital);
  2315. $copyObj->setReference($this->reference);
  2316. $copyObj->setInvoiceDate($this->invoice_date);
  2317. $copyObj->setDueDate($this->due_date);
  2318. $copyObj->setPaymentDate($this->payment_date);
  2319. $copyObj->setPaymentMode($this->payment_mode);
  2320. $copyObj->setPaymentDetails($this->payment_details);
  2321. $copyObj->setPaymentAmountEuro($this->payment_amount_euro);
  2322. $copyObj->setPaymentAmountSol($this->payment_amount_sol);
  2323. $copyObj->setTaux0BasesHt($this->taux0_bases_ht);
  2324. $copyObj->setTaux0DiscountHt($this->taux0_discount_ht);
  2325. $copyObj->setTaux0Amount($this->taux0_amount);
  2326. $copyObj->setTaux1BasesHt($this->taux1_bases_ht);
  2327. $copyObj->setTaux1DiscountHt($this->taux1_discount_ht);
  2328. $copyObj->setTaux1Amount($this->taux1_amount);
  2329. $copyObj->setTaux2BasesHt($this->taux2_bases_ht);
  2330. $copyObj->setTaux2DiscountHt($this->taux2_discount_ht);
  2331. $copyObj->setTaux2Amount($this->taux2_amount);
  2332. $copyObj->setTotalHt($this->total_ht);
  2333. $copyObj->setTotalTva($this->total_tva);
  2334. $copyObj->setComment($this->comment);
  2335. $copyObj->setFeesShippingHt($this->fees_shipping_ht);
  2336. $copyObj->setFeesShippingRate($this->fees_shipping_rate);
  2337. $copyObj->setFeesShippingTva($this->fees_shipping_tva);
  2338. $copyObj->setFeesBillingHt($this->fees_billing_ht);
  2339. $copyObj->setFeesBillingRate($this->fees_billing_rate);
  2340. $copyObj->setFeesBillingTva($this->fees_billing_tva);
  2341. $copyObj->setCreatedAt($this->created_at);
  2342. $copyObj->setUpdatedAt($this->updated_at);
  2343. if ($deepCopy) {
  2344. // important: temporarily setNew(false) because this affects the behavior of
  2345. // the getter/setter methods for fkey referrer objects.
  2346. $copyObj->setNew(false);
  2347. foreach($this->getKataoSupplierInvoiceProducts() as $relObj) {
  2348. $copyObj->addKataoSupplierInvoiceProduct($relObj->copy($deepCopy));
  2349. }
  2350. foreach($this->getKataoSupplierInvoiceOrders() as $relObj) {
  2351. $copyObj->addKataoSupplierInvoiceOrder($relObj->copy($deepCopy));
  2352. }
  2353. } // if ($deepCopy)
  2354. $copyObj->setNew(true);
  2355. $copyObj->setId(NULL); // this is a pkey column, so set to default value
  2356. }
  2357. /**
  2358. * Makes a copy of this object that will be inserted as a new row in table when saved.
  2359. * It creates a new object filling in the simple attributes, but skipping any primary
  2360. * keys that are defined for the table.
  2361. *
  2362. * If desired, this method can also make copies of all associated (fkey referrers)
  2363. * objects.
  2364. *
  2365. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  2366. * @return KataoSupplierInvoice Clone of current object.
  2367. * @throws PropelException
  2368. */
  2369. public function copy($deepCopy = false)
  2370. {
  2371. // we use get_class(), because this might be a subclass
  2372. $clazz = get_class($this);
  2373. $copyObj = new $clazz();
  2374. $this->copyInto($copyObj, $deepCopy);
  2375. return $copyObj;
  2376. }
  2377. /**
  2378. * Returns a peer instance associated with this om.
  2379. *
  2380. * Since Peer classes are not to have any instance attributes, this method returns the
  2381. * same instance for all member of this class. The method could therefore
  2382. * be static, but this would prevent one from overriding the behavior.
  2383. *
  2384. * @return KataoSupplierInvoicePeer
  2385. */
  2386. public function getPeer()
  2387. {
  2388. if (self::$peer === null) {
  2389. self::$peer = new KataoSupplierInvoicePeer();
  2390. }
  2391. return self::$peer;
  2392. }
  2393. /**
  2394. * Declares an association between this object and a KataoSupplier object.
  2395. *
  2396. * @param KataoSupplier $v
  2397. * @return void
  2398. * @throws PropelException
  2399. */
  2400. public function setKataoSupplier($v)
  2401. {
  2402. if ($v === null) {
  2403. $this->setKataoSupplierId(NULL);
  2404. } else {
  2405. $this->setKataoSupplierId($v->getId());
  2406. }
  2407. $this->aKataoSupplier = $v;
  2408. }
  2409. /**
  2410. * Get the associated KataoSupplier object
  2411. *
  2412. * @param Connection Optional Connection object.
  2413. * @return KataoSupplier The associated KataoSupplier object.
  2414. * @throws PropelException
  2415. */
  2416. public function getKataoSupplier($con = null)
  2417. {
  2418. if ($this->aKataoSupplier === null && ($this->katao_supplier_id !== null)) {
  2419. // include the related Peer class
  2420. $this->aKataoSupplier = KataoSupplierPeer::retrieveByPK($this->katao_supplier_id, $con);
  2421. /* The following can be used instead of the line above to
  2422. guarantee the related object contains a reference
  2423. to this object, but this level of coupling
  2424. may be undesirable in many circumstances.
  2425. As it can lead to a db query with many results that may
  2426. never be used.
  2427. $obj = KataoSupplierPeer::retrieveByPK($this->katao_supplier_id, $con);
  2428. $obj->addKataoSuppliers($this);
  2429. */
  2430. }
  2431. return $this->aKataoSupplier;
  2432. }
  2433. /**
  2434. * Declares an association between this object and a KataoPeriod object.
  2435. *
  2436. * @param KataoPeriod $v
  2437. * @return void
  2438. * @throws PropelException
  2439. */
  2440. public function setKataoPeriod($v)
  2441. {
  2442. if ($v === null) {
  2443. $this->setKataoPeriodId(NULL);
  2444. } else {
  2445. $this->setKataoPeriodId($v->getId());
  2446. }
  2447. $this->aKataoPeriod = $v;
  2448. }
  2449. /**
  2450. * Get the associated KataoPeriod object
  2451. *
  2452. * @param Connection Optional Connection object.
  2453. * @return KataoPeriod The associated KataoPeriod object.
  2454. * @throws PropelException
  2455. */
  2456. public function getKataoPeriod($con = null)
  2457. {
  2458. if ($this->aKataoPeriod === null && ($this->katao_period_id !== null)) {
  2459. // include the related Peer class
  2460. $this->aKataoPeriod = KataoPeriodPeer::retrieveByPK($this->katao_period_id, $con);
  2461. /* The following can be used instead of the line above to
  2462. guarantee the related object contains a reference
  2463. to this object, but this level of coupling
  2464. may be undesirable in many circumstances.
  2465. As it can lead to a db query with many results that may
  2466. never be used.
  2467. $obj = KataoPeriodPeer::retrieveByPK($this->katao_period_id, $con);
  2468. $obj->addKataoPeriods($this);
  2469. */
  2470. }
  2471. return $this->aKataoPeriod;
  2472. }
  2473. /**
  2474. * Temporary storage of collKataoSupplierInvoiceProducts to save a possible db hit in
  2475. * the event objects are add to the collection, but the
  2476. * complete collection is never requested.
  2477. * @return void
  2478. */
  2479. public function initKataoSupplierInvoiceProducts()
  2480. {
  2481. if ($this->collKataoSupplierInvoiceProducts === null) {
  2482. $this->collKataoSupplierInvoiceProducts = array();
  2483. }
  2484. }
  2485. /**
  2486. * If this collection has already been initialized with
  2487. * an identical criteria, it returns the collection.
  2488. * Otherwise if this KataoSupplierInvoice has previously
  2489. * been saved, it will retrieve related KataoSupplierInvoiceProducts from storage.
  2490. * If this KataoSupplierInvoice is new, it will return
  2491. * an empty collection or the current collection, the criteria
  2492. * is ignored on a new object.
  2493. *
  2494. * @param Connection $con
  2495. * @param Criteria $criteria
  2496. * @throws PropelException
  2497. */
  2498. public function getKataoSupplierInvoiceProducts($criteria = null, $con = null)
  2499. {
  2500. // include the Peer class
  2501. if ($criteria === null) {
  2502. $criteria = new Criteria();
  2503. }
  2504. elseif ($criteria instanceof Criteria)
  2505. {
  2506. $criteria = clone $criteria;
  2507. }
  2508. if ($this->collKataoSupplierInvoiceProducts === null) {
  2509. if ($this->isNew()) {
  2510. $this->collKataoSupplierInvoiceProducts = array();
  2511. } else {
  2512. $criteria->add(KataoSupplierInvoiceProductPeer::KATAO_SUPPLIER_INVOICE_ID, $this->getId());
  2513. KataoSupplierInvoiceProductPeer::addSelectColumns($criteria);
  2514. $this->collKataoSupplierInvoiceProducts = KataoSupplierInvoiceProductPeer::doSelect($criteria, $con);
  2515. }
  2516. } else {
  2517. // criteria has no effect for a new object
  2518. if (!$this->isNew()) {
  2519. // the following code is to determine if a new query is
  2520. // called for. If the criteria is the same as the last
  2521. // one, just return the collection.
  2522. $criteria->add(KataoSupplierInvoiceProductPeer::KATAO_SUPPLIER_INVOICE_ID, $this->getId());
  2523. KataoSupplierInvoiceProductPeer::addSelectColumns($criteria);
  2524. if (!isset($this->lastKataoSupplierInvoiceProductCriteria) || !$this->lastKataoSupplierInvoiceProductCriteria->equals($criteria)) {
  2525. $this->collKataoSupplierInvoiceProducts = KataoSupplierInvoiceProductPeer::doSelect($criteria, $con);
  2526. }
  2527. }
  2528. }
  2529. $this->lastKataoSupplierInvoiceProductCriteria = $criteria;
  2530. return $this->collKataoSupplierInvoiceProducts;
  2531. }
  2532. /**
  2533. * Returns the number of related KataoSupplierInvoiceProducts.
  2534. *
  2535. * @param Criteria $criteria
  2536. * @param boolean $distinct
  2537. * @param Connection $con
  2538. * @throws PropelException
  2539. */
  2540. public function countKataoSupplierInvoiceProducts($criteria = null, $distinct = false, $con = null)
  2541. {
  2542. // include the Peer class
  2543. if ($criteria === null) {
  2544. $criteria = new Criteria();
  2545. }
  2546. elseif ($criteria instanceof Criteria)
  2547. {
  2548. $criteria = clone $criteria;
  2549. }
  2550. $criteria->add(KataoSupplierInvoiceProductPeer::KATAO_SUPPLIER_INVOICE_ID, $this->getId());
  2551. return KataoSupplierInvoiceProductPeer::doCount($criteria, $distinct, $con);
  2552. }
  2553. /**
  2554. * Method called to associate a KataoSupplierInvoiceProduct object to this object
  2555. * through the KataoSupplierInvoiceProduct foreign key attribute
  2556. *
  2557. * @param KataoSupplierInvoiceProduct $l KataoSupplierInvoiceProduct
  2558. * @return void
  2559. * @throws PropelException
  2560. */
  2561. public function addKataoSupplierInvoiceProduct(KataoSupplierInvoiceProduct $l)
  2562. {
  2563. $this->collKataoSupplierInvoiceProducts[] = $l;
  2564. $l->setKataoSupplierInvoice($this);
  2565. }
  2566. /**
  2567. * If this collection has already been initialized with
  2568. * an identical criteria, it returns the collection.
  2569. * Otherwise if this KataoSupplierInvoice is new, it will return
  2570. * an empty collection; or if this KataoSupplierInvoice has previously
  2571. * been saved, it will retrieve related KataoSupplierInvoiceProducts from storage.
  2572. *
  2573. * This method is protected by default in order to keep the public
  2574. * api reasonable. You can provide public methods for those you
  2575. * actually need in KataoSupplierInvoice.
  2576. */
  2577. public function getKataoSupplierInvoiceProductsJoinKataoProduct($criteria = null, $con = null)
  2578. {
  2579. // include the Peer class
  2580. if ($criteria === null) {
  2581. $criteria = new Criteria();
  2582. }
  2583. elseif ($criteria instanceof Criteria)
  2584. {
  2585. $criteria = clone $criteria;
  2586. }
  2587. if ($this->collKataoSupplierInvoiceProducts === null) {
  2588. if ($this->isNew()) {
  2589. $this->collKataoSupplierInvoiceProducts = array();
  2590. } else {
  2591. $criteria->add(KataoSupplierInvoiceProductPeer::KATAO_SUPPLIER_INVOICE_ID, $this->getId());
  2592. $this->collKataoSupplierInvoiceProducts = KataoSupplierInvoiceProductPeer::doSelectJoinKataoProduct($criteria, $con);
  2593. }
  2594. } else {
  2595. // the following code is to determine if a new query is
  2596. // called for. If the criteria is the same as the last
  2597. // one, just return the collection.
  2598. $criteria->add(KataoSupplierInvoiceProductPeer::KATAO_SUPPLIER_INVOICE_ID, $this->getId());
  2599. if (!isset($this->lastKataoSupplierInvoiceProductCriteria) || !$this->lastKataoSupplierInvoiceProductCriteria->equals($criteria)) {
  2600. $this->collKataoSupplierInvoiceProducts = KataoSupplierInvoiceProductPeer::doSelectJoinKataoProduct($criteria, $con);
  2601. }
  2602. }
  2603. $this->lastKataoSupplierInvoiceProductCriteria = $criteria;
  2604. return $this->collKataoSupplierInvoiceProducts;
  2605. }
  2606. /**
  2607. * Temporary storage of collKataoSupplierInvoiceOrders to save a possible db hit in
  2608. * the event objects are add to the collection, but the
  2609. * complete collection is never requested.
  2610. * @return void
  2611. */
  2612. public function initKataoSupplierInvoiceOrders()
  2613. {
  2614. if ($this->collKataoSupplierInvoiceOrders === null) {
  2615. $this->collKataoSupplierInvoiceOrders = array();
  2616. }
  2617. }
  2618. /**
  2619. * If this collection has already been initialized with
  2620. * an identical criteria, it returns the collection.
  2621. * Otherwise if this KataoSupplierInvoice has previously
  2622. * been saved, it will retrieve related KataoSupplierInvoiceOrders from storage.
  2623. * If this KataoSupplierInvoice is new, it will return
  2624. * an empty collection or the current collection, the criteria
  2625. * is ignored on a new object.
  2626. *
  2627. * @param Connection $con
  2628. * @param Criteria $criteria
  2629. * @throws PropelException
  2630. */
  2631. public function getKataoSupplierInvoiceOrders($criteria = null, $con = null)
  2632. {
  2633. // include the Peer class
  2634. if ($criteria === null) {
  2635. $criteria = new Criteria();
  2636. }
  2637. elseif ($criteria instanceof Criteria)
  2638. {
  2639. $criteria = clone $criteria;
  2640. }
  2641. if ($this->collKataoSupplierInvoiceOrders === null) {
  2642. if ($this->isNew()) {
  2643. $this->collKataoSupplierInvoiceOrders = array();
  2644. } else {
  2645. $criteria->add(KataoSupplierInvoiceOrderPeer::KATAO_SUPPLIER_INVOICE_ID, $this->getId());
  2646. KataoSupplierInvoiceOrderPeer::addSelectColumns($criteria);
  2647. $this->collKataoSupplierInvoiceOrders = KataoSupplierInvoiceOrderPeer::doSelect($criteria, $con);
  2648. }
  2649. } else {
  2650. // criteria has no effect for a new object
  2651. if (!$this->isNew()) {
  2652. // the following code is to determine if a new query is
  2653. // called for. If the criteria is the same as the last
  2654. // one, just return the collection.
  2655. $criteria->add(KataoSupplierInvoiceOrderPeer::KATAO_SUPPLIER_INVOICE_ID, $this->getId());
  2656. KataoSupplierInvoiceOrderPeer::addSelectColumns($criteria);
  2657. if (!isset($this->lastKataoSupplierInvoiceOrderCriteria) || !$this->lastKataoSupplierInvoiceOrderCriteria->equals($criteria)) {
  2658. $this->collKataoSupplierInvoiceOrders = KataoSupplierInvoiceOrderPeer::doSelect($criteria, $con);
  2659. }
  2660. }
  2661. }
  2662. $this->lastKataoSupplierInvoiceOrderCriteria = $criteria;
  2663. return $this->collKataoSupplierInvoiceOrders;
  2664. }
  2665. /**
  2666. * Returns the number of related KataoSupplierInvoiceOrders.
  2667. *
  2668. * @param Criteria $criteria
  2669. * @param boolean $distinct
  2670. * @param Connection $con
  2671. * @throws PropelException
  2672. */
  2673. public function countKataoSupplierInvoiceOrders($criteria = null, $distinct = false, $con = null)
  2674. {
  2675. // include the Peer class
  2676. if ($criteria === null) {
  2677. $criteria = new Criteria();
  2678. }
  2679. elseif ($criteria instanceof Criteria)
  2680. {
  2681. $criteria = clone $criteria;
  2682. }
  2683. $criteria->add(KataoSupplierInvoiceOrderPeer::KATAO_SUPPLIER_INVOICE_ID, $this->getId());
  2684. return KataoSupplierInvoiceOrderPeer::doCount($criteria, $distinct, $con);
  2685. }
  2686. /**
  2687. * Method called to associate a KataoSupplierInvoiceOrder object to this object
  2688. * through the KataoSupplierInvoiceOrder foreign key attribute
  2689. *
  2690. * @param KataoSupplierInvoiceOrder $l KataoSupplierInvoiceOrder
  2691. * @return void
  2692. * @throws PropelException
  2693. */
  2694. public function addKataoSupplierInvoiceOrder(KataoSupplierInvoiceOrder $l)
  2695. {
  2696. $this->collKataoSupplierInvoiceOrders[] = $l;
  2697. $l->setKataoSupplierInvoice($this);
  2698. }
  2699. /**
  2700. * If this collection has already been initialized with
  2701. * an identical criteria, it returns the collection.
  2702. * Otherwise if this KataoSupplierInvoice is new, it will return
  2703. * an empty collection; or if this KataoSupplierInvoice has previously
  2704. * been saved, it will retrieve related KataoSupplierInvoiceOrders from storage.
  2705. *
  2706. * This method is protected by default in order to keep the public
  2707. * api reasonable. You can provide public methods for those you
  2708. * actually need in KataoSupplierInvoice.
  2709. */
  2710. public function getKataoSupplierInvoiceOrdersJoinKataoOrder($criteria = null, $con = null)
  2711. {
  2712. // include the Peer class
  2713. if ($criteria === null) {
  2714. $criteria = new Criteria();
  2715. }
  2716. elseif ($criteria instanceof Criteria)
  2717. {
  2718. $criteria = clone $criteria;
  2719. }
  2720. if ($this->collKataoSupplierInvoiceOrders === null) {
  2721. if ($this->isNew()) {
  2722. $this->collKataoSupplierInvoiceOrders = array();
  2723. } else {
  2724. $criteria->add(KataoSupplierInvoiceOrderPeer::KATAO_SUPPLIER_INVOICE_ID, $this->getId());
  2725. $this->collKataoSupplierInvoiceOrders = KataoSupplierInvoiceOrderPeer::doSelectJoinKataoOrder($criteria, $con);
  2726. }
  2727. } else {
  2728. // the following code is to determine if a new query is
  2729. // called for. If the criteria is the same as the last
  2730. // one, just return the collection.
  2731. $criteria->add(KataoSupplierInvoiceOrderPeer::KATAO_SUPPLIER_INVOICE_ID, $this->getId());
  2732. if (!isset($this->lastKataoSupplierInvoiceOrderCriteria) || !$this->lastKataoSupplierInvoiceOrderCriteria->equals($criteria)) {
  2733. $this->collKataoSupplierInvoiceOrders = KataoSupplierInvoiceOrderPeer::doSelectJoinKataoOrder($criteria, $con);
  2734. }
  2735. }
  2736. $this->lastKataoSupplierInvoiceOrderCriteria = $criteria;
  2737. return $this->collKataoSupplierInvoiceOrders;
  2738. }
  2739. public function __call($method, $arguments)
  2740. {
  2741. if (!$callable = sfMixer::getCallable('BaseKataoSupplierInvoice:'.$method))
  2742. {
  2743. throw new sfException(sprintf('Call to undefined method BaseKataoSupplierInvoice::%s', $method));
  2744. }
  2745. array_unshift($arguments, $this);
  2746. return call_user_func_array($callable, $arguments);
  2747. }
  2748. } // BaseKataoSupplierInvoice