caran
Posts: 15
|
Posted: 04/04/2013, 12:13 PM |
|
Sorry that i ask.... I must overread about hundred times, but i didn't find...
//leistungsposition_Button_Submit_OnClick @159-6760B24E
function leistungsposition_Button_Submit_OnClick(& $sender)
{
$leistungsposition_Button_Submit_OnClick = true;
$Component = & $sender;
$Container = & CCGetParentContainer($sender);
global $leistungsposition; //Compatibility
//End leistungsposition_Button_Submit_OnClick
//Custom Code @174-2A29BDB7
// -------------------------
// Stoffstromsatz schreiben, zuerst loeschen wenn er schon existiert (zb nach Aenderung)
global $DBWLPG01;
global $leistungsposition;
$mandid = CCGetSession("mand_id", NULL);
$Page = CCGetParentPage($sender);
$mandlandkz = CCDLookUp("mand_landkz", "mandant", "mand_id = $mandid", $Page->Connections["WLPG01"]);
THERE is the error occure-->
if ($leistungsposition->lpo_art_typ->GetValue() == 1){
$lpoid = $leistungsposition->lpo_id->GetValue();
$sstlpoid = CCDLookUp("lpo_id", "stoffstrom", "lpo_id = $lpoid", $Page->Connections["WLPG01"]);
$sstbglsstatus = CCDLookUp("sst_bglsstatus", "stoffstrom", "lpo_id = $lpoid", $Page->Connections["WLPG01"]);
if (($sstlpoid > 0) and (($sstbglsstatus < 9) or ($sstbglsstatus = null))) {
$ccs_result1 = $DBWLPG01->query("delete from stoffstrom where lpo_id = $lpoid");
}
if ((($sstlpoid > 0) and ($sstbglsstatus < 9)) or $sstlpoid = 0) {
// Buchungsart festlegen
$lstid = CCDLookUp("lst_id", "leistungsposition", "lpo_id = $lpoid", $Page->Connections["WLPG01"]);
$richtung = CCDLookUp("lst_richtung", "leistung", "lst_id = $lstid", $Page->Connections["WLPG01"]);
$streckenr = CCDLookUp("lst_nrstrecke", "leistung", "lst_id = $lstid", $Page->Connections["WLPG01"]);
if ($richtung = 'Eingang') {
$buchart = '9008390101544';
}
if ($richtung = 'Ausgang') {
$buchart = '9008390101643';
}
if ($richtung = 'Strecke') {
if ($streckenr = 1) {
$buchart = '9008390101575';
}
else {
$buchart = '9008390101681';
}
}
}
// GTIN Nace ermitteln - GLN_art_VON/NACH
// Vorläufig hier nicht ermittelt, wird in der BGLSÜbergabe gemacht aus Adresse
// Gewicht ermitteln - Wird in kg benötigt - Wenn Artikelpos nicht to dann muß Umrechnungsfaktorto eingetragen sein
$vgpid = CCDLookUp("lpo_vgp_id", "leistungsposition", "lpo_id = $lpoid", $Page->Connections["WLPG01"]);
$umreto = CCDLookUp("vgp_umrechnungsfaktorto", "vertragsgrundlagenposition", "vgp_id = $vgpid", $Page->Connections["WLPG01"]);
$menge = CCDLookUp("lpo_menge", "leistungsposition", "lpo_id = $lpoid", $Page->Connections["WLPG01"]);
$gewicht = $menge * 1000 * $umreto;
// Schreiben
$ccs_result2 = $DBWLPG01->query("insert into stoffstrom (sst_menge, sst_datum, sst_vongln, sst_nachgln, sst_transportgln, sst_gtin_abfall, sst_fzg_id, lpo_id, sst_bglsnr, sst_bglsnrfremd, sst_abfallcode, sst_mand_id, sst_gtin_entsorgverf, sst_laendercodeherkunft, sst_gtin_transart, sst errechnetkz, sst_gtin_buchungsart, sst_bglsstatus, sst_nrstrecke, sst_menge_eh, sst_gewicht, art_id)
select lpo_menge, lpo_erledigtdatum, lpo_vongln, lpo_nachgln, lpo_transportgln, lpo_art_gtin, lpo_fzg_id, lpo_id, lpo_bglsnr, lpo_bglsnrfremd, lpo_abfallcode, $mandid, '9008390009635', '040', '9008390100059', 2, $buchart, 2, $streckenr, lpo_ein_id, $gewicht, lpo_art_id from leistungsposition
where (lpo_id = $lpoid and lpo_art_typ = 1 and lpo_menge > 0.0 and lpo_bglsnr !='')");
}
// -------------------------
//End Custom Code
//Close leistungsposition_Button_Submit_OnClick @159-EA329798
return $leistungsposition_Button_Submit_OnClick;
}
//End Close leistungsposition_Button_Submit_OnClick
|
|
|
caran
Posts: 15
|
Posted: 04/05/2013, 7:04 AM |
|
one night full of sleep...
i forgot the field 'lpo_art_typ' in the editable grid...
now its solved!
|
|
|
|