[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [11687] Merge 11685:11686 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [11687] Merge 11685:11686 from trunk |
Date: |
Thu, 13 Feb 2014 13:18:58 +0000 |
Revision: 11687
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11687
Author: sigurdne
Date: 2014-02-13 13:18:57 +0000 (Thu, 13 Feb 2014)
Log Message:
-----------
Merge 11685:11686 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
Property Changed:
----------------
branches/Version-1_0-branch/
Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
-
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655,9657-9700,9702-9726,9728-9729,9731-9749,9751,9753-9754,9756-9832,9834-9836,9838-9839,9841-9846,9848-9850,9852-9858,9860-9863,9865,9867,9869-9871,9873-9893,9895,9897-9912,9914-9919,9921-9928,9930-9952,9954,9956,9958-9963,9965-9993,9995-9997,9999-10001,10003-10004,10006-10007,10009-10012,10014-10031,10033-10073,10075-10107,10109-10165,10167-10210,10222-10226,10228-10311,10313-10378,10380,10382,10384-10393,10395-10478,10480-10482,10484-10494,10496-10503,10505,10507,10509-10521,10523,10525-10528,10530-10540,10542-10543,10545-10568,10570-10584,10586-10590,10592-10594,10596,10598-10599,10601-10611,10613,10615,10617-10626,10628-10636,10638,10640-10654,10656-10658,10660,10662-10672,10674,10676-10682,10684,10686,10688-10690,10692-10694,10696-10697,10699-10701,10703,10705-10706,10708-10724,10726-10731,10734,10736-10748,10750-10796,10798-10939,10941,10943,10945,10947-10953,10955,10957-10961,10963,10965-10966,10968-11001,11003-11030,11032-11034,11036,11038,11040,11042-11053,11055-11059,11061-11062,11064-11068,11070-11073,11075-11077,11079-11083,11085,11087-11088,11090-11093,11095-11108,11110-11111,11113,11115-11116,11118-11120,11122,11124-11129,11131-11132,11134,11136,11138,11140-11151,11153-11161,11163-11185,11187-11189,11191-11229,11231,11233,11235-11264,11266-11267,11269-11278,11280-11282,11284-11291,11293-11295,11297,11299-11302,11304,11306,11309,11311,11313-11316,11318-11323,11325-11332,11334,11336-11344,11346,11348-11354,11356,11358-11360,11363-11386,11388-11389,11391-11392,11394,11396-11403,11405-11406,11408,11410,11412,11415,11417,11419-11420,11422,11424-11429,11431-11442,11444-11445,11447-11460,11462-11464,11466-11470,11472-11475,11477-11478,11480-11487,11489-11492,11494,11496,11498,11500-11502,11504-11506,11508,11510-11511,11513,11515,11517-11523,11525-11526,11528-11531,11533,11535-11538,11540-11546,11548-11560,11563-11572,11574,11576,11578,11580-11581,11583,11585,11587,11589-11592,11594-11595,11597,11599,11601,11603,11605-11607,11609-11611,11613,11615-11619,11621-11622,11624-11630,11632,11634-11635,11637,11639-11640,11642,11644-11655,11657-11659,11661-11675,11677-11679,11681-11684
+
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655,9657-9700,9702-9726,9728-9729,9731-9749,9751,9753-9754,9756-9832,9834-9836,9838-9839,9841-9846,9848-9850,9852-9858,9860-9863,9865,9867,9869-9871,9873-9893,9895,9897-9912,9914-9919,9921-9928,9930-9952,9954,9956,9958-9963,9965-9993,9995-9997,9999-10001,10003-10004,10006-10007,10009-10012,10014-10031,10033-10073,10075-10107,10109-10165,10167-10210,10222-10226,10228-10311,10313-10378,10380,10382,10384-10393,10395-10478,10480-10482,10484-10494,10496-10503,10505,10507,10509-10521,10523,10525-10528,10530-10540,10542-10543,10545-10568,10570-10584,10586-10590,10592-10594,10596,10598-10599,10601-10611,10613,10615,10617-10626,10628-10636,10638,10640-10654,10656-10658,10660,10662-10672,10674,10676-10682,10684,10686,10688-10690,10692-10694,10696-10697,10699-10701,10703,10705-10706,10708-10724,10726-10731,10734,10736-10748,10750-10796,10798-10939,10941,10943,10945,10947-10953,10955,10957-10961,10963,10965-10966,10968-11001,11003-11030,11032-11034,11036,11038,11040,11042-11053,11055-11059,11061-11062,11064-11068,11070-11073,11075-11077,11079-11083,11085,11087-11088,11090-11093,11095-11108,11110-11111,11113,11115-11116,11118-11120,11122,11124-11129,11131-11132,11134,11136,11138,11140-11151,11153-11161,11163-11185,11187-11189,11191-11229,11231,11233,11235-11264,11266-11267,11269-11278,11280-11282,11284-11291,11293-11295,11297,11299-11302,11304,11306,11309,11311,11313-11316,11318-11323,11325-11332,11334,11336-11344,11346,11348-11354,11356,11358-11360,11363-11386,11388-11389,11391-11392,11394,11396-11403,11405-11406,11408,11410,11412,11415,11417,11419-11420,11422,11424-11429,11431-11442,11444-11445,11447-11460,11462-11464,11466-11470,11472-11475,11477-11478,11480-11487,11489-11492,11494,11496,11498,11500-11502,11504-11506,11508,11510-11511,11513,11515,11517-11523,11525-11526,11528-11531,11533,11535-11538,11540-11546,11548-11560,11563-11572,11574,11576,11578,11580-11581,11583,11585,11587,11589-11592,11594-11595,11597,11599,11601,11603,11605-11607,11609-11611,11613,11615-11619,11621-11622,11624-11630,11632,11634-11635,11637,11639-11640,11642,11644-11655,11657-11659,11661-11675,11677-11679,11681-11684,11686
Modified: branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
2014-02-13 13:14:38 UTC (rev 11686)
+++ branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
2014-02-13 13:18:57 UTC (rev 11687)
@@ -34,22 +34,22 @@
class property_soinvoice
{
- public $total_records = 0;
- public $sum_amount = 0;
- public $role = array();
- protected $invoice_approval = 2;
+ public $total_records = 0;
+ public $sum_amount = 0;
+ public $role = array();
+ protected $invoice_approval = 2;
function __construct()
{
- $this->account_id =
$GLOBALS['phpgw_info']['user']['account_id'];
- $this->acl = & $GLOBALS['phpgw']->acl;
- $this->db = & $GLOBALS['phpgw']->db;
- $this->join = & $this->db->join;
- $this->left_join = & $this->db->left_join;
- $this->like = & $this->db->like;
- $this->config = CreateObject('phpgwapi.config',
'property');
+ $this->account_id =
$GLOBALS['phpgw_info']['user']['account_id'];
+ $this->acl = &
$GLOBALS['phpgw']->acl;
+ $this->db = &
$GLOBALS['phpgw']->db;
+ $this->join = &
$this->db->join;
+ $this->left_join = &
$this->db->left_join;
+ $this->like = &
$this->db->like;
+ $this->config =
CreateObject('phpgwapi.config', 'property');
$this->config->read();
- $this->invoice_approval =
isset($this->config->config_data['invoice_approval']) &&
$this->config->config_data['invoice_approval'] ?
$this->config->config_data['invoice_approval'] : 2;
+ $this->invoice_approval =
isset($this->config->config_data['invoice_approval']) &&
$this->config->config_data['invoice_approval'] ?
$this->config->config_data['invoice_approval'] : 2;
}
function read_invoice($data)
@@ -65,29 +65,29 @@
'periode' => true
);
- $start = isset($data['start']) && $data['start'] ?
$data['start'] : 0;
- $query = isset($data['query']) ? $data['query'] : '';
- $sort = isset($data['sort']) && $data['sort'] ?
$data['sort'] : 'DESC';
- $order = isset($data['order']) &&
$valid_order[$data['order']] ? $data['order'] : '';
- $cat_id = isset($data['cat_id']) && $data['cat_id'] ?
$data['cat_id'] : 0;
- $user_lid = isset($data['user_lid']) &&
$data['user_lid'] ? $data['user_lid'] : 'none';
- $paid = isset($data['paid']) ? $data['paid'] : '';
- $start_date = isset($data['start_date']) &&
$data['start_date'] ? $data['start_date'] : mktime(0, 0, 0, '01', '01',
date('Y'));
- $end_date = isset($data['end_date']) &&
$data['end_date'] ? $data['end_date'] : time();
- $vendor_id = isset($data['vendor_id']) ?
$data['vendor_id'] : '';
- $loc1 = isset($data['loc1']) ? $data['loc1'] : '';
- $workorder_id = isset($data['workorder_id']) ?
$data['workorder_id'] : '';
- $project_id = isset($data['project_id']) ?
$data['project_id'] : '';
- $allrows = isset($data['allrows']) ? $data['allrows'] :
'';
- $voucher_id = isset($data['voucher_id']) ?
$data['voucher_id'] : '';
+ $start = isset($data['start']) &&
$data['start'] ? $data['start'] : 0;
+ $query = isset($data['query']) ?
$data['query'] : '';
+ $sort = isset($data['sort']) &&
$data['sort'] ? $data['sort'] : 'DESC';
+ $order = isset($data['order']) &&
$valid_order[$data['order']] ? $data['order'] : '';
+ $cat_id = isset($data['cat_id']) &&
$data['cat_id'] ? $data['cat_id'] : 0;
+ $user_lid = isset($data['user_lid']) &&
$data['user_lid'] ? $data['user_lid'] : 'none';
+ $paid = isset($data['paid']) ?
$data['paid'] : '';
+ $start_date = isset($data['start_date'])
&& $data['start_date'] ? $data['start_date'] : mktime(0, 0, 0, '01', '01',
date('Y'));
+ $end_date = isset($data['end_date']) &&
$data['end_date'] ? $data['end_date'] : time();
+ $vendor_id = isset($data['vendor_id']) ?
$data['vendor_id'] : '';
+ $loc1 = isset($data['loc1']) ?
$data['loc1'] : '';
+ $workorder_id = isset($data['workorder_id']) ?
$data['workorder_id'] : '';
+ $project_id = isset($data['project_id']) ?
$data['project_id'] : '';
+ $allrows = isset($data['allrows']) ?
$data['allrows'] : '';
+ $voucher_id = isset($data['voucher_id']) ?
$data['voucher_id'] : '';
$b_account_class = isset($data['b_account_class']) ?
$data['b_account_class'] : '';
- $district_id = isset($data['district_id']) ?
$data['district_id'] : '';
- $invoice_id = $data['invoice_id'] ? $data['invoice_id']
: '';
- $ecodimb = isset($data['ecodimb']) ? $data['ecodimb'] :
'';
+ $district_id = isset($data['district_id']) ?
$data['district_id'] : '';
+ $invoice_id = $data['invoice_id'] ?
$data['invoice_id'] : '';
+ $ecodimb = isset($data['ecodimb']) ?
$data['ecodimb'] : '';
- $join_tables = '';
- $filtermethod = '';
- $querymethod = '';
+ $join_tables = '';
+ $filtermethod = '';
+ $querymethod = '';
$this->db->query("SELECT * FROM fm_ecoart");
$art_list = array();
@@ -113,8 +113,8 @@
}
else if($user_lid != 'all')
{
- $filtermethod = " WHERE ( oppsynsmannid=
'$user_lid' or saksbehandlerid= '$user_lid' or budsjettansvarligid=
'$user_lid')";
- $where = 'AND';
+ $filtermethod = " WHERE ( oppsynsmannid=
'$user_lid' or saksbehandlerid= '$user_lid' or budsjettansvarligid=
'$user_lid')";
+ $where = 'AND';
}
if($cat_id > 0)
@@ -134,7 +134,7 @@
$filtermethod .= " $where
district_id='$district_id' ";
$join_tables = " $this->join fm_location1 ON
fm_ecobilagoverf.loc1 = fm_location1.loc1"
. " $this->join fm_part_of_town ON
(fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id)";
- $where = 'AND';
+ $where = 'AND';
}
if($vendor_id)
@@ -167,8 +167,8 @@
if(!$workorder_id && !$voucher_id &&
!$invoice_id)
{
- $start_periode = date('Ym',
$start_date);
- $end_periode = date('Ym', $end_date);
+ $start_periode = date('Ym',
$start_date);
+ $end_periode = date('Ym',
$end_date);
$filtermethod .= " $where (periode
>='$start_periode' AND periode <= '$end_periode')";
$where = 'AND';
@@ -182,14 +182,14 @@
$no_q = false;
if($voucher_id)
{
- $filtermethod = " WHERE bilagsnr = " . (int)
$voucher_id . " OR bilagsnr_ut = '{$voucher_id}'";// OR spvend_code = ".
(int)$query;
- $no_q = true;
+ $filtermethod = " WHERE bilagsnr = " . (int)
$voucher_id . " OR bilagsnr_ut = '{$voucher_id}'";// OR spvend_code = ".
(int)$query;
+ $no_q = true;
}
if($workorder_id)
{
- $filtermethod = " WHERE pmwrkord_code
='$workorder_id' ";
- $no_q = true;
+ $filtermethod = " WHERE pmwrkord_code
='$workorder_id' ";
+ $no_q = true;
}
else if($project_id)
{
@@ -200,39 +200,39 @@
$_workorders[] = $this->db->f('id');
}
- $filtermethod = ' WHERE pmwrkord_code IN (' .
implode(',', $_workorders) . ')';
+ $filtermethod = ' WHERE pmwrkord_code IN ('
. implode(',', $_workorders) . ')';
$filtermethod .= " AND (periode
>='$start_periode' AND periode <= '$end_periode')";
- $no_q = true;
+ $no_q = true;
}
if($query && !$no_q)
{
- $query = (int) $query;
+ $query = (int) $query;
$querymethod = " $where ( spvend_code =
{$query} OR bilagsnr = {$query})";
}
- $sql = "SELECT bilagsnr, bilagsnr_ut, count(bilagsnr)
as invoice_count, sum(belop) as belop, sum(godkjentbelop) as
godkjentbelop,spvend_code,fakturadato FROM $table $join_tables $filtermethod
$querymethod GROUP BY periode,
bilagsnr,bilagsnr_ut,spvend_code,fakturadato,oppsynsigndato,saksigndato,budsjettsigndato";
- $sql2 = "SELECT DISTINCT bilagsnr FROM $table
$join_tables $filtermethod $querymethod";
+ $sql = "SELECT bilagsnr, bilagsnr_ut,
count(bilagsnr) as invoice_count, sum(belop) as belop, sum(godkjentbelop) as
godkjentbelop,spvend_code,fakturadato FROM $table $join_tables $filtermethod
$querymethod GROUP BY periode,
bilagsnr,bilagsnr_ut,spvend_code,fakturadato,oppsynsigndato,saksigndato,budsjettsigndato";
+ $sql2 = "SELECT DISTINCT bilagsnr FROM $table
$join_tables $filtermethod $querymethod";
if($GLOBALS['phpgw_info']['server']['db_type'] ==
'postgres')
{
- $sql_count = 'SELECT count(bilagsnr) as cnt,
sum(godkjentbelop) AS sum_amount FROM (SELECT DISTINCT bilagsnr,
sum(godkjentbelop) as godkjentbelop ' . substr($sql2, strripos($sql2, 'FROM'))
. ' GROUP BY bilagsnr) AS t';
+ $sql_count = 'SELECT
count(bilagsnr) as cnt, sum(godkjentbelop) AS sum_amount FROM (SELECT DISTINCT
bilagsnr, sum(godkjentbelop) as godkjentbelop ' . substr($sql2, strripos($sql2,
'FROM')) . ' GROUP BY bilagsnr) AS t';
//_debug_array($sql_count);
$this->db->query($sql_count, __LINE__,
__FILE__);
$this->db->next_record();
$this->total_records = $this->db->f('cnt');
- $this->sum_amount = $this->db->f('sum_amount');
+ $this->sum_amount =
$this->db->f('sum_amount');
}
else
{
$this->db->query($sql2, __LINE__, __FILE__);
$this->total_records = $this->db->num_rows();
- $sql3 = "SELECT sum(godkjentbelop) as
sum_amount FROM $table $join_tables $filtermethod $querymethod";
+ $sql3 = "SELECT
sum(godkjentbelop) as sum_amount FROM $table $join_tables $filtermethod
$querymethod";
$this->db->query($sql3, __LINE__, __FILE__);
$this->db->next_record();
- $this->sum_amount = $this->db->f('sum_amount');
+ $this->sum_amount =
$this->db->f('sum_amount');
}
if(!$allrows)
@@ -261,8 +261,8 @@
if($temp)
{
- $role = $this->check_role();
- $i = 0;
+ $role = $this->check_role();
+ $i = 0;
foreach($temp as $invoice_temp)
{
$voucher_id =
$invoice_temp['voucher_id'];
@@ -279,8 +279,8 @@
$this->db->next_record();
- $timestamp_voucher_date = mktime(0, 0,
0, date('m', strtotime($this->db->f('fakturadato'))), date('d',
strtotime($this->db->f('fakturadato'))), date('y',
strtotime($this->db->f('fakturadato'))));
- $timestamp_payment_date = mktime(0, 0,
0, date('m', strtotime($this->db->f('forfallsdato'))), date('d',
strtotime($this->db->f('forfallsdato'))), date('y',
strtotime($this->db->f('forfallsdato'))));
+ $timestamp_voucher_date = mktime(0, 0,
0, date('m', strtotime($this->db->f('fakturadato'))), date('d',
strtotime($this->db->f('fakturadato'))), date('y',
strtotime($this->db->f('fakturadato'))));
+ $timestamp_payment_date = mktime(0, 0,
0, date('m', strtotime($this->db->f('forfallsdato'))), date('d',
strtotime($this->db->f('forfallsdato'))), date('y',
strtotime($this->db->f('forfallsdato'))));
if($this->db->f('oppsynsmannid') &&
$this->db->f('oppsynsigndato'))
{
@@ -317,36 +317,36 @@
$invoice[$i]['transfer_date'] =
'';
}
- $invoice[$i]['counter'] = $i;
- $invoice[$i]['current_user'] =
$GLOBALS['phpgw_info']['user']['account_lid'];
- $invoice[$i]['voucher_id'] =
$voucher_id;
- $invoice[$i]['voucher_out_id'] =
$invoice_temp['voucher_out_id'];
- $invoice[$i]['invoice_count'] =
$invoice_temp['invoice_count'];
- $invoice[$i]['vendor_id'] =
$this->db->f('spvend_code');
- $invoice[$i]['vendor'] =
$this->db->f('org_name', true);
- $invoice[$i]['is_janitor'] =
$role['is_janitor'];
- $invoice[$i]['is_supervisor'] =
$role['is_supervisor'];
- $invoice[$i]['is_budget_responsible'] =
$role['is_budget_responsible'];
- $invoice[$i]['is_transfer'] =
$role['is_transfer'];
- $invoice[$i]['janitor'] =
$this->db->f('oppsynsmannid');
- $invoice[$i]['supervisor'] =
$this->db->f('saksbehandlerid');
- $invoice[$i]['budget_responsible'] =
$this->db->f('budsjettansvarligid');
- $invoice[$i]['transfer_id'] =
$this->db->f('utbetalingid');
- $invoice[$i]['voucher_date'] =
$GLOBALS['phpgw']->common->show_date($timestamp_voucher_date,
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
- $invoice[$i]['payment_date'] =
$GLOBALS['phpgw']->common->show_date($timestamp_payment_date,
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
- $invoice[$i]['period'] =
$this->db->f('periode');
- $invoice[$i]['periodization'] =
$this->db->f('periodization');
- $invoice[$i]['periodization_start'] =
$this->db->f('periodization_start');
+ $invoice[$i]['counter']
= $i;
+ $invoice[$i]['current_user']
= $GLOBALS['phpgw_info']['user']['account_lid'];
+ $invoice[$i]['voucher_id']
= $voucher_id;
+ $invoice[$i]['voucher_out_id']
= $invoice_temp['voucher_out_id'];
+ $invoice[$i]['invoice_count']
= $invoice_temp['invoice_count'];
+ $invoice[$i]['vendor_id']
= $this->db->f('spvend_code');
+ $invoice[$i]['vendor']
= $this->db->f('org_name', true);
+ $invoice[$i]['is_janitor']
= $role['is_janitor'];
+ $invoice[$i]['is_supervisor']
= $role['is_supervisor'];
+ $invoice[$i]['is_budget_responsible']
= $role['is_budget_responsible'];
+ $invoice[$i]['is_transfer']
= $role['is_transfer'];
+ $invoice[$i]['janitor']
= $this->db->f('oppsynsmannid');
+ $invoice[$i]['supervisor']
= $this->db->f('saksbehandlerid');
+ $invoice[$i]['budget_responsible']
= $this->db->f('budsjettansvarligid');
+ $invoice[$i]['transfer_id']
= $this->db->f('utbetalingid');
+ $invoice[$i]['voucher_date']
= $GLOBALS['phpgw']->common->show_date($timestamp_voucher_date,
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+ $invoice[$i]['payment_date']
= $GLOBALS['phpgw']->common->show_date($timestamp_payment_date,
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+ $invoice[$i]['period']
= $this->db->f('periode');
+ $invoice[$i]['periodization']
= $this->db->f('periodization');
+ $invoice[$i]['periodization_start']
= $this->db->f('periodization_start');
- $invoice[$i]['type'] =
$art_list[$this->db->f('artid')];
- $invoice[$i]['kidnr'] =
$this->db->f('kidnr');
- $invoice[$i]['kreditnota'] =
$this->db->f('kreditnota');
- $invoice[$i]['currency'] =
$this->db->f('currency');
- $invoice[$i]['order_id'] =
$this->db->f('pmwrkord_code');
- $invoice[$i]['amount'] =
$invoice_temp['amount'];
- $invoice[$i]['approved_amount'] =
$invoice_temp['approved_amount'];
- $invoice[$i]['num_days'] =
intval(($timestamp_payment_date - $timestamp_voucher_date) / (24 * 3600));
- $invoice[$i]['timestamp_voucher_date']
= $timestamp_voucher_date;
+ $invoice[$i]['type']
= $art_list[$this->db->f('artid')];
+ $invoice[$i]['kidnr']
= $this->db->f('kidnr');
+ $invoice[$i]['kreditnota']
= $this->db->f('kreditnota');
+ $invoice[$i]['currency']
= $this->db->f('currency');
+ $invoice[$i]['order_id']
= $this->db->f('pmwrkord_code');
+ $invoice[$i]['amount']
= $invoice_temp['amount'];
+ $invoice[$i]['approved_amount']
= $invoice_temp['approved_amount'];
+ $invoice[$i]['num_days']
= intval(($timestamp_payment_date - $timestamp_voucher_date) /
(24 * 3600));
+ $invoice[$i]['timestamp_voucher_date']
= $timestamp_voucher_date;
if($invoice[$i]['current_user'] ==
$invoice[$i]['janitor'] && $invoice[$i]['jan_date'])
{
@@ -372,16 +372,16 @@
function read_invoice_sub($data)
{
- $start = isset($data['start']) && $data['start'] ?
(int) $data['start'] : 0;
- $filter = isset($data['filter']) ? $data['filter'] :
'none';
- $sort = isset($data['sort']) ? $data['sort'] : 'DESC';
- $order = isset($data['order']) ? $data['order'] : '';
- $voucher_id = isset($data['voucher_id']) &&
$data['voucher_id'] ? (int) $data['voucher_id'] : 0;
- $paid = isset($data['paid']) ? $data['paid'] : '';
- $project_id = isset($data['project_id']) &&
$data['project_id'] ? (int) $data['project_id'] : 0;
- $order_id = isset($data['order_id']) &&
$data['order_id'] ? $data['order_id'] : 0;//might be bigint
- $results = isset($data['results']) && $data['results']
? (int) $data['results'] : 0;
- $allrows = isset($data['allrows']) ? $data['allrows'] :
'';
+ $start = isset($data['start']) &&
$data['start'] ? (int) $data['start'] : 0;
+ $filter = isset($data['filter']) ?
$data['filter'] : 'none';
+ $sort = isset($data['sort']) ? $data['sort']
: 'DESC';
+ $order = isset($data['order']) ?
$data['order'] : '';
+ $voucher_id = isset($data['voucher_id']) &&
$data['voucher_id'] ? (int) $data['voucher_id'] : 0;
+ $paid = isset($data['paid']) ? $data['paid']
: '';
+ $project_id = isset($data['project_id']) &&
$data['project_id'] ? (int) $data['project_id'] : 0;
+ $order_id = isset($data['order_id']) &&
$data['order_id'] ? $data['order_id'] : 0;//might be bigint
+ $results = isset($data['results']) &&
$data['results'] ? (int) $data['results'] : 0;
+ $allrows = isset($data['allrows']) ?
$data['allrows'] : '';
if($paid)
{
$table = 'fm_ecobilagoverf';
@@ -409,8 +409,8 @@
$ordermethod = ' ORDER BY pmwrkord_code
DESC, id DESC';
}
- $filtermethod = '';
- $where = 'WHERE';
+ $filtermethod = '';
+ $where = 'WHERE';
if($voucher_id)
{
@@ -520,25 +520,25 @@
function read_invoice_sub_sum($data)
{
- $start = isset($data['start']) && $data['start'] ?
(int) $data['start'] : 0;
- $filter = isset($data['filter']) ? $data['filter'] :
'none';
- $sort = isset($data['sort']) ? $data['sort'] : 'DESC';
- $order = isset($data['order']) ? $data['order'] : '';
- $voucher_id = isset($data['voucher_id']) &&
$data['voucher_id'] ? (int) $data['voucher_id'] : 0;
- $paid = isset($data['paid']) ? $data['paid'] : '';
- $year = isset($data['year']) ? $data['year'] : '';
- $project_id = isset($data['project_id']) &&
$data['project_id'] ? (int) $data['project_id'] : 0;
- $order_id = isset($data['order_id']) &&
$data['order_id'] ? $data['order_id'] : 0;//might be bigint
+ $start = isset($data['start']) &&
$data['start'] ? (int) $data['start'] : 0;
+ $filter = isset($data['filter']) ?
$data['filter'] : 'none';
+ $sort = isset($data['sort']) ? $data['sort']
: 'DESC';
+ $order = isset($data['order']) ?
$data['order'] : '';
+ $voucher_id = isset($data['voucher_id']) &&
$data['voucher_id'] ? (int) $data['voucher_id'] : 0;
+ $paid = isset($data['paid']) ? $data['paid']
: '';
+ $year = isset($data['year']) ? $data['year']
: '';
+ $project_id = isset($data['project_id']) &&
$data['project_id'] ? (int) $data['project_id'] : 0;
+ $order_id = isset($data['order_id']) &&
$data['order_id'] ? $data['order_id'] : 0;//might be bigint
if($paid)
{
- $table = 'fm_ecobilagoverf';
- $overftid = ',overftid';
+ $table = 'fm_ecobilagoverf';
+ $overftid = ',overftid';
}
else
{
- $table = 'fm_ecobilag';
- $overftid = '';
+ $table = 'fm_ecobilag';
+ $overftid = '';
}
switch($order)
@@ -553,8 +553,8 @@
$ordermethod = " ORDER BY pmwrkord_code
DESC";
}
- $filtermethod = '';
- $where = 'WHERE';
+ $filtermethod = '';
+ $where = 'WHERE';
if($voucher_id)
{
@@ -622,9 +622,9 @@
$this->db->query($sql, __LINE__, __FILE__);
$this->db->next_record();
- $entry['budsjettsigndato'] =
$this->db->f('budsjettsigndato');
- $entry['transfer_time'] =
$this->db->f('overftid');
- $entry['type'] = $this->db->f('type');
+ $entry['budsjettsigndato'] =
$this->db->f('budsjettsigndato');
+ $entry['transfer_time'] =
$this->db->f('overftid');
+ $entry['type'] =
$this->db->f('type');
}
return $values;
@@ -634,42 +634,42 @@
{
if(is_array($data))
{
- $start = isset($data['start']) &&
$data['start'] ? $data['start'] : 0;
- $filter = isset($data['filter']) ?
$data['filter'] : 'none';
- $query = isset($data['query']) ? $data['query']
: '';
- $sort = isset($data['sort']) ? $data['sort'] :
'DESC';
- $order = isset($data['order']) ? $data['order']
: '';
- $cat_id = isset($data['cat_id']) &&
$data['cat_id'] ? (int) $data['cat_id'] : 0;
- $start_date = isset($data['start_date']) &&
$data['start_date'] ? $data['start_date'] : 0;
- $end_date = isset($data['end_date']) &&
$data['end_date'] ? $data['end_date'] : time();
- $vendor_id = isset($data['vendor_id']) ? (int)
$data['vendor_id'] : 0;
- $loc1 = isset($data['loc1']) ? $data['loc1'] :
'';
- $district_id = isset($data['district_id']) ?
(int) $data['district_id'] : 0;
- $workorder_id = isset($data['workorder_id']) &&
$data['workorder_id'] ? $data['workorder_id'] : 0;
+ $start =
isset($data['start']) && $data['start'] ? $data['start'] : 0;
+ $filter =
isset($data['filter']) ? $data['filter'] : 'none';
+ $query =
isset($data['query']) ? $data['query'] : '';
+ $sort = isset($data['sort'])
? $data['sort'] : 'DESC';
+ $order =
isset($data['order']) ? $data['order'] : '';
+ $cat_id =
isset($data['cat_id']) && $data['cat_id'] ? (int) $data['cat_id'] : 0;
+ $start_date =
isset($data['start_date']) && $data['start_date'] ? $data['start_date'] : 0;
+ $end_date =
isset($data['end_date']) && $data['end_date'] ? $data['end_date'] : time();
+ $vendor_id =
isset($data['vendor_id']) ? (int) $data['vendor_id'] : 0;
+ $loc1 = isset($data['loc1'])
? $data['loc1'] : '';
+ $district_id = isset($data['district_id'])
? (int) $data['district_id'] : 0;
+ $workorder_id = isset($data['workorder_id'])
&& $data['workorder_id'] ? $data['workorder_id'] : 0;
$b_account_class =
isset($data['b_account_class']) ? $data['b_account_class'] : '';
- $b_account = isset($data['b_account']) ?
$data['b_account'] : '';
- $ecodimb = isset($data['ecodimb']) ?
$data['ecodimb'] : '';
+ $b_account =
isset($data['b_account']) ? $data['b_account'] : '';
+ $ecodimb =
isset($data['ecodimb']) ? $data['ecodimb'] : '';
}
$where = 'AND';
if($b_account_class)
{
- $filtermethod = " $where
fm_b_account.category='$b_account_class'";
- $where = 'AND';
+ $filtermethod = " $where
fm_b_account.category='$b_account_class'";
+ $where = 'AND';
}
else
{
- $select_account_class = ',fm_b_account.category
as b_account_class';
- $group_account_class = ',
spbudact_code,fm_b_account.category';
+ $select_account_class =
',fm_b_account.category as b_account_class';
+ $group_account_class = ',
spbudact_code,fm_b_account.category';
}
if($b_account)
{
$filtermethod .= " {$where} fm_b_account.id =
'{$b_account}'";
- $where = 'AND';
- $select_account_class = ',fm_b_account.id as
b_account_class';
- $group_account_class = ',
spbudact_code,fm_b_account.id';
+ $where =
'AND';
+ $select_account_class = ',fm_b_account.id as
b_account_class';
+ $group_account_class = ',
spbudact_code,fm_b_account.id';
}
@@ -711,8 +711,8 @@
$where = 'AND';
}
- $start_periode = date('Ym', $start_date);
- $end_periode = date('Ym', $end_date);
+ $start_periode = date('Ym', $start_date);
+ $end_periode = date('Ym', $end_date);
$sql = "SELECT district_id,periode,sum(godkjentbelop)
as consume {$select_account_class}"
. " FROM fm_ecobilagoverf {$this->join} fm_location1
ON (fm_ecobilagoverf.loc1 = fm_location1.loc1) "
@@ -795,8 +795,8 @@
return $update;
}
- $timestamp_voucher_date = mktime(0, 0, 0, date('m',
strtotime($this->db->f('fakturadato'))), date('d',
strtotime($this->db->f('fakturadato'))), date('y',
strtotime($this->db->f('fakturadato'))));
- $timestamp_payment_date = mktime(0, 0, 0, date('m',
strtotime($this->db->f('forfallsdato'))), date('d',
strtotime($this->db->f('forfallsdato'))), date('y',
strtotime($this->db->f('forfallsdato'))));
+ $timestamp_voucher_date = mktime(0, 0, 0, date('m',
strtotime($this->db->f('fakturadato'))), date('d',
strtotime($this->db->f('fakturadato'))), date('y',
strtotime($this->db->f('fakturadato'))));
+ $timestamp_payment_date = mktime(0, 0, 0, date('m',
strtotime($this->db->f('forfallsdato'))), date('d',
strtotime($this->db->f('forfallsdato'))), date('y',
strtotime($this->db->f('forfallsdato'))));
if(((intval(($timestamp_payment_date -
$timestamp_voucher_date) / (24 * 3600))) != $values['num_days']))
{
@@ -807,8 +807,8 @@
function update_invoice_sub($values)
{
- $update_status = array();
- $receipt = array();
+ $update_status = array();
+ $receipt = array();
$GLOBALS['phpgw']->db->transaction_begin();
while($entry = each($values['counter']))
@@ -818,7 +818,7 @@
$n = $entry[0];
//_debug_array($entry);
- $id = (int) $values['id'][$n];
+ $id = (int)
$values['id'][$n];
$approved_amount =
isset($values['approved_amount'][$n]) && $values['approved_amount'][$n] ?
str_replace(',', '.', $values['approved_amount'][$n]) : 0;
if(!$approved_amount || $approved_amount ==
'00.0')
{
@@ -835,21 +835,21 @@
$GLOBALS['phpgw']->db->next_record();
if($GLOBALS['phpgw']->db->f('cnt') == 0)
{
- $receipt['error'][] =
array('msg' => lang('This account is not valid:') . " " . $budget_account);
- $local_error = true;
+ $receipt['error'][] =
array('msg' => lang('This account is not valid:') . " " . $budget_account);
+ $local_error = true;
}
}
else
{
- $receipt['error'][] = array('msg' =>
lang('Budget account is missing:'));
- $local_error = true;
+ $receipt['error'][] = array('msg'
=> lang('Budget account is missing:'));
+ $local_error = true;
}
if(!$values['dimd'][$n])
{
- $dimd_field = "dimd=NULL";
- $local_error = true;
- $receipt['error'][] = array('msg' =>
lang('Dim D is mandatory'));
+ $dimd_field =
"dimd=NULL";
+ $local_error = true;
+ $receipt['error'][] = array('msg'
=> lang('Dim D is mandatory'));
}
else
{
@@ -858,18 +858,18 @@
$GLOBALS['phpgw']->db->next_record();
if($GLOBALS['phpgw']->db->f('cnt') == 0)
{
- $receipt['error'][] =
array('msg' => lang('This Dim D is not valid:') . " " . $dimd);
- $local_error = true;
+ $receipt['error'][] =
array('msg' => lang('This Dim D is not valid:') . " " . $dimd);
+ $local_error = true;
}
- $dimd_field = "dimd=" . "'" . $dimd .
"'";
+ $dimd_field = "dimd='{$dimd}', dime =
'{$dimd}'";
}
if(!$values['dima'][$n])
{
- $dima_field = "dima=NULL";
- $receipt['error'][] = array('msg' =>
lang('Dim A is missing'));
- $local_error = true;
+ $dima_field =
"dima=NULL";
+ $receipt['error'][] = array('msg'
=> lang('Dim A is missing'));
+ $local_error = true;
}
else
{
@@ -878,14 +878,14 @@
$GLOBALS['phpgw']->db->next_record();
if(!$GLOBALS['phpgw']->db->f('loc1'))
{
- $receipt['error'][] =
array('msg' => lang('This Dim A is not valid:') . " " . $values['dima'][$n]);
- $local_error = true;
+ $receipt['error'][] =
array('msg' => lang('This Dim A is not valid:') . " " . $values['dima'][$n]);
+ $local_error = true;
}
if(!$GLOBALS['phpgw']->db->f('kostra_id') ||
$GLOBALS['phpgw']->db->f('kostra_id') == 0)
{
- $receipt['error'][] =
array('msg' => 'objektet mangler tjeneste - utgått? ' . " " .
$values['dima'][$n]);
- $local_error = true;
+ $receipt['error'][] =
array('msg' => 'objektet mangler tjeneste - utgått? ' . " " .
$values['dima'][$n]);
+ $local_error = true;
}
// $dima_field="dima="."'" .
$values['dima'][$n] . "'";
@@ -896,9 +896,9 @@
if(!$local_error)
{
- $tax_code = (int)
$values['tax_code'][$n];
- $dimb = isset($values['dimb'][$n]) &&
$values['dimb'][$n] ? (int) $values['dimb'][$n] : 'NULL';
- $workorder_id =
$values['workorder_id'][$n];
+ $tax_code = (int)
$values['tax_code'][$n];
+ $dimb =
isset($values['dimb'][$n]) && $values['dimb'][$n] ? (int) $values['dimb'][$n] :
'NULL';
+ $workorder_id =
$values['workorder_id'][$n];
if(isset($values['close_order'][$n]) &&
$values['close_order'][$n] && !$values['close_order_orig'][$n])
{
$update_status[$workorder_id] =
'X';
@@ -932,8 +932,8 @@
if($update_status)
{
- $closed =
isset($this->config->config_data['workorder_closed_status']) &&
$this->config->config_data['workorder_closed_status'] ?
$this->config->config_data['workorder_closed_status'] : '';
- $reopen =
isset($this->config->config_data['workorder_reopen_status']) &&
$this->config->config_data['workorder_reopen_status'] ?
$this->config->config_data['workorder_reopen_status'] : '';
+ $closed =
isset($this->config->config_data['workorder_closed_status']) &&
$this->config->config_data['workorder_closed_status'] ?
$this->config->config_data['workorder_closed_status'] : '';
+ $reopen =
isset($this->config->config_data['workorder_reopen_status']) &&
$this->config->config_data['workorder_reopen_status'] ?
$this->config->config_data['workorder_reopen_status'] : '';
if(!$closed)
{
@@ -1008,7 +1008,7 @@
$table = 'fm_ecobilagoverf';
$value_set = array
- (
+ (
// 'project_id'
=> $values['project_group'] ? $values['project_group'] : '',
'pmwrkord_code' => $values['order_id'],
// 'process_log' =>
$this->db->db_addslashes($values['process_log']),
@@ -1027,29 +1027,29 @@
switch($values['sign_orig'])
{
case 'is_janitor':
- $value_set['oppsynsigndato'] =
null;
+ $value_set['oppsynsigndato']
= null;
break;
case 'is_supervisor':
- $value_set['saksigndato'] =
null;
+ $value_set['saksigndato']
= null;
break;
case 'is_budget_responsible':
- $value_set['budsjettsigndato']
= null;
+ $value_set['budsjettsigndato']
= null;
break;
}
switch($values['approve'])
{
case 'is_janitor':
- $value_set['oppsynsigndato'] =
date($this->db->datetime_format());
- $value_set['oppsynsmannid'] =
$values['my_initials'];
+ $value_set['oppsynsigndato']
= date($this->db->datetime_format());
+ $value_set['oppsynsmannid']
= $values['my_initials'];
break;
case 'is_supervisor':
- $value_set['saksigndato'] =
date($this->db->datetime_format());
- $value_set['saksbehandlerid'] =
$values['my_initials'];
+ $value_set['saksigndato']
= date($this->db->datetime_format());
+ $value_set['saksbehandlerid']
= $values['my_initials'];
break;
case 'is_budget_responsible':
- $value_set['budsjettsigndato']
= date($this->db->datetime_format());
-
$value_set['budsjettansvarligid'] = $values['my_initials'];
+ $value_set['budsjettsigndato']
= date($this->db->datetime_format());
+
$value_set['budsjettansvarligid'] = $values['my_initials'];
break;
}
@@ -1086,8 +1086,8 @@
if(isset($values['split_line']) &&
$values['split_amount'] && isset($values['split_amount']) &&
$values['split_amount'])
{
- $metadata = $this->db->metadata($table);
- $sql = "SELECT * FROM {$table} WHERE id= {$id}";
+ $metadata = $this->db->metadata($table);
+ $sql = "SELECT * FROM {$table}
WHERE id= {$id}";
$this->db->query($sql, __LINE__, __FILE__);
$this->db->next_record();
@@ -1108,23 +1108,23 @@
$this->db->query("SELECT belop FROM {$table}
WHERE id={$id}", __LINE__, __FILE__);
$this->db->next_record();
- $amount = $this->db->f('belop');
- $new_amount = $amount - $values['split_amount'];
+ $amount = $this->db->f('belop');
+ $new_amount = $amount -
$values['split_amount'];
- $value_set = array
+ $value_set = array
(
'belop' => $new_amount,
'godkjentbelop' => $new_amount,
);
- $value_set =
$this->db->validate_update($value_set);
+ $value_set =
$this->db->validate_update($value_set);
$this->db->query("UPDATE {$table} SET
$value_set WHERE id= {$id}", __LINE__, __FILE__);
- $value_set = array
+ $value_set = array
(
'belop' =>
$values['split_amount'],
'godkjentbelop' =>
$values['split_amount'],
);
- $value_set =
$this->db->validate_update($value_set);
+ $value_set =
$this->db->validate_update($value_set);
$this->db->query("UPDATE {$table} SET
$value_set WHERE id= {$new_id}", __LINE__, __FILE__);
}
@@ -1157,11 +1157,11 @@
if(isset($this->config->config_data['invoice_acl']) &&
$this->config->config_data['invoice_acl'] == 'dimb')
{
- $dimb = (int) $dimb;
- $filter_dimb = $dimb ? "AND ecodimb = {$dimb}"
: '';
+ $dimb
= (int) $dimb;
+ $filter_dimb =
$dimb ? "AND ecodimb = {$dimb}" : '';
$this->db->query("SELECT user_id FROM
fm_ecodimb_role_user WHERE user_id = {$this->account_id} AND role_id IN (1, 2,
3) {$filter_dimb} AND expired_on IS NULL AND active_from < " . time() . ' AND
(active_to > ' . time() . ' OR active_to = 0)');
$this->db->next_record();
- $this->role['is_janitor'] =
!!$this->db->f('user_id');
+ $this->role['is_janitor'] =
!!$this->db->f('user_id');
$this->db->query("SELECT user_id FROM
fm_ecodimb_role_user WHERE user_id = {$this->account_id} AND role_id IN (2, 3)
{$filter_dimb} AND expired_on IS NULL AND active_from < " . time() . ' AND
(active_to > ' . time() . ' OR active_to = 0)');
$this->db->next_record();
@@ -1186,7 +1186,7 @@
function get_dimb_role_user($role_id, $dimb = '', $selected =
'')
{
$filter_dimb = $dimb ? "AND ecodimb = {$dimb}" : '';
- $role_id = (int) $role_id;
+ $role_id = (int) $role_id;
switch($role_id)
{
case 1:
@@ -1216,8 +1216,8 @@
$values = array();
while($this->db->next_record())
{
- $id = $this->db->f('account_lid');
- $values[] = array
+ $id =
$this->db->f('account_lid');
+ $values[] = array
(
'id' => $id,
'name' =>
$this->db->f('account_lastname') . ', ' . $this->db->f('account_firstname'),
@@ -1229,9 +1229,9 @@
function get_default_dimb_role_user($role_id, $dimb)
{
- $dimb = (int) $dimb;
+ $dimb = (int) $dimb;
$role_id = (int) $role_id;
- $sql = "SELECT user_id FROM fm_ecodimb_role_user"
+ $sql = "SELECT user_id FROM fm_ecodimb_role_user"
. " WHERE role_id = {$role_id} AND ecodimb = {$dimb}
AND expired_on IS NULL AND default_user = 1 AND active_from < " . time() . '
AND (active_to > ' . time() . ' OR active_to = 0)';
//_debug_array($sql);
$this->db->query($sql, __LINE__, __FILE__);
@@ -1242,7 +1242,8 @@
function check_count($voucher_id)
{
- $this->db->query("SELECT count(id) as invoice_count,
count(dima) as dima_count, count(spbudact_code) as spbudact_code_count FROM
fm_ecobilag WHERE bilagsnr ='$voucher_id'");
+ $this->db->query("SELECT count(id) AS invoice_count,
count(dima) AS dima_count, count(spbudact_code) AS spbudact_code_count,
count(dimd) AS dimd_count"
+ . " FROM fm_ecobilag WHERE bilagsnr ='{$voucher_id}'");
$this->db->next_record();
$check_count = array
@@ -1250,6 +1251,7 @@
'dima_count' =>
$this->db->f('dima_count'),
'spbudact_code_count' =>
$this->db->f('spbudact_code_count'),
'invoice_count' =>
$this->db->f('invoice_count'),
+ 'dimd_count' =>
$this->db->f('dimd_count'),
);
$this->db->query("select count(kostra_id) as
kostra_count from fm_ecobilag where bilagsnr ='$voucher_id' and kostra_id >
0");
@@ -1309,12 +1311,12 @@
function increment_bilagsnr()
{
- $name = 'Bilagsnummer';
- $now = time();
+ $name = 'Bilagsnummer';
+ $now = time();
$this->db->query("SELECT value, start_date FROM
fm_idgenerator WHERE name = '{$name}' AND start_date < {$now} ORDER BY
start_date DESC");
$this->db->next_record();
- $bilagsnr = $this->db->f('value') + 1;
- $start_date = (int) $this->db->f('start_date');
+ $bilagsnr = $this->db->f('value') + 1;
+ $start_date = (int) $this->db->f('start_date');
$this->db->query("UPDATE fm_idgenerator SET value =
value + 1 WHERE name = '{$name}' AND start_date = $start_date");
return $bilagsnr;
@@ -1322,11 +1324,11 @@
function next_bilagsnr()
{
- $name = 'Bilagsnummer';
- $now = time();
+ $name = 'Bilagsnummer';
+ $now = time();
$this->db->query("SELECT value FROM fm_idgenerator
WHERE name = '{$name}' AND start_date < {$now} ORDER BY start_date DESC");
$this->db->next_record();
- $bilagsnr = $this->db->f('value') + 1;
+ $bilagsnr = $this->db->f('value') + 1;
return $bilagsnr;
}
@@ -1344,8 +1346,8 @@
$values = array();
while($this->db->next_record())
{
- $id = $this->db->f('id');
- $values[] = array
+ $id = $this->db->f('id');
+ $values[] = array
(
'id' => $id,
'name' => $id,
@@ -1388,25 +1390,25 @@
//----------
function select_dimb_list($selected = 0)
{
- $selected = (int) $selected;
- $include_selected = false;
+ $selected = (int) $selected;
+ $include_selected = false;
if(isset($this->config->config_data['invoice_acl']) &&
$this->config->config_data['invoice_acl'] == 'dimb')
{
- $sql = "SELECT DISTINCT fm_ecodimb.* FROM
fm_ecodimb {$this->db->join} fm_ecodimb_role_user ON fm_ecodimb.id =
fm_ecodimb_role_user.ecodimb"
+ $sql = "SELECT
DISTINCT fm_ecodimb.* FROM fm_ecodimb {$this->db->join} fm_ecodimb_role_user ON
fm_ecodimb.id = fm_ecodimb_role_user.ecodimb"
. ' WHERE fm_ecodimb_role_user.user_id = ' .
(int) $this->account_id
. ' AND expired_on IS NULL'
. ' ORDER BY descr ASC';
- $include_selected = true;
+ $include_selected = true;
}
else
{
$sql = "SELECT * FROM fm_ecodimb ORDER BY descr
ASC";
}
- $selected_found = false;
+ $selected_found = false;
$this->db->query($sql);
- $dimb_list = array();
+ $dimb_list = array();
while($this->db->next_record())
{
$id = $this->db->f('id');
@@ -1492,8 +1494,8 @@
$table = 'fm_ecobilagoverf';
}
- $bilagsnr = (int) $bilagsnr;
- $id = (int) $id;
+ $bilagsnr = (int) $bilagsnr;
+ $id = (int) $id;
if($bilagsnr)
{
@@ -1617,144 +1619,150 @@
if(!($check_count['dima_count']
== $values['invoice_count'][$n]))
{
- $receipt['error'][] =
array('msg' => lang('Dima is missing from sub invoice in:') . " " .
$values['voucher_id'][$n]);
- $local_error = true;
+ $receipt['error'][]
= array('msg' => lang('Dima is missing from sub invoice in:') . " " .
$values['voucher_id'][$n]);
+ $local_error
= true;
}
if(!($check_count['spbudact_code_count'] == $values['invoice_count'][$n]))
{
- $receipt['error'][] =
array('msg' => lang('Budget code is missing from sub invoice in :') . " " .
$values['voucher_id'][$n]);
- $local_error = true;
+ $receipt['error'][]
= array('msg' => lang('Budget code is missing from sub invoice in :') . " " .
$values['voucher_id'][$n]);
+ $local_error
= true;
}
+ if($check_count['dimd_count']
!= $check_count['invoice_count'])
+ {
+ $receipt['error'][]
= array('msg' => lang('Dim D is mandatory') . ": {$values['voucher_id'][$n]}");
+ $local_error
= true;
+ }
+
if(!($check_count['kostra_count'] == $values['invoice_count'][$n]))
{
- $receipt['error'][] =
array('msg' => 'Tjenestekode mangler for undebilag: ' . " " .
$values['voucher_id'][$n]);
- $local_error = true;
+ $receipt['error'][]
= array('msg' => 'Tjenestekode mangler for undebilag: ' . " " .
$values['voucher_id'][$n]);
+ $local_error
= true;
}
if($this->check_claim($voucher_id))
{
- $receipt['error'][] =
array('msg' => lang('Tenant claim is not issued for project in voucher %1',
$voucher_id));
- $local_error = true;
+ $receipt['error'][]
= array('msg' => lang('Tenant claim is not issued for project in voucher %1',
$voucher_id));
+ $local_error
= true;
}
- $blank_date = '';
- $sign_field = '';
- $sign_id = '';
- $sign_date_field = '';
- $sign_date = '';
- $kommma = '';
+ $blank_date
= '';
+ $sign_field
= '';
+ $sign_id
= '';
+ $sign_date_field = '';
+ $sign_date
= '';
+ $kommma
= '';
$wait_for_kreditnota = '';
- $user_lid =
$GLOBALS['phpgw_info']['user']['account_lid'];
+ $user_lid
= $GLOBALS['phpgw_info']['user']['account_lid'];
if(($values['sign'][$n] ==
'sign_none') && ($values['sign_orig'][$n] == 'sign_janitor'))
{
- $blank_date =
'oppsynsigndato= NULL';
- $sign_field = '';
- $sign_id = '';
+ $blank_date
= 'oppsynsigndato= NULL';
+ $sign_field
= '';
+ $sign_id
= '';
$sign_date_field = '';
- $sign_date = '';
- $kommma = '';
+ $sign_date
= '';
+ $kommma
= '';
}
else if(($values['sign'][$n] ==
'sign_none') && ($values['sign_orig'][$n] == 'sign_supervisor'))
{
- $blank_date =
'saksigndato= NULL';
- $sign_field = '';
- $sign_id = '';
+ $blank_date
= 'saksigndato= NULL';
+ $sign_field
= '';
+ $sign_id
= '';
$sign_date_field = '';
- $sign_date = '';
- $kommma = '';
+ $sign_date
= '';
+ $kommma
= '';
}
else if(($values['sign'][$n] ==
'sign_none') && ($values['sign_orig'][$n] == 'sign_budget_responsible'))
{
- $blank_date =
'budsjettsigndato= NULL';
- $sign_field = '';
- $sign_id = '';
+ $blank_date
= 'budsjettsigndato= NULL';
+ $sign_field
= '';
+ $sign_id
= '';
$sign_date_field = '';
- $sign_date = '';
- $kommma = '';
+ $sign_date
= '';
+ $kommma
= '';
}
else if($values['sign'][$n] ==
'sign_janitor' && !$values['sign_orig'][$n])
{
- $blank_date = '';
- $sign_field =
'oppsynsmannid=';
- $sign_id =
"'$user_lid'";
+ $blank_date
= '';
+ $sign_field
= 'oppsynsmannid=';
+ $sign_id
= "'$user_lid'";
$sign_date_field =
'oppsynsigndato=';
- $sign_date = "'" .
date($this->db->datetime_format()) . "'";
- $kommma = ",";
+ $sign_date
= "'" . date($this->db->datetime_format()) . "'";
+ $kommma
= ",";
}
else if($values['sign'][$n] ==
'sign_janitor' && $values['sign_orig'][$n] == 'sign_supervisor')
{
- $blank_date =
'saksigndato= NULL';
- $sign_field =
'oppsynsmannid=';
- $sign_id =
"'$user_lid'";
+ $blank_date
= 'saksigndato= NULL';
+ $sign_field
= 'oppsynsmannid=';
+ $sign_id
= "'$user_lid'";
$sign_date_field =
'oppsynsigndato=';
- $sign_date = "'" .
date($this->db->datetime_format()) . "'";
- $kommma = ",";
+ $sign_date
= "'" . date($this->db->datetime_format()) . "'";
+ $kommma
= ",";
}
else if($values['sign'][$n] ==
'sign_janitor' && $values['sign_orig'][$n] == 'sign_budget_responsible')
{
- $blank_date =
'budsjettsigndato= NULL';
- $sign_field =
'oppsynsmannid=';
- $sign_id =
"'$user_lid'";
+ $blank_date
= 'budsjettsigndato= NULL';
+ $sign_field
= 'oppsynsmannid=';
+ $sign_id
= "'$user_lid'";
$sign_date_field =
'oppsynsigndato=';
- $sign_date = "'" .
date($this->db->datetime_format()) . "'";
- $kommma = ",";
+ $sign_date
= "'" . date($this->db->datetime_format()) . "'";
+ $kommma
= ",";
}
else if($values['sign'][$n] ==
'sign_supervisor' && !$values['sign_orig'][$n])
{
- $blank_date = '';
- $sign_field =
'saksbehandlerid=';
- $sign_id =
"'$user_lid'";
+ $blank_date
= '';
+ $sign_field
= 'saksbehandlerid=';
+ $sign_id
= "'$user_lid'";
$sign_date_field =
'saksigndato=';
- $sign_date = "'" .
date($this->db->datetime_format()) . "'";
- $kommma = ",";
+ $sign_date
= "'" . date($this->db->datetime_format()) . "'";
+ $kommma
= ",";
}
else if($values['sign'][$n] ==
'sign_supervisor' && $values['sign_orig'][$n] == 'sign_janitor')
{
- $blank_date =
'oppsynsigndato= NULL';
- $sign_field =
'saksbehandlerid=';
- $sign_id =
"'$user_lid'";
+ $blank_date
= 'oppsynsigndato= NULL';
+ $sign_field
= 'saksbehandlerid=';
+ $sign_id
= "'$user_lid'";
$sign_date_field =
'saksigndato=';
- $sign_date = "'" .
date($this->db->datetime_format()) . "'";
- $kommma = ",";
+ $sign_date
= "'" . date($this->db->datetime_format()) . "'";
+ $kommma
= ",";
}
else if($values['sign'][$n] ==
'sign_supervisor' && $values['sign_orig'][$n] == 'sign_budget_responsible')
{
- $blank_date =
'budsjettsigndato= NULL';
- $sign_field =
'saksbehandlerid=';
- $sign_id =
"'$user_lid'";
+ $blank_date
= 'budsjettsigndato= NULL';
+ $sign_field
= 'saksbehandlerid=';
+ $sign_id
= "'$user_lid'";
$sign_date_field =
'saksigndato=';
- $sign_date = "'" .
date($this->db->datetime_format()) . "'";
- $kommma = ",";
+ $sign_date
= "'" . date($this->db->datetime_format()) . "'";
+ $kommma
= ",";
}
else if($values['sign'][$n] ==
'sign_budget_responsible' && $values['sign_orig'][$n] == 'sign_janitor')
{
- $blank_date =
'oppsynsigndato= NULL';
- $sign_field =
'budsjettansvarligid=';
- $sign_id =
"'$user_lid'";
+ $blank_date
= 'oppsynsigndato= NULL';
+ $sign_field
= 'budsjettansvarligid=';
+ $sign_id
= "'$user_lid'";
$sign_date_field =
'budsjettsigndato=';
- $sign_date = "'" .
date($this->db->datetime_format()) . "'";
- $kommma = ",";
+ $sign_date
= "'" . date($this->db->datetime_format()) . "'";
+ $kommma
= ",";
}
else if($values['sign'][$n] ==
'sign_budget_responsible' && $values['sign_orig'][$n] == 'sign_supervisor')
{
- $blank_date =
'saksigndato= NULL';
- $sign_field =
'budsjettansvarligid=';
- $sign_id =
"'$user_lid'";
+ $blank_date
= 'saksigndato= NULL';
+ $sign_field
= 'budsjettansvarligid=';
+ $sign_id
= "'$user_lid'";
$sign_date_field =
'budsjettsigndato=';
- $sign_date = "'" .
date($this->db->datetime_format()) . "'";
- $kommma = ",";
+ $sign_date
= "'" . date($this->db->datetime_format()) . "'";
+ $kommma
= ",";
}
else if($values['sign'][$n] ==
'sign_budget_responsible' && !$values['sign_orig'][$n])
{
- $blank_date = '';
- $sign_field =
'budsjettansvarligid=';
- $sign_id =
"'$user_lid'";
+ $blank_date
= '';
+ $sign_field
= 'budsjettansvarligid=';
+ $sign_id
= "'$user_lid'";
$sign_date_field =
'budsjettsigndato=';
- $sign_date = "'" .
date($this->db->datetime_format()) . "'";
- $kommma = ",";
+ $sign_date
= "'" . date($this->db->datetime_format()) . "'";
+ $kommma
= ",";
}
@@ -1776,27 +1784,27 @@
$GLOBALS['phpgw']->db->query("UPDATE fm_ecobilag set forfallsdato=
'$payment_date' where bilagsnr='$voucher_id'");
}
- $transfer_id = "Null" . ",";
- $transfer_date = "Null";
+ $transfer_id = "Null" . ",";
+ $transfer_date = "Null";
if($values['transfer'][$n])
{
if($this->check_for_transfer($voucher_id))
{
- $transfer_id =
"'$user_lid',";
- $transfer_date
= "'" . date($this->db->datetime_format()) . "'";
+ $transfer_id
= "'$user_lid',";
+ $transfer_date
= "'" . date($this->db->datetime_format()) . "'";
}
else
{
-
$receipt['error'][] = array('msg' => 'Dette bilaget er ikkje godkjent: ' . " "
. $voucher_id);
- $local_error =
true;
+
$receipt['error'][] = array('msg' => 'Dette bilaget er ikkje godkjent: ' .
" " . $voucher_id);
+ $local_error
= true;
}
}
if($values['kreditnota'][$n])
{
$wait_for_kreditnota =
1;
- $transfer_date = "Null";
+ $transfer_date
= "Null";
}
else
{
@@ -1892,8 +1900,8 @@
$values = array();
while($this->db->next_record())
{
- $periode = $this->db->f('periode');
- $values[] = array
+ $periode = $this->db->f('periode');
+ $values[] = array
(
'id' => $periode,
'name' => $periode
@@ -1907,7 +1915,7 @@
{
break;
}
- $sql = "SELECT count(id) as cnt FROM
fm_ecobilagoverf WHERE periode = {$periode['id']}";
+ $sql = "SELECT count(id) as
cnt FROM fm_ecobilagoverf WHERE periode = {$periode['id']}";
$this->db->query($sql, __LINE__, __FILE__);
$this->db->next_record();
$periode['name'] = $periode['name'] . ' [' .
sprintf("%010s", $this->db->f('cnt')) . ']';
@@ -1980,11 +1988,11 @@
}
else if(isset($data['forward']) &&
is_array($data['forward']) && isset($data['voucher_id']) && $data['voucher_id'])
{
- $condition = 'WHERE bilagsnr =' . (int)
$data['voucher_id'];
- $global_check = true;
+ $condition = 'WHERE bilagsnr =' .
(int) $data['voucher_id'];
+ $global_check = true;
}
- $receipt = array();
+ $receipt = array();
$local_error = false;
if($condition)
{
@@ -2011,6 +2019,12 @@
$local_error = true;
}
+ if($check_count['dimd_count'] !=
$check_count['invoice_count'])
+ {
+
phpgwapi_cache::message_set(lang('Dim D is mandatory') . ":
{$data['voucher_id']}", 'error');
+ $local_error = true;
+ }
+
if($this->check_claim($data['voucher_id']))
{
phpgwapi_cache::message_set(lang('Tenant claim is not issued for project in
voucher %1', $data['voucher_id']), 'error');
@@ -2045,29 +2059,29 @@
switch($data['sign_orig'])
{
case 'is_janitor':
-
$value_set['oppsynsigndato'] = null;
+
$value_set['oppsynsigndato'] = null;
break;
case 'is_supervisor':
-
$value_set['saksigndato'] = null;
+
$value_set['saksigndato'] = null;
break;
case 'is_budget_responsible':
-
$value_set['budsjettsigndato'] = null;
+
$value_set['budsjettsigndato'] = null;
break;
}
switch($data['approve'])
{
case 'is_janitor':
-
$value_set['oppsynsigndato'] = date($this->db->datetime_format());
-
$value_set['oppsynsmannid'] = $data['my_initials'];
+
$value_set['oppsynsigndato'] = date($this->db->datetime_format());
+
$value_set['oppsynsmannid'] = $data['my_initials'];
break;
case 'is_supervisor':
-
$value_set['saksigndato'] = date($this->db->datetime_format());
-
$value_set['saksbehandlerid'] = $data['my_initials'];
+
$value_set['saksigndato'] =
date($this->db->datetime_format());
+
$value_set['saksbehandlerid'] = $data['my_initials'];
break;
case 'is_budget_responsible':
-
$value_set['budsjettsigndato'] = date($this->db->datetime_format());
-
$value_set['budsjettansvarligid'] = $data['my_initials'];
+
$value_set['budsjettsigndato'] = date($this->db->datetime_format());
+
$value_set['budsjettansvarligid'] = $data['my_initials'];
break;
}
}
@@ -2088,10 +2102,10 @@
function get_order_info($order_id)
{
- $order_info = array();
- $toarray = array();
- $order_id = (int) $order_id;
- $sql = "SELECT
fm_workorder.location_code,fm_workorder.vendor_id,fm_workorder.account_id,fm_workorder.ecodimb,fm_workorder.category,
fm_workorder.user_id,fm_workorder.title"
+ $order_info = array();
+ $toarray = array();
+ $order_id = (int) $order_id;
+ $sql = "SELECT
fm_workorder.location_code,fm_workorder.vendor_id,fm_workorder.account_id,fm_workorder.ecodimb,fm_workorder.category,
fm_workorder.user_id,fm_workorder.title"
. " FROM fm_workorder {$this->join} fm_project ON
fm_workorder.project_id = fm_project.id WHERE fm_workorder.id = {$order_id}";
$this->db->query($sql, __LINE__, __FILE__);
if($this->db->next_record())
@@ -2100,20 +2114,20 @@
}
if($this->db->f('location_code'))
{
- $parts = explode('-',
$this->db->f('location_code'));
- $order_info['dima'] = implode('', $parts);
- $order_info['loc1'] = $parts[0];
+ $parts = explode('-',
$this->db->f('location_code'));
+ $order_info['dima'] = implode('', $parts);
+ $order_info['loc1'] = $parts[0];
}
- $order_info['vendor_id'] = $this->db->f('vendor_id');
+ $order_info['vendor_id'] =
$this->db->f('vendor_id');
$order_info['spbudact_code'] =
$this->db->f('account_id');
- $order_info['dimb'] = $this->db->f('ecodimb');
- $order_info['dime'] = $this->db->f('category');
- $order_info['title'] = $this->db->f('title', true);
+ $order_info['dimb'] =
$this->db->f('ecodimb');
+ $order_info['dime'] =
$this->db->f('category');
+ $order_info['title'] =
$this->db->f('title', true);
- $janitor_user_id = $this->db->f('user_id');
- $order_info['janitor'] =
$GLOBALS['phpgw']->accounts->get($janitor_user_id)->lid;
- $supervisor_user_id =
$this->get_default_dimb_role_user(2, $order_info['dimb']);
+ $janitor_user_id =
$this->db->f('user_id');
+ $order_info['janitor'] =
$GLOBALS['phpgw']->accounts->get($janitor_user_id)->lid;
+ $supervisor_user_id =
$this->get_default_dimb_role_user(2, $order_info['dimb']);
if($supervisor_user_id)
{
$order_info['supervisor'] =
$GLOBALS['phpgw']->accounts->get($supervisor_user_id)->lid;
@@ -2147,9 +2161,9 @@
$this->db->query("SELECT * FROM fm_ecobilag WHERE id ="
. (int) $line_id, __LINE__, __FILE__);
$this->db->next_record();
- $old_janitor = $this->db->f('oppsynsmannid');
- $old_supervisor = $this->db->f('saksbehandlerid');
- $old_budget_responsible =
$this->db->f('budsjettansvarligid');
+ $old_janitor =
$this->db->f('oppsynsmannid');
+ $old_supervisor =
$this->db->f('saksbehandlerid');
+ $old_budget_responsible =
$this->db->f('budsjettansvarligid');
$value_set = array();
@@ -2168,18 +2182,18 @@
$value_set['budsjettsigndato'] = '';
}
- $value_set['pmwrkord_code'] = $order_id;
- $value_set['dima'] = $order_info['dima'];
- $value_set['dimb'] = $order_info['dimb'];
- $value_set['dime'] = $order_info['dime'];
- $value_set['loc1'] = $order_info['loc1'];
- $value_set['line_text'] = $order_info['title'];
- $value_set['spbudact_code'] =
$order_info['spbudact_code'];
- $value_set['oppsynsmannid'] = $order_info['janitor'];
- $value_set['saksbehandlerid'] =
$order_info['supervisor'];
- $value_set['budsjettansvarligid'] =
$order_info['budget_responsible'];
- $value_set['project_id'] =
execMethod('property.soXport.get_project', $order_id);
- $value_set = $this->db->validate_update($value_set);
+ $value_set['pmwrkord_code'] =
$order_id;
+ $value_set['dima']
= $order_info['dima'];
+ $value_set['dimb']
= $order_info['dimb'];
+ $value_set['dime']
= $order_info['dime'];
+ $value_set['loc1']
= $order_info['loc1'];
+ $value_set['line_text'] =
$order_info['title'];
+ $value_set['spbudact_code'] =
$order_info['spbudact_code'];
+ $value_set['oppsynsmannid'] =
$order_info['janitor'];
+ $value_set['saksbehandlerid'] =
$order_info['supervisor'];
+ $value_set['budsjettansvarligid'] =
$order_info['budget_responsible'];
+ $value_set['project_id'] =
execMethod('property.soXport.get_project', $order_id);
+ $value_set
= $this->db->validate_update($value_set);
$this->db->query("UPDATE fm_ecobilag SET $value_set
WHERE id =" . (int) $line_id, __LINE__, __FILE__);
return $GLOBALS['phpgw']->db->transaction_commit();
}
@@ -2211,10 +2225,10 @@
$GLOBALS['phpgw']->db->transaction_begin();
$value_set = array();
- $value_set['periode'] = $data['period'];
- $value_set['periodization'] = $data['periodization'];
- $value_set['periodization_start'] =
$data['periodization_start'];
- $value_set['kreditnota'] = !!$data['park_invoice'];
+ $value_set['periode'] =
$data['period'];
+ $value_set['periodization'] =
$data['periodization'];
+ $value_set['periodization_start'] =
$data['periodization_start'];
+ $value_set['kreditnota'] =
!!$data['park_invoice'];
$value_set = $this->db->validate_update($value_set);
$this->db->query("UPDATE fm_ecobilag SET $value_set
WHERE bilagsnr =" . (int) $data['voucher_id'], __LINE__, __FILE__);
@@ -2223,15 +2237,15 @@
$value_set_line = array();
$value_set_line['pmwrkord_code'] = $data['order_id'];
- $value_set_line['dimb'] = $data['dim_b'];
- $value_set_line['dima'] = $data['dim_a'];
- $value_set_line['dime'] = $data['dim_e'];
- $value_set_line['mvakode'] = $data['tax_code'];
- $value_set_line['project_id'] = $data['project_group'];
+ $value_set_line['dimb'] =
$data['dim_b'];
+ $value_set_line['dima'] =
$data['dim_a'];
+ $value_set_line['dime'] =
$data['dim_e'];
+ $value_set_line['mvakode'] =
$data['tax_code'];
+ $value_set_line['project_id'] =
$data['project_group'];
$value_set_line['spbudact_code'] =
$data['b_account_id'];
- $value_set_line['line_text'] =
$this->db->db_addslashes($data['line_text']);
- $value_set_line['process_log'] =
$this->db->db_addslashes($data['process_log']);
- $value_set_line['process_code'] = $data['process_code'];
+ $value_set_line['line_text'] =
$this->db->db_addslashes($data['line_text']);
+ $value_set_line['process_log'] =
$this->db->db_addslashes($data['process_log']);
+ $value_set_line['process_code'] =
$data['process_code'];
$value_set_line =
$this->db->validate_update($value_set_line);
$this->db->query("UPDATE fm_ecobilag SET
{$value_set_line} WHERE id = " . (int) $data['line_id'], __LINE__, __FILE__);
@@ -2245,8 +2259,8 @@
switch($this->db->f('type'))
{
case 'workorder':
- $value_set_line['account_id'] =
$data['b_account_id'];
- $value_set_line['category'] =
$data['dim_e'];
+ $value_set_line['account_id']
= $data['b_account_id'];
+ $value_set_line['category']
= $data['dim_e'];
$value_set_line =
$this->db->validate_update($value_set_line);
$this->db->query("UPDATE
fm_workorder SET {$value_set_line} WHERE id='{$data['order_id']}'");
@@ -2308,8 +2322,8 @@
}
}
- $metadata = $this->db->metadata($table);
- $sql = "SELECT * FROM {$table} WHERE
id= {$id}";
+ $metadata =
$this->db->metadata($table);
+ $sql = "SELECT * FROM
{$table} WHERE id= {$id}";
$this->db->query($sql, __LINE__,
__FILE__);
$this->db->next_record();
@@ -2331,21 +2345,21 @@
$new_id =
$this->db->get_last_insert_id($table, 'id');
- $value_set = array
+ $value_set = array
(
'belop' =>
$split_amount,
'godkjentbelop' =>
$split_amount
);
- $value_set =
$this->db->validate_update($value_set);
+ $value_set =
$this->db->validate_update($value_set);
$this->db->query("UPDATE {$table} SET
$value_set WHERE id= {$id}", __LINE__, __FILE__);
- $value_set = array
+ $value_set = array
(
'belop' =>
$amount - $split_amount,
'godkjentbelop' => $amount -
$split_amount,
'splitt' => $id
);
- $value_set =
$this->db->validate_update($value_set);
+ $value_set =
$this->db->validate_update($value_set);
$this->db->query("UPDATE {$table} SET
$value_set WHERE id= {$new_id}", __LINE__, __FILE__);
}
}
@@ -2400,9 +2414,9 @@
public function get_vouchers($data)
{
- $filtermethod = '';
- $querymethod = '';
- $where = 'WHERE';
+ $filtermethod = '';
+ $querymethod = '';
+ $where = 'WHERE';
if($data['janitor_lid'])
{
@@ -2410,7 +2424,7 @@
{
$data['janitor_lid'] =
ltrim($data['janitor_lid'], '*');
$filtermethod .= " $where
oppsynsigndato IS NULL";
- $where = 'AND';
+ $where =
'AND';
}
$filtermethod .= " $where oppsynsmannid =
'{$data['janitor_lid']}'";
$where = 'AND';
@@ -2420,10 +2434,10 @@
{
if(stripos($data['supervisor_lid'], '*') === 0)
{
- $data['supervisor_lid'] =
ltrim($data['supervisor_lid'], '*');
+ $data['supervisor_lid'] =
ltrim($data['supervisor_lid'], '*');
// $filtermethod
.= " $where oppsynsigndato IS NOT NULL AND saksigndato IS NULL";
$filtermethod .= " $where saksigndato
IS NULL";
- $where = 'AND';
+ $where
= 'AND';
}
$filtermethod .= " $where saksbehandlerid =
'{$data['supervisor_lid']}'";
@@ -2434,9 +2448,9 @@
{
if(stripos($data['budget_responsible_lid'],
'*') === 0)
{
- $data['budget_responsible_lid'] =
ltrim($data['budget_responsible_lid'], '*');
+ $data['budget_responsible_lid'] =
ltrim($data['budget_responsible_lid'], '*');
$filtermethod .= " $where saksigndato
IS NOT NULL AND budsjettsigndato IS NULL";
- $where = 'AND';
+ $where
= 'AND';
}
$filtermethod .= " $where budsjettansvarligid =
'{$data['budget_responsible_lid']}'";
$where = 'AND';
@@ -2447,32 +2461,32 @@
switch($data['criteria'])
{
case 'voucher_id':
- $query = (int) $data['query'];
+ $query = (int)
$data['query'];
$querymethod = " $where
(bilagsnr = {$query} OR bilagsnr_ut = {$query})";
break;
case 'invoice_id':
- $query = $data['query'];
+ $query =
$data['query'];
$querymethod = " $where
fakturanr = '{$query}'";
break;
case 'order_id':
- $query = $data['query'];
+ $query =
$data['query'];
$querymethod = " $where
pmwrkord_code = '{$query}'";
break;
case 'vendor_id':
- $query = (int) $data['query'];
+ $query = (int)
$data['query'];
$querymethod = " $where
(spvend_code = {$query} OR org_name {$this->like} '%{$data['query']}%')";
break;
case 'b_account':
- $query = $data['query'];
+ $query =
$data['query'];
$querymethod = " $where
spbudact_code = '{$query}'";
break;
case 'dimb':
- $query = (int) $data['query'];
+ $query = (int)
$data['query'];
$querymethod = " $where dimb =
{$query}";
break;
@@ -2488,13 +2502,13 @@
. " {$this->join} fm_ecoart ON fm_ecoart.id =
fm_ecobilag.artid"
. " $filtermethod $querymethod ORDER BY forfallsdato
ASC, bilagsnr ASC";
- $lang_voucer = lang('voucher id');
- $lang_vendor = lang('vendor');
- $lang_currency = lang('currency');
- $lang_parked = lang('parked');
- $lang_type = lang('type');
- $lang_approved_amount = lang('approved amount');
- $lang_payment_date = lang('payment date');
+ $lang_voucer = lang('voucher id');
+ $lang_vendor = lang('vendor');
+ $lang_currency = lang('currency');
+ $lang_parked = lang('parked');
+ $lang_type = lang('type');
+ $lang_approved_amount = lang('approved amount');
+ $lang_payment_date = lang('payment date');
$this->db->query($sql, __LINE__, __FILE__);
$values = array();
@@ -2503,12 +2517,12 @@
{
$bilagsnr = $this->db->f('bilagsnr');
- $values[$bilagsnr]['bilagsnr_ut'] =
$this->db->f('bilagsnr_ut');
- $values[$bilagsnr]['org_name'] =
$this->db->f('org_name', true);
- $values[$bilagsnr]['currency'] =
$this->db->f('currency');
- $values[$bilagsnr]['kreditnota'] =
$this->db->f('kreditnota');
- $values[$bilagsnr]['type'] =
$this->db->f('type');
- $values[$bilagsnr]['payment_date'] =
$this->db->f('forfallsdato');
+ $values[$bilagsnr]['bilagsnr_ut'] =
$this->db->f('bilagsnr_ut');
+ $values[$bilagsnr]['org_name'] =
$this->db->f('org_name', true);
+ $values[$bilagsnr]['currency'] =
$this->db->f('currency');
+ $values[$bilagsnr]['kreditnota'] =
$this->db->f('kreditnota');
+ $values[$bilagsnr]['type']
= $this->db->f('type');
+ $values[$bilagsnr]['payment_date'] =
$this->db->f('forfallsdato');
if(isset($values[$bilagsnr]['godkjentbelop']))
{
@@ -2539,12 +2553,12 @@
$voucers = array();
foreach($values as $bilagsnr => $entry)
{
- $payment_date =
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
strtotime($entry['payment_date']));
- $status = $entry['status'];
+ $payment_date =
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
strtotime($entry['payment_date']));
+ $status = $entry['status'];
sort($status);
- $voucher_id = $entry['bilagsnr_ut'] ?
$entry['bilagsnr_ut'] : $bilagsnr;
- $name = sprintf("{$lang_payment_date}: % 10s |
{$lang_voucer}:% 8s | {$lang_vendor}: % 50s | {$lang_currency}: % 3s |
{$lang_parked}: % 1s | {$lang_type}: % 12s | {$lang_approved_amount}: % 19s |
Status: % 1s", $payment_date, $voucher_id,
trim(strtoupper($entry['org_name'])), $entry['currency'], $entry['kreditnota']
? 'X' : '', $entry['type'], number_format($entry['godkjentbelop'], 2, ',', '
'), $status[0]
+ $voucher_id = $entry['bilagsnr_ut'] ?
$entry['bilagsnr_ut'] : $bilagsnr;
+ $name =
sprintf("{$lang_payment_date}: % 10s | {$lang_voucer}:% 8s | {$lang_vendor}: %
50s | {$lang_currency}: % 3s | {$lang_parked}: % 1s | {$lang_type}: % 12s |
{$lang_approved_amount}: % 19s | Status: % 1s", $payment_date, $voucher_id,
trim(strtoupper($entry['org_name'])), $entry['currency'], $entry['kreditnota']
? 'X' : '', $entry['type'], number_format($entry['godkjentbelop'], 2, ',', '
'), $status[0]
);
$voucers[] = array
@@ -2559,8 +2573,8 @@
public function get_auto_generated_invoice_num($vendor_id)
{
- $vendor_id = (int) $vendor_id;
- $sql = "SELECT max(cast(fakturanr as int)) as
invoice_num FROM fm_ecobilagoverf WHERE spvend_code = {$vendor_id}";
+ $vendor_id = (int) $vendor_id;
+ $sql = "SELECT max(cast(fakturanr as int))
as invoice_num FROM fm_ecobilagoverf WHERE spvend_code = {$vendor_id}";
$this->db->query($sql, __LINE__, __FILE__);
$this->db->next_record();
$invoice_num = $this->db->f('invoice_num') + 1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [11687] Merge 11685:11686 from trunk,
Sigurd Nes <=