STPH#35008: Inboeken van order 4134/2 geen verandering van lopende bestelling.
svn path=/Website/trunk/; revision=27740
This commit is contained in:
@@ -119,7 +119,7 @@ function bes_voorraad_list (pautfunction, params)
|
|||||||
+ " AND bes_srtdeel_verwijder IS NULL"
|
+ " AND bes_srtdeel_verwijder IS NULL"
|
||||||
+ " AND bd2.ins_discipline_key = dp.bes_ins_discipline_key_inkoop) voorraadmin" // Voorraadmin van gekoppelde discipline
|
+ " AND bd2.ins_discipline_key = dp.bes_ins_discipline_key_inkoop) voorraadmin" // Voorraadmin van gekoppelde discipline
|
||||||
+ " , SUM (bi.bes_bestelling_item_aantal) aantal_intern"
|
+ " , SUM (bi.bes_bestelling_item_aantal) aantal_intern"
|
||||||
+ " , TO_NUMBER (NULL) aantal_extern_besteld"
|
+ " , TO_NUMBER (NULL) aantal_open_order"
|
||||||
+ " , TO_NUMBER (NULL) aantal_extern_geleverd"
|
+ " , TO_NUMBER (NULL) aantal_extern_geleverd"
|
||||||
+ " , (SELECT isd2.bes_srtdeel_maxbestel"
|
+ " , (SELECT isd2.bes_srtdeel_maxbestel"
|
||||||
+ " FROM bes_srtdeel isd2"
|
+ " FROM bes_srtdeel isd2"
|
||||||
@@ -209,7 +209,7 @@ function bes_voorraad_list (pautfunction, params)
|
|||||||
+ " , bes_srtdeel_voorraadmax voorraadmax"
|
+ " , bes_srtdeel_voorraadmax voorraadmax"
|
||||||
+ " , bes_srtdeel_voorraadmin voorraadmin"
|
+ " , bes_srtdeel_voorraadmin voorraadmin"
|
||||||
+ " , TO_NUMBER (NULL) aantal_intern"
|
+ " , TO_NUMBER (NULL) aantal_intern"
|
||||||
+ " , SUM (bi.bes_bestelling_item_aantal) aantal_extern_besteld"
|
+ " , SUM (bi.bes_bestelling_item_aantal) - SUM (bi.bes_bestelling_item_aantalontv) aantal_open_order"
|
||||||
+ " , TO_NUMBER (NULL) aantal_extern_geleverd"
|
+ " , TO_NUMBER (NULL) aantal_extern_geleverd"
|
||||||
+ " , sd.bes_srtdeel_maxbestel maxbestel"
|
+ " , sd.bes_srtdeel_maxbestel maxbestel"
|
||||||
+ " , sd.bes_srtdeel_minimum bestelmin"
|
+ " , sd.bes_srtdeel_minimum bestelmin"
|
||||||
@@ -219,10 +219,12 @@ function bes_voorraad_list (pautfunction, params)
|
|||||||
+ " , bes_v_aanwezigsrtdeel sd"
|
+ " , bes_v_aanwezigsrtdeel sd"
|
||||||
+ " , bes_bestelling b"
|
+ " , bes_bestelling b"
|
||||||
+ " , bes_bestelling_item bi"
|
+ " , bes_bestelling_item bi"
|
||||||
|
+ " , bes_bestelopdr_item bo"
|
||||||
+ " , bes_disc_params dp"
|
+ " , bes_disc_params dp"
|
||||||
+ " WHERE sd.bes_srtgroep_key = g.bes_srtgroep_key"
|
+ " WHERE sd.bes_srtgroep_key = g.bes_srtgroep_key"
|
||||||
+ " AND bi.bes_srtdeel_key = sd.bes_srtdeel_key"
|
+ " AND bi.bes_srtdeel_key = sd.bes_srtdeel_key"
|
||||||
+ " AND b.bes_bestelling_key = bi.bes_bestelling_key"
|
+ " AND b.bes_bestelling_key = bi.bes_bestelling_key"
|
||||||
|
+ " AND bi.bes_bestelopdr_item_key = bo.bes_bestelopdr_item_key"
|
||||||
+ " AND g.ins_discipline_key = bd.ins_discipline_key"
|
+ " AND g.ins_discipline_key = bd.ins_discipline_key"
|
||||||
+ " AND bd.ins_discipline_key = dp.bes_ins_discipline_key"
|
+ " AND bd.ins_discipline_key = dp.bes_ins_discipline_key"
|
||||||
+ " AND sd.bes_srtdeel_verwijder IS NULL"
|
+ " AND sd.bes_srtdeel_verwijder IS NULL"
|
||||||
@@ -264,8 +266,8 @@ function bes_voorraad_list (pautfunction, params)
|
|||||||
+ " , bes_srtdeel_voorraadmax voorraadmax"
|
+ " , bes_srtdeel_voorraadmax voorraadmax"
|
||||||
+ " , bes_srtdeel_voorraadmin voorraadmin"
|
+ " , bes_srtdeel_voorraadmin voorraadmin"
|
||||||
+ " , TO_NUMBER (NULL) aantal_intern"
|
+ " , TO_NUMBER (NULL) aantal_intern"
|
||||||
+ " , TO_NUMBER (NULL) aantal_extern_besteld"
|
+ " , TO_NUMBER (NULL) aantal_open_order"
|
||||||
+ " , SUM (bi.bes_bestelling_item_aantal) aantal_extern_geleverd"
|
+ " , SUM (bi.bes_bestelling_item_aantalontv) aantal_extern_geleverd"
|
||||||
+ " , sd.bes_srtdeel_maxbestel maxbestel"
|
+ " , sd.bes_srtdeel_maxbestel maxbestel"
|
||||||
+ " , sd.bes_srtdeel_minimum bestelmin"
|
+ " , sd.bes_srtdeel_minimum bestelmin"
|
||||||
+ " , sd.bes_srtdeel_veelvoud bestelveelvoud"
|
+ " , sd.bes_srtdeel_veelvoud bestelveelvoud"
|
||||||
@@ -274,14 +276,20 @@ function bes_voorraad_list (pautfunction, params)
|
|||||||
+ " , bes_v_aanwezigsrtdeel sd"
|
+ " , bes_v_aanwezigsrtdeel sd"
|
||||||
+ " , bes_bestelling b"
|
+ " , bes_bestelling b"
|
||||||
+ " , bes_bestelling_item bi"
|
+ " , bes_bestelling_item bi"
|
||||||
|
+ " , bes_bestelopdr_item bo"
|
||||||
+ " , bes_disc_params dp"
|
+ " , bes_disc_params dp"
|
||||||
+ " WHERE sd.bes_srtgroep_key = g.bes_srtgroep_key"
|
+ " WHERE sd.bes_srtgroep_key = g.bes_srtgroep_key"
|
||||||
+ " AND bi.bes_srtdeel_key = sd.bes_srtdeel_key"
|
+ " AND bi.bes_srtdeel_key = sd.bes_srtdeel_key"
|
||||||
+ " AND b.bes_bestelling_key = bi.bes_bestelling_key"
|
+ " AND b.bes_bestelling_key = bi.bes_bestelling_key"
|
||||||
|
+ " AND bi.bes_bestelopdr_item_key = bo.bes_bestelopdr_item_key"
|
||||||
+ " AND g.ins_discipline_key = bd.ins_discipline_key"
|
+ " AND g.ins_discipline_key = bd.ins_discipline_key"
|
||||||
+ " AND bd.ins_discipline_key = dp.bes_ins_discipline_key"
|
+ " AND bd.ins_discipline_key = dp.bes_ins_discipline_key"
|
||||||
+ " AND sd.bes_srtdeel_verwijder IS NULL"
|
+ " AND sd.bes_srtdeel_verwijder IS NULL"
|
||||||
+ " AND b.bes_bestelling_status IN (6,7)"
|
// Bestellingstatus 5: Alleen de bestelopdr items waarbij de ontvangen datum is gezet zijn gedeeltelijk of in zijn geheel geleverd.
|
||||||
|
// Bestellingstatus 6 en 7: Bestelopdr is in zijn geheel geleverd.
|
||||||
|
+ " AND (b.bes_bestelling_status IN (6, 7)"
|
||||||
|
+ " OR (bo.bes_bestelopdr_item_ontvangen IS NOT NULL"
|
||||||
|
+ " AND b.bes_bestelling_status IN (5)))"
|
||||||
+ " AND dp.bes_ins_discipline_key_inkoop IS NULL"
|
+ " AND dp.bes_ins_discipline_key_inkoop IS NULL"
|
||||||
// Het moet een gekoppelde discipline zijn
|
// Het moet een gekoppelde discipline zijn
|
||||||
+ " AND dp.bes_ins_discipline_key IN"
|
+ " AND dp.bes_ins_discipline_key IN"
|
||||||
@@ -323,7 +331,7 @@ function bes_voorraad_list (pautfunction, params)
|
|||||||
+ " , bo.voorraadmin"
|
+ " , bo.voorraadmin"
|
||||||
+ " , SUM (bo.aantal_intern) aantal_intern_uit"
|
+ " , SUM (bo.aantal_intern) aantal_intern_uit"
|
||||||
+ " , SUM (bo.aantal_extern_geleverd) aantal_geleverd"
|
+ " , SUM (bo.aantal_extern_geleverd) aantal_geleverd"
|
||||||
+ " , SUM (bo.aantal_extern_besteld) aantal_besteld"
|
+ " , SUM (bo.aantal_open_order) aantal_open_order"
|
||||||
+ " , bo.maxbestel"
|
+ " , bo.maxbestel"
|
||||||
+ " , bo.bestelmin"
|
+ " , bo.bestelmin"
|
||||||
+ " , bo.bestelveelvoud"
|
+ " , bo.bestelveelvoud"
|
||||||
@@ -352,7 +360,7 @@ function bes_voorraad_list (pautfunction, params)
|
|||||||
+ " , SUM(a.aantal_intern_uit) aantal_intern_uit"
|
+ " , SUM(a.aantal_intern_uit) aantal_intern_uit"
|
||||||
+ " , SUM(CEIL (a.aantal_intern_uit / b.intern_voorraadfactor)) aantal_extern_uit"
|
+ " , SUM(CEIL (a.aantal_intern_uit / b.intern_voorraadfactor)) aantal_extern_uit"
|
||||||
+ " , SUM(a.aantal_geleverd) aantal_geleverd"
|
+ " , SUM(a.aantal_geleverd) aantal_geleverd"
|
||||||
+ " , SUM(a.aantal_besteld) aantal_besteld"
|
+ " , SUM(a.aantal_open_order) aantal_open_order"
|
||||||
+ " , b.intern_voorraadfactor"
|
+ " , b.intern_voorraadfactor"
|
||||||
+ " , SUM(a.aantal_geleverd) - SUM(CEIL (a.aantal_intern_uit / b.intern_voorraadfactor)) voorraad"
|
+ " , SUM(a.aantal_geleverd) - SUM(CEIL (a.aantal_intern_uit / b.intern_voorraadfactor)) voorraad"
|
||||||
+ " , b.intern_notitie"
|
+ " , b.intern_notitie"
|
||||||
@@ -396,14 +404,14 @@ function bes_voorraad_list (pautfunction, params)
|
|||||||
+ " , aantal_intern_uit"
|
+ " , aantal_intern_uit"
|
||||||
+ " , aantal_extern_uit"
|
+ " , aantal_extern_uit"
|
||||||
+ " , aantal_geleverd"
|
+ " , aantal_geleverd"
|
||||||
+ " , aantal_besteld"
|
+ " , aantal_open_order"
|
||||||
+ " , CASE"
|
+ " , CASE"
|
||||||
+ " WHEN ( COALESCE(aantal_besteld, 0)"
|
+ " WHEN ( COALESCE(aantal_open_order, 0)"
|
||||||
+ " + COALESCE (aantal_geleverd, 0)"
|
+ " + COALESCE (aantal_geleverd, 0)"
|
||||||
+ " - COALESCE (aantal_extern_uit, 0) < voorraadmin)"
|
+ " - COALESCE (aantal_extern_uit, 0) < voorraadmin)"
|
||||||
+ " THEN"
|
+ " THEN"
|
||||||
+ " voorraadmax"
|
+ " voorraadmax"
|
||||||
+ " - COALESCE (aantal_besteld, 0)"
|
+ " - COALESCE (aantal_open_order, 0)"
|
||||||
+ " - COALESCE (aantal_geleverd, 0)"
|
+ " - COALESCE (aantal_geleverd, 0)"
|
||||||
+ " + COALESCE (aantal_extern_uit, 0)"
|
+ " + COALESCE (aantal_extern_uit, 0)"
|
||||||
+ " ELSE"
|
+ " ELSE"
|
||||||
@@ -441,7 +449,7 @@ function bes_voorraad_list (pautfunction, params)
|
|||||||
function fncolTeBestellen(oRs)
|
function fncolTeBestellen(oRs)
|
||||||
{
|
{
|
||||||
var tebestellen = oRs("tebestellen").Value || 0;
|
var tebestellen = oRs("tebestellen").Value || 0;
|
||||||
var besteld = oRs("aantal_besteld").Value || 0;
|
var besteld = oRs("aantal_open_order").Value || 0;
|
||||||
var voorraad = oRs("voorraad").Value;
|
var voorraad = oRs("voorraad").Value;
|
||||||
var bestelminimum = oRs("bestelmin").Value || 0;
|
var bestelminimum = oRs("bestelmin").Value || 0;
|
||||||
var maxbestel = oRs("maxbestel").Value || 0; // Setting "Maximum bestelaantal is voorraad" 0=Nee, 1=Ja.
|
var maxbestel = oRs("maxbestel").Value || 0; // Setting "Maximum bestelaantal is voorraad" 0=Nee, 1=Ja.
|
||||||
@@ -520,7 +528,7 @@ function bes_voorraad_list (pautfunction, params)
|
|||||||
rst.addColumn(new Column({caption: L("lcl_bes_aantal_in"), content: "aantal_geleverd", datatype: "integer", total: true}));
|
rst.addColumn(new Column({caption: L("lcl_bes_aantal_in"), content: "aantal_geleverd", datatype: "integer", total: true}));
|
||||||
rst.addColumn(new Column({caption: L("lcl_bes_aantal_uit"), content: "aantal_extern_uit", datatype: "integer", total: true}));
|
rst.addColumn(new Column({caption: L("lcl_bes_aantal_uit"), content: "aantal_extern_uit", datatype: "integer", total: true}));
|
||||||
rst.addColumn(new Column({caption: L("lcl_bes_voorraad"), content: "voorraad", datatype: "integer", total: true}));
|
rst.addColumn(new Column({caption: L("lcl_bes_voorraad"), content: "voorraad", datatype: "integer", total: true}));
|
||||||
rst.addColumn(new Column({caption: L("lcl_bes_lopend"), content: "aantal_besteld", datatype: "integer", total: true}));
|
rst.addColumn(new Column({caption: L("lcl_bes_lopend"), content: "aantal_open_order", datatype: "integer", total: true}));
|
||||||
rst.addColumn(new Column({caption: L("lcl_bes_bestellen"), content: fncolTeBestellen, datatype: "integer", total: true}));
|
rst.addColumn(new Column({caption: L("lcl_bes_bestellen"), content: fncolTeBestellen, datatype: "integer", total: true}));
|
||||||
|
|
||||||
// Acties
|
// Acties
|
||||||
|
|||||||
Reference in New Issue
Block a user